![]() |
DRM-Schutz von WMA-Dateien erkennen
SirThornberry hat
![]() Der Code bedient sich dieser WinAPI-Funktion: ![]()
Delphi-Quellcode:
Oder alternativ mit statisch eingebundener Bibliothek:
function IsFileDRMProtected(AFileName: String): Boolean;
var lCheckProc: function(const AFileName: PWideChar; var AIsProtected: Bool): HRESULT; stdcall; lLibHandle: Cardinal; lWideChar : PWideChar; lSize : Integer; lRes : HRESULT; lIsProtected: Bool; begin lLibHandle := LoadLibrary('wmvcore.dll'); if (lLibHandle > 0) then begin lCheckProc := GetProcAddress(lLibHandle, 'WMIsContentProtected'); if Assigned(lCheckProc) then begin GetMem(lWideChar, MAX_PATH * SizeOf(WideChar)); StringToWideChar(AFileName, lWideChar, MAX_PATH); lRes := lCheckProc(lWideChar, lIsProtected); case lRes of S_OK: result := lIsProtected else result := False; end; end else result := False; end else result := False; end;
Delphi-Quellcode:
type
function WMIsContentProtected(const AFileName: PWideChar; var AIsProtected: Bool): HRESULT; stdcall; external 'wmvcore.dll'; [...] function IsFileDRMProtected(AFileName: String): Boolean; var lWideChar : PWideChar; lSize : Integer; lRes : HRESULT; lIsProtected: Bool; begin GetMem(lWideChar, MAX_PATH * SizeOf(WideChar)); StringToWideChar(AFileName, lWideChar, MAX_PATH); lRes := WMIsContentProtected(lWideChar, lIsProtected); case lRes of S_OK: result := lIsProtected else result := False; end; end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 00:49 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz