需要的类型,不知我有没有写错,调用函数时一直有堆栈错误<br><br>type<br> // 一般情况下用:NO_MULTIPLE_TRUSTEE<br> MULTIPLE_TRUSTEE_OPERATION = (NO_MULTIPLE_TRUSTEE, TRUSTEE_IS_IMPERSONATE);<br> // 托管人标示类型<br> TRUSTEE_FORM = (TRUSTEE_IS_SID, TRUSTEE_IS_NAME, TRUSTEE_BAD_FORM, TRUSTEE_IS_OBJECTS_AND_SID,<br> TRUSTEE_IS_OBJECTS_AND_NAME);<br> // 托管人类型<br> TRUSTEE_TYPE = (TRUSTEE_IS_UNKNOWN, TRUSTEE_IS_USER, TRUSTEE_IS_GROUP,<br> TRUSTEE_IS_DOMAIN, TRUSTEE_IS_ALIAS, TRUSTEE_IS_WELL_KNOWN_GROUP,<br> TRUSTEE_IS_DELETED, TRUSTEE_IS_INVALID, TRUSTEE_IS_COMPUTER);<br> // 对象类型<br> SE_OBJECT_TYPE = (SE_UNKNOWN_OBJECT_TYPE, SE_FILE_OBJECT, SE_SERVICE, SE_PRINTER,<br> SE_REGISTRY_KEY, SE_LMSHARE, SE_KERNEL_OBJECT, SE_WINDOW_OBJECT, SE_DS_OBJECT,<br> SE_DS_OBJECT_ALL, SE_PROVIDER_DEFINED_OBJECT, SE_WMIGUID_OBJECT,<br> SE_REGISTRY_WOW64_32KEY);<br><br> // 托管人结构<br> PTRUSTEE = ^TRUSTEE;<br> TRUSTEE = record<br> pMultipleTrustee: PTRUSTEE;<br> MultipleTrusteeOperation: MULTIPLE_TRUSTEE_OPERATION;<br> TrusteeForm: TRUSTEE_FORM;<br> TrusteeType: TRUSTEE_TYPE;<br> ptstrName: LPTSTR;<br> end;<br><br> ACCESS_MODE = (NOT_USED_ACCESS = 0, GRANT_ACCESS, SET_ACCESS, DENY_ACCESS,<br> REVOKE_ACCESS, SET_AUDIT_SUCCESS, SET_AUDIT_FAILURE);<br><br> PEXPLICIT_ACCESS = ^EXPLICIT_ACCESS;<br> EXPLICIT_ACCESS = record<br> grfAccessPermissions: DWORD;<br> grfAccessMode: ACCESS_MODE;<br> grfInheritance: DWORD;<br> Trustee: TRUSTEE;<br> end;<br><br> PSID_IDENTIFIER_AUTHORITY = ^SID_IDENTIFIER_AUTHORITY;<br> SID_IDENTIFIER_AUTHORITY = record<br> Value : array[1..6] of BYTE;<br> end;<br><br>function AllocateAndInitializeSid(pIdentifierAuthority: PSID_IDENTIFIER_AUTHORITY;<br> nSubAuthorityCount: BYTE; dwSubAuthority0: DWORD; dwSubAuthority1: DWORD;<br> dwSubAuthority2: DWORD; dwSubAuthority3: DWORD; dwSubAuthority4: DWORD;<br> dwSubAuthority5: DWORD; dwSubAuthority6: DWORD; dwSubAuthority7: DWORD;<br> pSid: PSID): bool; stdcall; external 'Advapi32.dll'<br><br>function GetNamedSecurityInfo(pObjectName: LPTSTR; ObjectType: SE_OBJECT_TYPE;<br> SecurityInfo: SECURITY_INFORMATION; ppsidOwner: PSID; ppsidGroup: PSID;<br> ppDacl: PACL; ppSacl: PACL; ppSecurityDescriptor: PSECURITY_DESCRIPTOR):<br> DWORD; stdcall; external 'Advapi32.dll'<br><br>function SetEntriesInAcl(cCountOfExplicitEntries: ULONG; pListOfExplicitEntries: PEXPLICIT_ACCESS;<br> OldAcl: PACL; NewAcl: PACL): DWORD; stdcall; external 'Advapi32.dll'<br><br>function SetNamedSecurityInfo(pObjectName: LPTSTR; ObjectType: SE_OBJECT_TYPE;<br> SecurityInfo: SECURITY_INFORMATION; psidOwner: PSID; psidGroup: PSID;<br> pDacl: PACL; pSacl: PACL): DWORD; stdcall; external 'Advapi32.dll'<br>