Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

750 lines
20 KiB

  1. /*++
  2. Copyright (c) 1997-2001 Microsoft Corporation
  3. Module Name:
  4. winsafer.h
  5. Abstract:
  6. This file implements the publicly exported functions, data types,
  7. data structures, and definitions usable by programs that directly
  8. interact with the Windows SAFER APIs.
  9. --*/
  10. #ifndef _WINSAFER_H
  11. #define _WINSAFER_H
  12. #include <guiddef.h>
  13. #include <wincrypt.h>
  14. ;begin_both
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. ;end_both
  19. //
  20. // Opaque datatype for representing handles to Safer objects.
  21. //
  22. DECLARE_HANDLE(SAFER_LEVEL_HANDLE);
  23. //
  24. // Constants to represent scope with SaferCreateLevel and others.
  25. //
  26. #define SAFER_SCOPEID_MACHINE 1
  27. #define SAFER_SCOPEID_USER 2
  28. ;begin_internal
  29. #define SAFER_SCOPEID_REGISTRY 3
  30. ;end_internal
  31. //
  32. // Pre-defined levels that can be used with SaferCreateLevel
  33. //
  34. #define SAFER_LEVELID_FULLYTRUSTED 0x40000
  35. #define SAFER_LEVELID_NORMALUSER 0x20000
  36. #define SAFER_LEVELID_CONSTRAINED 0x10000
  37. #define SAFER_LEVELID_UNTRUSTED 0x01000
  38. #define SAFER_LEVELID_DISALLOWED 0x00000
  39. //
  40. // Flags to use when creating/opening a Level with SaferCreateLevel
  41. //
  42. #define SAFER_LEVEL_OPEN 1
  43. ;begin_internal
  44. #define SAFER_LEVEL_DELETE 2
  45. #define SAFER_LEVEL_CREATE 4
  46. ;end_internal
  47. //
  48. // Maximum string size.
  49. //
  50. #define SAFER_MAX_FRIENDLYNAME_SIZE 256
  51. #define SAFER_MAX_DESCRIPTION_SIZE 256
  52. #define SAFER_MAX_HASH_SIZE 64
  53. //
  54. // Flags to use with SaferComputeTokenFromLevel.
  55. //
  56. #define SAFER_TOKEN_NULL_IF_EQUAL 0x00000001
  57. #define SAFER_TOKEN_COMPARE_ONLY 0x00000002
  58. #define SAFER_TOKEN_MAKE_INERT 0x00000004
  59. #define SAFER_TOKEN_WANT_FLAGS 0x00000008
  60. //
  61. // Flags for specifying what criteria within SAFER_CODE_PROPERTIES to evaluate
  62. // when finding code identity with SaferIdentifyLevel.
  63. //
  64. #define SAFER_CRITERIA_IMAGEPATH 0x00001
  65. #define SAFER_CRITERIA_IMAGEHASH 0x00004
  66. #define SAFER_CRITERIA_AUTHENTICODE 0x00008
  67. #define SAFER_CRITERIA_URLZONE 0x00010
  68. #define SAFER_CRITERIA_IMAGEPATH_NT 0x01000
  69. //
  70. // Code image information structure passed to SaferIdentifyLevel.
  71. //
  72. #include <pshpack8.h>
  73. typedef struct _SAFER_CODE_PROPERTIES
  74. {
  75. //
  76. // Must be initialized to be the size of this structure,
  77. // for the purposes of future/backwards compatibility.
  78. //
  79. DWORD cbSize;
  80. //
  81. // Must be initialized to the types of criteria that should
  82. // be considered when evaluating this structure. This can be
  83. // a combination of the SAFER_CRITERIA_xxxx flags. If not enough
  84. // of the structure elements needed to evaluate the criteria
  85. // types indicated were supplied, then some of those criteria
  86. // flags may be silently ignored. Specifying 0 for this value
  87. // will cause the entire structure's contents to be ignored.
  88. //
  89. DWORD dwCheckFlags;
  90. //
  91. // Optionally specifies the fully-qualified path and filename
  92. // to be used for discrimination checks based on the path.
  93. // The ImagePath will additionally be used to open and read the
  94. // file to identify any other discrimination criteria that was
  95. // unsupplied in this structure.
  96. //
  97. LPCWSTR ImagePath;
  98. //
  99. // Optionally specifies a file handle that has been opened to
  100. // code image with at least GENERIC_READ access. The handle will
  101. // be used instead of explicitly opening the file again to compute
  102. // other discrimination criteria that was unsupplied in this structure.
  103. //
  104. HANDLE hImageFileHandle;
  105. //
  106. // Optionally specifies the pre-determined Internet Explorer
  107. // security zone. These enums are defined within urlmon.h
  108. // For example: URLZONE_LOCAL_MACHINE, URLZONE_INTRANET,
  109. // URLZONE_TRUSTED, URLZONE_INTERNET, or URLZONE_UNTRUSTED.
  110. //
  111. DWORD UrlZoneId;
  112. //
  113. // Optionally specifies the pre-computed hash of the image.
  114. // The supplied hash is interpreted as being valid if ImageSize
  115. // is non-zero and dwImageHashSize is non-zero and HashAlgorithm
  116. // represents a valid hashing algorithm from wincrypt.h
  117. //
  118. // If the supplied hash fails to meet the conditions above, then
  119. // the hash will be automatically computed against:
  120. // 1) by using ImageSize and pByteBlock if both are non-zero.
  121. // 2) by using hImageFileHandle if it is non-null.
  122. // 3) by attempting to open ImagePath if it is non-null.
  123. //
  124. BYTE ImageHash[SAFER_MAX_HASH_SIZE];
  125. DWORD dwImageHashSize;
  126. LARGE_INTEGER ImageSize;
  127. ALG_ID HashAlgorithm;
  128. //
  129. // Optionally specifies a memory block of memory representing
  130. // the image for which the trust is being requested for. When
  131. // this member is specified, ImageSize must also be supplied.
  132. //
  133. LPBYTE pByteBlock;
  134. //
  135. // Optionally gives the arguments used for Authenticode signer
  136. // certificate verification. These arguments are supplied to the
  137. // WinVerifyTrust() API and control the user-interface prompting
  138. // to accept untrusted certificates.
  139. //
  140. HWND hWndParent;
  141. DWORD dwWVTUIChoice;
  142. } SAFER_CODE_PROPERTIES, *PSAFER_CODE_PROPERTIES;
  143. #include <poppack.h>
  144. //
  145. // Masks for the per-identity WinSafer flags
  146. //
  147. #define SAFER_POLICY_JOBID_MASK 0xFF000000
  148. #define SAFER_POLICY_JOBID_CONSTRAINED 0x04000000
  149. #define SAFER_POLICY_JOBID_UNTRUSTED 0x03000000
  150. #define SAFER_POLICY_ONLY_EXES 0x00010000
  151. #define SAFER_POLICY_SANDBOX_INERT 0x00020000
  152. #define SAFER_POLICY_UIFLAGS_MASK 0x000000FF
  153. #define SAFER_POLICY_UIFLAGS_INFORMATION_PROMPT 0x00000001
  154. #define SAFER_POLICY_UIFLAGS_OPTION_PROMPT 0x00000002
  155. //
  156. // Information classes on the overall policy that can be queried
  157. // with SaferSet/GetPolicyInformation and set at different
  158. // policy scopes based on access of the caller.
  159. //
  160. typedef enum _SAFER_POLICY_INFO_CLASS
  161. {
  162. //
  163. // Accesses the list of all Levels defined in a policy.
  164. // The corresponding data element is a buffer that is filled
  165. // with multiple DWORDs, each representing the LevelIds that
  166. // are defined within this scope.
  167. //
  168. SaferPolicyLevelList = 1,
  169. //
  170. // for transparent enforcement of policy in the execution
  171. // framework -- will be used by native code execution but can
  172. // be used by any policy enforcement environment.
  173. // Corresponding data element is a DWORD holding a Boolean value.
  174. //
  175. SaferPolicyEnableTransparentEnforcement,
  176. //
  177. // Returns the name of the Level that has been designed
  178. // as the default level within the specified scope.
  179. // The corresponding data element is a single DWORD buffer
  180. // representing the LevelId of the default Level. If no
  181. // level has been configured to be the default, then the
  182. // GetInfo API will return FALSE and GetLastError will
  183. // return ERROR_NOT_FOUND.
  184. //
  185. SaferPolicyDefaultLevel,
  186. //
  187. // Returns whether Code Identities or Default Level within the
  188. // user scope can be considered during identification.
  189. //
  190. SaferPolicyEvaluateUserScope,
  191. //
  192. // Control Flags for for safer policy scope.
  193. //
  194. SaferPolicyScopeFlags
  195. } SAFER_POLICY_INFO_CLASS;
  196. //
  197. // Enumerations used for retrieving specific information about a
  198. // single authorization Level via SaferGet/SetInformationFromLevel.
  199. //
  200. typedef enum _SAFER_OBJECT_INFO_CLASS
  201. {
  202. SaferObjectLevelId = 1, // get: DWORD
  203. SaferObjectScopeId, // get: DWORD
  204. SaferObjectFriendlyName, // get/set: LPCWSTR
  205. SaferObjectDescription, // get/set: LPCWSTR
  206. SaferObjectBuiltin, // get: DWORD boolean
  207. SaferObjectDisallowed, // get: DWORD boolean
  208. SaferObjectDisableMaxPrivilege, // get: DWORD boolean
  209. SaferObjectInvertDeletedPrivileges, // get: DWORD boolean
  210. SaferObjectDeletedPrivileges, // get: TOKEN_PRIVILEGES
  211. SaferObjectDefaultOwner, // get: TOKEN_OWNER
  212. SaferObjectSidsToDisable, // get: TOKEN_GROUPS
  213. SaferObjectRestrictedSidsInverted, // get: TOKEN_GROUPS
  214. SaferObjectRestrictedSidsAdded, // get: TOKEN_GROUPS
  215. //
  216. // To enumerate all identities, call GetInfo with
  217. // SaferObjectAllIdentificationGuids.
  218. //
  219. SaferObjectAllIdentificationGuids, // get: SAFER_IDENTIFICATION_GUIDS
  220. //
  221. // To create a new identity, call SetInfo with
  222. // SaferObjectSingleIdentification with a new
  223. // unique GUID that you have generated.
  224. // To get details on a single identity, call GetInfo with
  225. // SaferObjectSingleIdentification with desired GUID.
  226. // To modify details of a single identity, call SetInfo with
  227. // SaferObjectSingleIdentification with desired info and GUID.
  228. // To delete an identity, call SetInfo with
  229. // SaferObjectSingleIdentification with the
  230. // header.dwIdentificationType set to 0.
  231. //
  232. SaferObjectSingleIdentification, // get/set: SAFER_IDENTIFICATION_*
  233. SaferObjectExtendedError // get: DWORD dwError
  234. } SAFER_OBJECT_INFO_CLASS;
  235. //
  236. // Structures and enums used by the SaferGet/SetLevelInformation APIs.
  237. //
  238. #include <pshpack8.h>
  239. typedef enum _SAFER_IDENTIFICATION_TYPES
  240. {
  241. SaferIdentityDefault,
  242. SaferIdentityTypeImageName = 1,
  243. SaferIdentityTypeImageHash,
  244. SaferIdentityTypeUrlZone,
  245. SaferIdentityTypeCertificate
  246. } SAFER_IDENTIFICATION_TYPES;
  247. typedef struct _SAFER_IDENTIFICATION_HEADER
  248. {
  249. //
  250. // indicates the type of the structure, one of SaferIdentityType*
  251. //
  252. SAFER_IDENTIFICATION_TYPES dwIdentificationType;
  253. //
  254. // size of the whole structure, not just the common header.
  255. //
  256. DWORD cbStructSize;
  257. //
  258. // the unique GUID of the Identity in question.
  259. //
  260. GUID IdentificationGuid;
  261. //
  262. // last change of this identification.
  263. //
  264. FILETIME lastModified;
  265. } SAFER_IDENTIFICATION_HEADER, *PSAFER_IDENTIFICATION_HEADER;
  266. typedef struct _SAFER_PATHNAME_IDENTIFICATION
  267. {
  268. //
  269. // header.dwIdentificationType must be SaferIdentityTypeImageName
  270. // header.cbStructSize must be sizeof(SAFER_PATHNAME_IDENTIFICATION)
  271. //
  272. SAFER_IDENTIFICATION_HEADER header;
  273. //
  274. // user-entered description
  275. //
  276. WCHAR Description[SAFER_MAX_DESCRIPTION_SIZE];
  277. //
  278. // filepath or name, possibly with vars
  279. //
  280. PWCHAR ImageName;
  281. //
  282. // any combo of SAFER_POL_SAFERFLAGS_*
  283. //
  284. DWORD dwSaferFlags;
  285. } SAFER_PATHNAME_IDENTIFICATION, *PSAFER_PATHNAME_IDENTIFICATION;
  286. typedef struct _SAFER_HASH_IDENTIFICATION
  287. {
  288. //
  289. // header.dwIdentificationType must be SaferIdentityTypeImageHash
  290. // header.cbStructSize must be sizeof(SAFER_HASH_IDENTIFICATION)
  291. //
  292. SAFER_IDENTIFICATION_HEADER header;
  293. //
  294. // user-entered friendly name, initially from file's resources.
  295. //
  296. WCHAR Description[SAFER_MAX_DESCRIPTION_SIZE];
  297. //
  298. // user-entered description.
  299. //
  300. WCHAR FriendlyName[SAFER_MAX_FRIENDLYNAME_SIZE];
  301. //
  302. // amount of ImageHash actually used, in bytes (MD5 is 16 bytes).
  303. //
  304. DWORD HashSize;
  305. //
  306. // computed hash data itself.
  307. //
  308. BYTE ImageHash[SAFER_MAX_HASH_SIZE];
  309. //
  310. // algorithm in which the hash was computed (CALG_MD5, etc).
  311. //
  312. ALG_ID HashAlgorithm;
  313. //
  314. // size of the original file in bytes.
  315. //
  316. LARGE_INTEGER ImageSize;
  317. //
  318. // any combo of SAFER_POL_SAFERFLAGS_*
  319. //
  320. DWORD dwSaferFlags;
  321. } SAFER_HASH_IDENTIFICATION, *PSAFER_HASH_IDENTIFICATION;
  322. typedef struct _SAFER_URLZONE_IDENTIFICATION
  323. {
  324. //
  325. // header.dwIdentificationType must be SaferIdentityTypeUrlZone
  326. // header.cbStructSize must be sizeof(SAFER_URLZONE_IDENTIFICATION)
  327. //
  328. SAFER_IDENTIFICATION_HEADER header;
  329. //
  330. // any single URLZONE_* from urlmon.h
  331. //
  332. DWORD UrlZoneId;
  333. //
  334. // any combo of SAFER_POLICY_*
  335. //
  336. DWORD dwSaferFlags;
  337. } SAFER_URLZONE_IDENTIFICATION, *PSAFER_URLZONE_IDENTIFICATION;
  338. #include <poppack.h>
  339. //
  340. // Functions related to querying and setting the global policy
  341. // controls to disable transparent enforcement, and perform level
  342. // enumeration operations.
  343. //
  344. WINADVAPI
  345. BOOL WINAPI
  346. SaferGetPolicyInformation(
  347. IN DWORD dwScopeId,
  348. IN SAFER_POLICY_INFO_CLASS SaferPolicyInfoClass,
  349. IN DWORD InfoBufferSize,
  350. IN OUT PVOID InfoBuffer,
  351. IN OUT PDWORD InfoBufferRetSize,
  352. IN LPVOID lpReserved
  353. );
  354. WINADVAPI
  355. BOOL WINAPI
  356. SaferSetPolicyInformation(
  357. IN DWORD dwScopeId,
  358. IN SAFER_POLICY_INFO_CLASS SaferPolicyInfoClass,
  359. IN DWORD InfoBufferSize,
  360. IN PVOID InfoBuffer,
  361. IN LPVOID lpReserved
  362. );
  363. //
  364. // Functions to open or close a handle to a Safer Level.
  365. //
  366. WINADVAPI
  367. BOOL WINAPI
  368. SaferCreateLevel(
  369. IN DWORD dwScopeId,
  370. IN DWORD dwLevelId,
  371. IN DWORD OpenFlags,
  372. OUT SAFER_LEVEL_HANDLE * pLevelHandle,
  373. IN LPVOID lpReserved
  374. );
  375. WINADVAPI
  376. BOOL WINAPI
  377. SaferCloseLevel(
  378. IN SAFER_LEVEL_HANDLE hLevelHandle
  379. );
  380. WINADVAPI
  381. BOOL WINAPI
  382. SaferIdentifyLevel(
  383. IN DWORD dwNumProperties,
  384. IN PSAFER_CODE_PROPERTIES pCodeProperties,
  385. OUT SAFER_LEVEL_HANDLE * pLevelHandle,
  386. IN LPVOID lpReserved
  387. );
  388. WINADVAPI
  389. BOOL WINAPI
  390. SaferComputeTokenFromLevel(
  391. IN SAFER_LEVEL_HANDLE LevelHandle,
  392. IN HANDLE InAccessToken OPTIONAL,
  393. OUT PHANDLE OutAccessToken,
  394. IN DWORD dwFlags,
  395. IN LPVOID lpReserved
  396. );
  397. WINADVAPI
  398. BOOL WINAPI
  399. SaferGetLevelInformation(
  400. IN SAFER_LEVEL_HANDLE LevelHandle,
  401. IN SAFER_OBJECT_INFO_CLASS dwInfoType,
  402. OUT LPVOID lpQueryBuffer OPTIONAL,
  403. IN DWORD dwInBufferSize,
  404. OUT LPDWORD lpdwOutBufferSize
  405. );
  406. WINADVAPI
  407. BOOL WINAPI
  408. SaferSetLevelInformation(
  409. IN SAFER_LEVEL_HANDLE LevelHandle,
  410. IN SAFER_OBJECT_INFO_CLASS dwInfoType,
  411. IN LPVOID lpQueryBuffer,
  412. IN DWORD dwInBufferSize
  413. );
  414. //
  415. // This function performs logging of messages to the Application
  416. // event log. This is called by the hooks within CreateProcess,
  417. // ShellExecute and cmd when a lower trust evaluation result occurs.
  418. //
  419. WINADVAPI
  420. BOOL WINAPI
  421. SaferRecordEventLogEntry(
  422. IN SAFER_LEVEL_HANDLE hLevel,
  423. IN LPCWSTR szTargetPath,
  424. IN LPVOID lpReserved
  425. );
  426. ;begin_internal
  427. //
  428. // Private registry key locations.
  429. //
  430. #define SAFER_HKLM_REGBASE L"Software\\Policies\\Microsoft\\Windows\\Safer"
  431. #define SAFER_HKCU_REGBASE L"Software\\Policies\\Microsoft\\Windows\\Safer"
  432. //
  433. // default winsafer executable file types as a multisz string
  434. //
  435. #define SAFER_DEFAULT_EXECUTABLE_FILE_TYPES L"ADE\0ADP\0BAS\0BAT\0CHM\0\
  436. CMD\0COM\0CPL\0CRT\0EXE\0HLP\0HTA\0INF\0INS\0ISP\0LNK\0MDB\0MDE\0MSC\0\
  437. MSI\0MSP\0MST\0OCX\0PCD\0PIF\0REG\0SCR\0SHS\0URL\0VB\0WSC\0"
  438. //
  439. // name of the objects sub-branch.
  440. //
  441. #define SAFER_OBJECTS_REGSUBKEY L"LevelObjects"
  442. //
  443. // names of the values under each of the object sub-branches.
  444. //
  445. #define SAFER_OBJFRIENDLYNAME_REGVALUEW L"FriendlyName"
  446. #define SAFER_OBJDESCRIPTION_REGVALUEW L"Description"
  447. #define SAFER_OBJDISALLOW_REGVALUE L"DisallowExecution"
  448. //
  449. // name of the code identifiers sub-branch
  450. //
  451. #define SAFER_CODEIDS_REGSUBKEY L"CodeIdentifiers"
  452. //
  453. // name of the value under the top level code identifier branch.
  454. //
  455. #define SAFER_DEFAULTOBJ_REGVALUE L"DefaultLevel"
  456. #define SAFER_TRANSPARENTENABLED_REGVALUE L"TransparentEnabled"
  457. #define SAFER_HONORUSER_REGVALUE L"HonorUserIdentities"
  458. #define SAFER_EXETYPES_REGVALUE L"ExecutableTypes"
  459. #define SAFER_POLICY_SCOPE L"PolicyScope"
  460. #define SAFER_LOGFILE_NAME L"LogFileName"
  461. #define SAFER_HIDDEN_LEVELS L"Levels"
  462. #define SAFER_AUTHENTICODE_REGVALUE L"AuthenticodeEnabled"
  463. //
  464. // names of the various subkeys under the code identifier sub-branches
  465. //
  466. #define SAFER_PATHS_REGSUBKEY L"Paths"
  467. #define SAFER_HASHMD5_REGSUBKEY L"Hashes"
  468. #define SAFER_SOURCEURL_REGSUBKEY L"UrlZones"
  469. //
  470. // names of the various values under each code identifiery sub-branch.
  471. //
  472. #define SAFER_IDS_LASTMODIFIED_REGVALUE L"LastModified"
  473. #define SAFER_IDS_DESCRIPTION_REGVALUE L"Description"
  474. #define SAFER_IDS_ITEMSIZE_REGVALUE L"ItemSize"
  475. #define SAFER_IDS_ITEMDATA_REGVALUE L"ItemData"
  476. #define SAFER_IDS_SAFERFLAGS_REGVALUE L"SaferFlags"
  477. #define SAFER_IDS_FRIENDLYNAME_REGVALUE L"FriendlyName"
  478. #define SAFER_IDS_HASHALG_REGVALUE L"HashAlg"
  479. #define SAFER_VALUE_NAME_DEFAULT_LEVEL L"DefaultLevel"
  480. #define SAFER_VALUE_NAME_HASH_SIZE L"HashSize"
  481. //
  482. // registry values
  483. //
  484. #define SAFER_IDS_LEVEL_DESCRIPTION_FULLY_TRUSTED L"DescriptionFullyTrusted"
  485. #define SAFER_IDS_LEVEL_DESCRIPTION_NORMAL_USER L"DescriptionNormalUser"
  486. #define SAFER_IDS_LEVEL_DESCRIPTION_CONSTRAINED L"DescriptionConstrained"
  487. #define SAFER_IDS_LEVEL_DESCRIPTION_UNTRUSTED L"DescriptionUntrusted"
  488. #define SAFER_IDS_LEVEL_DESCRIPTION_DISALLOWED L"DescriptionDisallowed"
  489. //
  490. // defines for OOB rules
  491. //
  492. //#define SAFER_DEFAULT_OLK_RULE_PATH L"%USERPROFILE%\\Local Settings\\Temporary Internet Files\\OLK\\"
  493. #define SAFER_LEVEL_ZERO L"0"
  494. #define SAFER_REGKEY_SEPERATOR L"\\"
  495. #define SAFER_DEFAULT_RULE_GUID L"{dda3f824-d8cb-441b-834d-be2efd2c1a33}"
  496. #define SAFER_GUID_RESULT_TRUSTED_CERT \
  497. { 0xc59e7b5a, \
  498. 0xaf71, \
  499. 0x4595, \
  500. {0xb8, 0xdb, 0x46, 0xb4, 0x91, 0xe8, 0x90, 0x07} }
  501. #define SAFER_GUID_RESULT_DEFAULT_LEVEL \
  502. { 0x11015445, \
  503. 0xd282, \
  504. 0x4f86, \
  505. {0x96, 0xa2, 0x9e, 0x48, 0x5f, 0x59, 0x33, 0x02} }
  506. //
  507. // The following is a private function that is exported
  508. // for WinVerifyTrust to call to determine if a given hash has a
  509. // WinSafer policy associated with it.
  510. //
  511. BOOL WINAPI
  512. SaferiSearchMatchingHashRules(
  513. IN ALG_ID HashAlgorithm OPTIONAL,
  514. IN PBYTE pHashBytes,
  515. IN DWORD dwHashSize,
  516. IN DWORD dwOriginalImageSize OPTIONAL,
  517. OUT PDWORD pdwFoundLevel,
  518. OUT PDWORD pdwSaferFlags
  519. );
  520. //
  521. // The following is a private function exported to allow the current
  522. // registry scope to be altered. This has the effect of changing
  523. // how AUTHZSCOPEID_REGISTRY is interepreted.
  524. //
  525. WINADVAPI
  526. BOOL WINAPI
  527. SaferiChangeRegistryScope(
  528. IN HKEY hKeyCustomRoot OPTIONAL,
  529. IN DWORD dwKeyOptions
  530. );
  531. //
  532. // The following is a private function provided to try to empiracally
  533. // determine if the two access token have been restricted with comparable
  534. // WinSafer authorization Levels. When TRUE is returned, the pdwResult
  535. // output parameter will receive any of the following values:
  536. // -1 = Client's access token is more authorized than Server's.
  537. // 0 = Client's access token is comparable level to Server's.
  538. // 1 = Server's access token is more authorized than Clients's.
  539. //
  540. WINADVAPI
  541. BOOL WINAPI
  542. SaferiCompareTokenLevels (
  543. IN HANDLE ClientAccessToken,
  544. IN HANDLE ServerAccessToken,
  545. OUT PDWORD pdwResult
  546. );
  547. WINADVAPI
  548. BOOL WINAPI
  549. SaferiIsExecutableFileType(
  550. IN LPCWSTR szFullPathname,
  551. IN BOOLEAN bFromShellExecute
  552. );
  553. //
  554. // The following is a private function exported to allow population if defaults in
  555. // the registry.
  556. //
  557. BOOL WINAPI
  558. SaferiPopulateDefaultsInRegistry(
  559. IN HKEY hKeyBase,
  560. OUT BOOL *pbSetDefaults
  561. );
  562. ;end_internal
  563. ;begin_both
  564. #ifdef __cplusplus
  565. }
  566. #endif
  567. ;end_both
  568. #endif