本帖最后由 asionwu 于 2010-5-10 16:28 编辑
这个是 Delphi 调用GetSfcFiles API 的代码program GetSfcFiles_Sample;
{$APPTYPE CONSOLE}
uses
Windows;
type
TSfcList = record
wcsFileNameInDllCache: PWideChar; // Name of the file in DllCache
wcsFilePath: PWideChar; // Path of the protected file
wcsWhatEverInfFile: PWideChar; // Name of some INF file ... unknown meaning
end;
TSfcListArray = array[0..0] of TSfcList;
PSfcListArray = ^TSfcListArray;
function SfcGetFiles(
var lpNamelist: PSfcListArray;
var lpNumEntries: DWORD
): DWORD; stdcall; external 'sfcfiles.dll';
(* Call and then iterate through the array with wide strings NumEntries times. *)
var
namelist:PSfcListArray;
i, num:DWORD;
begin
{ This crappy example simply dumps all SFC protected files to the console }
if SfcGetFiles(namelist, num)=ERROR_SUCCESS then
for i:=0 to num-1 do
Writeln(String(namelist^[i].wcsFilePath));
end.
请熟悉这方面的高手帮忙一下,谢谢 |