Re: Help - I cant get SfcIsFileProtected or SfcGetNextProtectedFile to work.
From: Rob Kennedy (me3_at_privacy.net)
Date: 04/11/04
- Next message: Terry Russell: "Re: How to speed up looping through controls (used for restore and maximize)?"
- Previous message: Rob Kennedy: "Re: C Header Conversion Problems"
- In reply to: mc: "Help - I cant get SfcIsFileProtected or SfcGetNextProtectedFile to work."
- Next in thread: Mike: "Re: Help - I cant get SfcIsFileProtected or SfcGetNextProtectedFile to work."
- Reply: Mike: "Re: Help - I cant get SfcIsFileProtected or SfcGetNextProtectedFile to work."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 11 Apr 2004 15:32:46 -0500
mc wrote:
> type
> TPROTECTED_FILE_DATA = packed record
> FileName: array [0..256] of WideChar;
The header you translated this from should have used the MAX_PATH macro
for the character count. You should do the same. (MAX_PATH's current
definition is 260, but that doesn't matter when you get into the habit
of using named constants.)
> FileNumber : DWORD;
> end;
>
> TSfcGetNextProtectedFile = function (Handle: THandle; ProtFileData:
> TPROTECTED_FILE_DATA): Boolean ;
The ProtFileData parameter should be declared as a PProtectedFileData --
a pointer to the structure. As an alternative, you can declare it as a
var or const TProtectedFileData. One way or another, you need to ensure
that a pointer is passed.
The API function is declared as returning a BOOL, which is *not* the
same as Delphi's Boolean. The API type is three bytes wider, and those
three bytes can be very important.
Finally, the API function almost certainly uses the stdcall calling
convention; definitely not Delphi's default register calling convention.
type
TSfcGetNextProtectedFile = function(RpcHandle: THandle; var
ProtFileData: TProtectedFileData): Bool; stdcall;
-- Rob
- Next message: Terry Russell: "Re: How to speed up looping through controls (used for restore and maximize)?"
- Previous message: Rob Kennedy: "Re: C Header Conversion Problems"
- In reply to: mc: "Help - I cant get SfcIsFileProtected or SfcGetNextProtectedFile to work."
- Next in thread: Mike: "Re: Help - I cant get SfcIsFileProtected or SfcGetNextProtectedFile to work."
- Reply: Mike: "Re: Help - I cant get SfcIsFileProtected or SfcGetNextProtectedFile to work."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|