[PSDK]
[reactos.git] / reactos / include / psdk / userenv.h
1 #ifndef _USERENV_H
2 #define _USERENV_H
3
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7
8 #define PI_NOUI (1)
9 #define PI_APPLYPOLICY (2)
10
11 #if (WINVER >= 0x0500)
12 #define RP_FORCE (1)
13 #endif
14
15 /* Values returned by GetProfileType */
16 #if (WINVER >= 0x0500)
17 #define PT_TEMPORARY 1
18 #define PT_ROAMING 2
19 #define PT_MANDATORY 4
20 #endif
21
22 typedef struct _PROFILEINFOA
23 {
24 DWORD dwSize;
25 DWORD dwFlags;
26 LPSTR lpUserName;
27 LPSTR lpProfilePath;
28 LPSTR lpDefaultPath;
29 LPSTR lpServerName;
30 LPSTR lpPolicyPath;
31 HANDLE hProfile;
32 } PROFILEINFOA, *LPPROFILEINFOA;
33
34 typedef struct _PROFILEINFOW
35 {
36 DWORD dwSize;
37 DWORD dwFlags;
38 LPWSTR lpUserName;
39 LPWSTR lpProfilePath;
40 LPWSTR lpDefaultPath;
41 LPWSTR lpServerName;
42 LPWSTR lpPolicyPath;
43 HANDLE hProfile;
44 } PROFILEINFOW, *LPPROFILEINFOW;
45
46 #if (WINVER >= 0x0502)
47 typedef enum _GPO_LINK {
48 GPLinkUnknown = 0,
49 GPLinkMachine,
50 GPLinkSite,
51 GPLinkDomain,
52 GPLinkOrganizationalUnit
53 } GPO_LINK, *PGPO_LINK;
54
55 typedef struct _GROUP_POLICY_OBJECTA {
56 DWORD dwOptions;
57 DWORD dwVersion;
58 LPSTR lpDSPath;
59 LPSTR lpFileSysPath;
60 LPSTR lpDisplayName;
61 CHAR szGPOName[50];
62 GPO_LINK GPOLink;
63 LPARAM lParam;
64 struct _GROUP_POLICY_OBJECTA *pNext;
65 struct _GROUP_POLICY_OBJECTA *pPrev;
66 LPSTR lpExtensions;
67 LPARAM lParam2;
68 LPSTR lpLink;
69 } GROUP_POLICY_OBJECTA, *PGROUP_POLICY_OBJECTA;
70
71 typedef struct _GROUP_POLICY_OBJECTW {
72 DWORD dwOptions;
73 DWORD dwVersion;
74 LPWSTR lpDSPath;
75 LPWSTR lpFileSysPath;
76 LPWSTR lpDisplayName;
77 WCHAR szGPOName[50];
78 GPO_LINK GPOLink;
79 LPARAM lParam;
80 struct _GROUP_POLICY_OBJECTW *pNext;
81 struct _GROUP_POLICY_OBJECTW *pPrev;
82 LPWSTR lpExtensions;
83 LPARAM lParam2;
84 LPWSTR lpLink;
85 } GROUP_POLICY_OBJECTW, *PGROUP_POLICY_OBJECTW;
86 #endif
87
88 /* begin private */
89 BOOL WINAPI InitializeProfiles (VOID);
90 BOOL WINAPI CreateUserProfileA (PSID, LPCSTR);
91 BOOL WINAPI CreateUserProfileW (PSID, LPCWSTR);
92 BOOL WINAPI AddDesktopItemA (BOOL, LPCSTR, LPCSTR, LPCSTR, INT, LPCSTR, WORD, INT);
93 BOOL WINAPI AddDesktopItemW (BOOL, LPCWSTR, LPCWSTR, LPCWSTR, INT, LPCWSTR, WORD, INT);
94 BOOL WINAPI DeleteDesktopItemA (BOOL, LPCSTR);
95 BOOL WINAPI DeleteDesktopItemW (BOOL, LPCWSTR);
96 BOOL WINAPI CreateGroupA (LPCSTR, BOOL);
97 BOOL WINAPI CreateGroupW (LPCWSTR, BOOL);
98 BOOL WINAPI DeleteGroupA (LPCSTR, BOOL);
99 BOOL WINAPI DeleteGroupW (LPCWSTR, BOOL);
100 BOOL WINAPI AddItemA (LPCSTR, BOOL, LPCSTR, LPCSTR, LPCSTR, INT, LPCSTR, WORD, INT);
101 BOOL WINAPI AddItemW (LPCWSTR, BOOL, LPCWSTR, LPCWSTR, LPCWSTR, INT, LPCWSTR, WORD, INT);
102 BOOL WINAPI DeleteItemA (LPCSTR, BOOL, LPCSTR, BOOL);
103 BOOL WINAPI DeleteItemW (LPCWSTR, BOOL, LPCWSTR, BOOL);
104 BOOL WINAPI CopyProfileDirectoryA(LPCSTR, LPCSTR, DWORD);
105 BOOL WINAPI CopyProfileDirectoryW(LPCWSTR, LPCWSTR, DWORD);
106 /* end private */
107 BOOL WINAPI LoadUserProfileA (HANDLE, LPPROFILEINFOA);
108 BOOL WINAPI LoadUserProfileW (HANDLE, LPPROFILEINFOW);
109 BOOL WINAPI UnloadUserProfile (HANDLE, HANDLE);
110
111 BOOL WINAPI GetAllUsersProfileDirectoryA (LPSTR, LPDWORD);
112 BOOL WINAPI GetAllUsersProfileDirectoryW (LPWSTR, LPDWORD);
113 BOOL WINAPI GetDefaultUserProfileDirectoryA (LPSTR, LPDWORD);
114 BOOL WINAPI GetDefaultUserProfileDirectoryW (LPWSTR, LPDWORD);
115 BOOL WINAPI GetProfilesDirectoryA(LPSTR, LPDWORD);
116 BOOL WINAPI GetProfilesDirectoryW(LPWSTR, LPDWORD);
117 BOOL WINAPI GetUserProfileDirectoryA(HANDLE, LPSTR, LPDWORD);
118 BOOL WINAPI GetUserProfileDirectoryW(HANDLE, LPWSTR, LPDWORD);
119 #if (WINVER >= 0x0500)
120 BOOL WINAPI GetProfileType(PDWORD);
121 #endif
122
123 BOOL WINAPI CreateEnvironmentBlock(LPVOID*, HANDLE, BOOL);
124 BOOL WINAPI DestroyEnvironmentBlock(LPVOID);
125 #if (WINVER >= 0x0500)
126 BOOL WINAPI ExpandEnvironmentStringsForUserA (HANDLE, LPCSTR, LPSTR, DWORD);
127 BOOL WINAPI ExpandEnvironmentStringsForUserW (HANDLE, LPCWSTR, LPWSTR, DWORD);
128 #endif
129
130 #if (WINVER >= 0x0502)
131 DWORD
132 WINAPI
133 GetAppliedGPOListA(
134 _In_ DWORD dwFlags,
135 _In_ LPCSTR pMachineName,
136 _In_ PSID pSidUser,
137 _In_ GUID *pGuidExtension,
138 _Out_ PGROUP_POLICY_OBJECTA *ppGPOList
139 );
140 DWORD
141 WINAPI
142 GetAppliedGPOListW(
143 _In_ DWORD dwFlags,
144 _In_ LPCWSTR pMachineName,
145 _In_ PSID pSidUser,
146 _In_ GUID *pGuidExtension,
147 _Out_ PGROUP_POLICY_OBJECTW *ppGPOList
148 );
149 #endif
150
151 HANDLE WINAPI EnterCriticalPolicySection (BOOL);
152 BOOL WINAPI LeaveCriticalPolicySection (HANDLE);
153 BOOL WINAPI RefreshPolicy (BOOL);
154 #if (WINVER >= 0x0500)
155 BOOL WINAPI RefreshPolicyEx (BOOL, DWORD);
156 #endif
157 BOOL WINAPI RegisterGPNotification (HANDLE, BOOL);
158 BOOL WINAPI UnregisterGPNotification (HANDLE);
159
160 #ifdef UNICODE
161 typedef PROFILEINFOW PROFILEINFO;
162 typedef LPPROFILEINFOW LPPROFILEINFO;
163 /* begin private */
164 #define CreateUserProfile CreateUserProfileW
165 #define AddDesktopItem AddDesktopItemW
166 #define DeleteDesktopItem DeleteDesktopItemW
167 #define CreateGroup CreateGroupW
168 #define DeleteGroup DeleteGroupW
169 #define AddItem AddItemW
170 #define DeleteItem DeleteItemW
171 #define CopyProfileDirectory CopyProfileDirectoryW
172 /* end private */
173 #define LoadUserProfile LoadUserProfileW
174 #define GetAllUsersProfileDirectory GetAllUsersProfileDirectoryW
175 #define GetDefaultUserProfileDirectory GetDefaultUserProfileDirectoryW
176 #define GetProfilesDirectory GetProfilesDirectoryW
177 #define GetUserProfileDirectory GetUserProfileDirectoryW
178 #if (WINVER >= 0x0500)
179 #define ExpandEnvironmentStringsForUser ExpandEnvironmentStringsForUserW
180 #endif
181 #if (WINVER >= 0x0502)
182 typedef GROUP_POLICY_OBJECTW GROUP_POLICY_OBJECT;
183 typedef PGROUP_POLICY_OBJECTW PGROUP_POLICY_OBJECT;
184 #define GetAppliedGPOList GetAppliedGPOListW
185 #endif
186 #else
187 typedef PROFILEINFOA PROFILEINFO;
188 typedef LPPROFILEINFOA LPPROFILEINFO;
189 /* begin private */
190 #define CreateUserProfile CreateUserProfileA
191 #define AddDesktopItem AddDesktopItemA
192 #define DeleteDesktopItem DeleteDesktopItemA
193 #define CreateGroup CreateGroupA
194 #define DeleteGroup DeleteGroupA
195 #define AddItem AddItemA
196 #define DeleteItem DeleteItemA
197 #define CopyProfileDirectory CopyProfileDirectoryA
198 /* end private */
199 #define LoadUserProfile LoadUserProfileA
200 #define GetAllUsersProfileDirectory GetAllUsersProfileDirectoryA
201 #define GetDefaultUserProfileDirectory GetDefaultUserProfileDirectoryA
202 #define GetProfilesDirectory GetProfilesDirectoryA
203 #define GetUserProfileDirectory GetUserProfileDirectoryA
204 #if (WINVER >= 0x0500)
205 #define ExpandEnvironmentStringsForUser ExpandEnvironmentStringsForUserA
206 #endif
207 #if (WINVER >= 0x0502)
208 typedef GROUP_POLICY_OBJECTA GROUP_POLICY_OBJECT;
209 typedef PGROUP_POLICY_OBJECTA PGROUP_POLICY_OBJECT;
210 #define GetAppliedGPOList GetAppliedGPOListA
211 #endif
212 #endif
213
214 #ifdef __cplusplus
215 }
216 #endif
217
218 #endif /* _USERENV_H */