📄 sfc.pas
字号:
{******************************************************************}
{ }
{ Borland Delphi Runtime Library }
{ Windows File Protection interface unit }
{ }
{ Portions created by Microsoft are }
{ Copyright (C) 1995-1999 Microsoft Corporation. }
{ All Rights Reserved. }
{ }
{ The original file is: sfc.h, released June 2000. }
{ The original Pascal code is: Sfc.pas, released December 2000 }
{ The initial developer of the Pascal code is Marcel van Brakel }
{ (brakelm@bart.nl). }
{ }
{ Portions created by Marcel van Brakel are }
{ Copyright (C) 1999 Marcel van Brakel. }
{ }
{ Obtained through: }
{ Joint Endeavour of Delphi Innovators (Project JEDI) }
{ }
{ You may retrieve the latest version of this file at the Project }
{ JEDI home page, located at http://delphi-jedi.org }
{ }
{ The contents of this file are used with permission, subject to }
{ the Mozilla Public License Version 1.1 (the "License"); you may }
{ not use this file except in compliance with the License. You may }
{ obtain a copy of the License at }
{ http://www.mozilla.org/MPL/MPL-1.1.html }
{ }
{ Software distributed under the License is distributed on an }
{ "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or }
{ implied. See the License for the specific language governing }
{ rights and limitations under the License. }
{ }
{******************************************************************}
unit Sfc;
{$WEAKPACKAGEUNIT}
{$HPPEMIT ''}
{$HPPEMIT '#include "sfc.h"'}
{$HPPEMIT ''}
{$I WINDEFINES.INC}
interface
uses
WinType;
const
SFC_DISABLE_NORMAL = 0;
{$EXTERNALSYM SFC_DISABLE_NORMAL}
SFC_DISABLE_ASK = 1;
{$EXTERNALSYM SFC_DISABLE_ASK}
SFC_DISABLE_ONCE = 2;
{$EXTERNALSYM SFC_DISABLE_ONCE}
SFC_DISABLE_SETUP = 3;
{$EXTERNALSYM SFC_DISABLE_SETUP}
SFC_DISABLE_NOPOPUPS = 4;
{$EXTERNALSYM SFC_DISABLE_NOPOPUPS}
SFC_SCAN_NORMAL = 0;
{$EXTERNALSYM SFC_SCAN_NORMAL}
SFC_SCAN_ALWAYS = 1;
{$EXTERNALSYM SFC_SCAN_ALWAYS}
SFC_SCAN_ONCE = 2;
{$EXTERNALSYM SFC_SCAN_ONCE}
SFC_QUOTA_DEFAULT = 50;
{$EXTERNALSYM SFC_QUOTA_DEFAULT}
SFC_QUOTA_ALL_FILES = ULONG(-1);
{$EXTERNALSYM SFC_QUOTA_ALL_FILES}
type
PPROTECTED_FILE_DATA = ^PROTECTED_FILE_DATA;
{$EXTERNALSYM PPROTECTED_FILE_DATA}
_PROTECTED_FILE_DATA = record
FileName: array [0..MAX_PATH - 1] of WCHAR;
FileNumber: DWORD;
end;
{$EXTERNALSYM _PROTECTED_FILE_DATA}
PROTECTED_FILE_DATA = _PROTECTED_FILE_DATA;
{$EXTERNALSYM PROTECTED_FILE_DATA}
TProtectedFileData = PROTECTED_FILE_DATA;
PProtectedFileData = PPROTECTED_FILE_DATA;
function SfcGetNextProtectedFile(RpcHandle: HANDLE;
var ProtFileData: PROTECTED_FILE_DATA): BOOL; stdcall;
{$EXTERNALSYM SfcGetNextProtectedFile}
function SfcIsFileProtected(RpcHandle: HANDLE; ProtFileName: LPCWSTR): BOOL; stdcall;
{$EXTERNALSYM SfcIsFileProtected}
//
// new APIs which are not currently supported, but are stubbed out
//
function SfpVerifyFile(pszFileName: LPCTSTR; pszError: LPTSTR; dwErrSize: DWORD): BOOL; stdcall;
implementation
const
SfcDll = 'sfc.dll';
function SfcGetNextProtectedFile; external SfcDll name 'SfcGetNextProtectedFile';
function SfcIsFileProtected; external SfcDll name 'SfcIsFileProtected';
function SfpVerifyFile; external SfcDll name 'SfpVerifyFile';
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -