dinput: Avoid deadlock when CS are acquired in different order.
[wine.git] / include / winsafer.h
blob25654846d9fe77d0ea4e67ecefd55d78c9a95c2e
1 /*
2 * Winsafer definitions
4 * Copyright (C) 2009 Nikolay Sivov
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef __WINE_WINSAFER_H
22 #define __WINE_WINSAFER_H
24 #include <guiddef.h>
25 #include <wincrypt.h>
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
31 DECLARE_HANDLE(SAFER_LEVEL_HANDLE);
33 #define SAFER_MAX_HASH_SIZE 64
35 #include <pshpack8.h>
36 typedef struct _SAFER_CODE_PROPERTIES_V2 {
37 DWORD cbSize;
38 DWORD dwCheckFlags;
39 LPCWSTR ImagePath;
40 HANDLE hImageFileHandle;
41 DWORD UrlZoneId;
42 BYTE ImageHash[SAFER_MAX_HASH_SIZE];
43 DWORD dwImageHashSize;
44 LARGE_INTEGER ImageSize;
45 ALG_ID HashAlgorithm;
46 LPBYTE pByteBlock;
47 HWND hWndParent;
48 DWORD dwWVTUIChoice;
49 LPCWSTR PackageMoniker;
50 LPCWSTR PackagePublisher;
51 LPCWSTR PackageName;
52 ULONG64 PackageVersion;
53 BOOL PackageIsFramework;
54 } SAFER_CODE_PROPERTIES_V2, *PSAFER_CODE_PROPERTIES_V2;
56 typedef SAFER_CODE_PROPERTIES_V2 SAFER_CODE_PROPERTIES, *PSAFER_CODE_PROPERTIES;
57 #include <poppack.h>
59 #define SAFER_SCOPEID_MACHINE 1
60 #define SAFER_SCOPEID_USER 2
62 #define SAFER_LEVELID_DISALLOWED 0x00000
63 #define SAFER_LEVELID_UNTRUSTED 0x01000
64 #define SAFER_LEVELID_CONSTRAINED 0x10000
65 #define SAFER_LEVELID_NORMALUSER 0x20000
66 #define SAFER_LEVELID_FULLYTRUSTED 0x40000
68 #define SAFER_LEVEL_OPEN 1
70 typedef enum _SAFER_POLICY_INFO_CLASS {
71 SaferPolicyLevelList = 1,
72 SaferPolicyEnableTransparentEnforcement,
73 SaferPolicyDefaultLevel,
74 SaferPolicyEvaluateUserScope,
75 SaferPolicyScopeFlags
76 } SAFER_POLICY_INFO_CLASS;
78 typedef enum _SAFER_OBJECT_INFO_CLASS {
79 SaferObjectLevelId = 1,
80 SaferObjectScopeId,
81 SaferObjectFriendlyName,
82 SaferObjectDescription,
83 SaferObjectBuiltin,
84 SaferObjectDisallowed,
85 SaferObjectDisableMaxPrivilege,
86 SaferObjectInvertDeletedPrivileges,
87 SaferObjectDeletedPrivileges,
88 SaferObjectDefaultOwner,
89 SaferObjectSidsToDisable,
90 SaferObjectRestrictedSidsInverted,
91 SaferObjectRestrictedSidsAdded,
92 SaferObjectAllIdentificationGuids,
93 SaferObjectSingleIdentification,
94 SaferObjectExtendedError
95 } SAFER_OBJECT_INFO_CLASS;
97 WINADVAPI BOOL WINAPI SaferCreateLevel(DWORD,DWORD,DWORD,SAFER_LEVEL_HANDLE*,LPVOID);
98 WINADVAPI BOOL WINAPI SaferGetPolicyInformation(DWORD,SAFER_POLICY_INFO_CLASS,DWORD,PVOID,PDWORD,LPVOID);
99 WINADVAPI BOOL WINAPI SaferIdentifyLevel(DWORD,PSAFER_CODE_PROPERTIES,SAFER_LEVEL_HANDLE*,LPVOID);
100 WINADVAPI BOOL WINAPI SaferSetLevelInformation(SAFER_LEVEL_HANDLE,SAFER_OBJECT_INFO_CLASS,LPVOID,DWORD);
102 #ifdef __cplusplus
104 #endif
106 #endif /* __WINE_WINSAFER_H */