ReactOS 0.4.17-dev-1190-g4c812f4
setup.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS system libraries
4 * FILE: dll/win32/userenv/setup.c
5 * PURPOSE: Profile setup functions
6 * PROGRAMMERS: Eric Kohl
7 * Hermes Belusca-Maito
8 */
9
10#include "precomp.h"
11
12#define NDEBUG
13#include <debug.h>
14
15#include "resources.h"
16
17typedef struct _FOLDERDATA
18{
26
27
28static FOLDERDATA
30{
31 {L"AppData Root", L"AppData", TRUE, FALSE, FALSE, FALSE},
32 {L"AppData", L"AppData\\Roaming", FALSE, TRUE, TRUE, FALSE},
33 {L"Desktop", L"Desktop", FALSE, TRUE, TRUE, FALSE},
34 {L"{374DE290-123F-4565-9164-39C4925E467B}", L"Downloads", FALSE, TRUE, TRUE, FALSE},
35 {L"Favorites", L"Favorites", FALSE, TRUE, TRUE, FALSE},
36 {L"Personal", L"Documents", FALSE, TRUE, TRUE, FALSE},
37 {L"My Music", L"Music", FALSE, TRUE, TRUE, FALSE},
38 {L"My Pictures", L"Music", FALSE, TRUE, TRUE, FALSE},
39 {L"My Video", L"Videos", FALSE, TRUE, TRUE, FALSE},
40 {L"NetHood", L"AppData\\Roaming\\Microsoft\\Windows\\Network Shortcuts", TRUE, TRUE, TRUE, FALSE},
41 {L"PrintHood", L"AppData\\Roaming\\Microsoft\\Windows\\Printer Shortcuts", TRUE, TRUE, TRUE, FALSE},
42 {L"Recent", L"AppData\\Roaming\\Microsoft\\Windows\\Recent", TRUE, TRUE, TRUE, FALSE},
43 {L"SendTo", L"AppData\\Roaming\\Microsoft\\Windows\\SendTo", FALSE, TRUE, TRUE, FALSE},
44 {L"CD Burning", L"AppData\\Roaming\\Microsoft\\Windows\\Burn\\Burn", FALSE, TRUE, TRUE, FALSE},
45 {L"Templates", L"Templates", FALSE, TRUE, TRUE, FALSE},
46 {L"Start Menu", L"AppData\\Roaming\\Microsoft\\Windows\\Start Menu", FALSE, TRUE, TRUE, FALSE},
47 {L"Programs", L"AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs", FALSE, TRUE, TRUE, FALSE},
48 {L"Administrative Tools", L"AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Administrative Tools", FALSE, TRUE, TRUE, FALSE},
49 {L"Startup", L"AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup", FALSE, TRUE, TRUE, FALSE},
50 {L"Local AppData", L"AppData\\Local", FALSE, TRUE, TRUE, FALSE},
51 {L"{A520A1A4-1780-4FF6-BD18-167343C5AF16}", L"AppData\\LocalLow", FALSE, FALSE, FALSE, FALSE},
52 {L"Temp", L"Appdata\\Local\\Temp", FALSE, FALSE, FALSE, FALSE},
53 {L"Cache", L"Appdata\\Local\\Microsoft\\Windows\\INetCache", FALSE, TRUE, TRUE, FALSE},
54 {L"History", L"AppData\\Local\\Microsoft\\Windows\\History", FALSE, TRUE, TRUE, FALSE},
55 {L"Cookies", L"AppData\\Local\\Microsoft\\Windows\\INetCookies", FALSE, TRUE, TRUE, FALSE},
57};
58
59
60static FOLDERDATA
62{
63 {L"{3D644C9B-1FB8-4f30-9B45-F670235F79C0}", L"Downloads", FALSE, TRUE, TRUE, FALSE},
64 {L"Common Desktop", L"Desktop", FALSE, TRUE, TRUE, FALSE},
65 {L"Common Documents", L"Documents", FALSE, TRUE, TRUE, FALSE},
66 {L"Common Templates", L"Microsoft\\Windows\\Templates", TRUE, TRUE, TRUE, TRUE},
67 {L"Common Start Menu", L"Microsoft\\Windows\\Start Menu", FALSE, TRUE, TRUE, TRUE},
68 {L"Common Programs", L"Microsoft\\Windows\\Start Menu\\Programs", FALSE, TRUE, TRUE, TRUE},
69 {L"Common Startup", L"Microsoft\\Windows\\Start Menu\\Programs\\Startup", FALSE, TRUE, TRUE, TRUE},
70 {L"CommonMusic", L"Music", FALSE, TRUE, TRUE, FALSE},
71 {L"CommonPictures", L"Pictures", FALSE, TRUE, TRUE, FALSE},
72 {L"CommonVideo", L"Videos", FALSE, TRUE, TRUE, FALSE},
74};
75
76
77typedef struct _PROFILEPARAMS
78{
88
89
90static PROFILEPARAMS
92{
93 {
94 L"Default", L"Default",
95 L"USERPROFILE", L"%USERPROFILE%",
98 L".Default\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders",
99 L".Default\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders"
100 },
101 {
102 L"Public", L"Public",
103 L"PUBLIC", L"%PUBLIC%",
106 L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders",
107 L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders"
108 },
109};
110
111static BOOL
114 _In_ LPSECURITY_ATTRIBUTES SecurityAttributes)
115{
117 DWORD Error;
118
119 if (!Path || !*Path)
120 return FALSE;
121
123 return TRUE;
124
126
128 return TRUE;
129
131 return FALSE;
132
134 return FALSE;
135
137 return FALSE;
138
139 if (!Parent[0] || !lstrcmpW(Parent, Path))
140 return FALSE;
141
142 if (!CreateDirectoryRecursive(Parent, SecurityAttributes))
143 return FALSE;
144
145 if (CreateDirectoryW(Path, SecurityAttributes))
146 return TRUE;
147
149}
150
151static
152BOOL
154 _In_ LPCWSTR pszProfilesPath,
155 _In_ LPCWSTR pszProgramDataPath,
156 _In_ HKEY hProfileListKey,
157 _In_ PPROFILEPARAMS pProfileParams)
158{
159 LONG Error;
160 PFOLDERDATA lpFolderData;
161 HKEY hKey;
163 WCHAR szProfilePath[MAX_PATH];
164 WCHAR szBuffer[MAX_PATH];
165
166 /*
167 * Create the standard profile main directory
168 */
169
170 StringCbCopyW(szBuffer, sizeof(szBuffer), pProfileParams->pszProfileName);
171
172 /* Build the profile directory path */
173 StringCbCopyW(szProfilePath, sizeof(szProfilePath), pszProfilesPath);
174 StringCbCatW(szProfilePath, sizeof(szProfilePath), L"\\");
175 StringCbCatW(szProfilePath, sizeof(szProfilePath), szBuffer);
176
177 /* Attempt profile directory creation */
178 // FIXME: Security!
179 if (!CreateDirectoryW(szProfilePath, NULL))
180 {
182 {
183 DPRINT1("Error: %lu\n", GetLastError());
184 return FALSE;
185 }
186
187 /* Directory existed, let's try to append the postfix */
188 if (!AppendSystemPostfix(szBuffer, ARRAYSIZE(szBuffer)))
189 {
190 DPRINT1("AppendSystemPostfix() failed\n", GetLastError());
191 return FALSE;
192 }
193
194 /* Attempt again creation with appended postfix */
195 StringCbCopyW(szProfilePath, sizeof(szProfilePath), pszProfilesPath);
196 StringCbCatW(szProfilePath, sizeof(szProfilePath), L"\\");
197 StringCbCatW(szProfilePath, sizeof(szProfilePath), szBuffer);
198
199 // FIXME: Security!
200 if (!CreateDirectoryW(szProfilePath, NULL))
201 {
203 {
204 DPRINT1("Error: %lu\n", GetLastError());
205 return FALSE;
206 }
207 }
208 }
209
210 /* Set 'Default User' / 'All Users' profile */
211 SetEnvironmentVariableW(pProfileParams->pszEnvVar, szProfilePath);
212
213
214 /*
215 * Create the standard profile sub-directories and associated registry keys
216 */
217
218 /* Create 'Default User' / 'All Users' subdirectories */
219 /* FIXME: Take these paths from the registry */
220
221 lpFolderData = pProfileParams->pFolderList;
222 while (lpFolderData->lpValueName != NULL)
223 {
224 if (lpFolderData->bProgramData)
225 {
226 StringCbCopyW(szBuffer, sizeof(szBuffer), pszProgramDataPath);
227 }
228 else
229 {
230 StringCbCopyW(szBuffer, sizeof(szBuffer), szProfilePath);
231 }
232
233 StringCbCatW(szBuffer, sizeof(szBuffer), L"\\");
234 StringCbCatW(szBuffer, sizeof(szBuffer), lpFolderData->lpPath);
235
236 // FIXME: Security!
237 if (!CreateDirectoryRecursive(szBuffer, NULL))
238 {
240 {
241 DPRINT1("Failed to create %ws, error: %lu\n", szBuffer, GetLastError());
242 return FALSE;
243 }
244 }
245
246 if (lpFolderData->bHidden)
248
249 lpFolderData++;
250 }
251
252 /* Set 'Shell Folders' values */
253 Error = RegOpenKeyExW(pProfileParams->hRootKey,
254 pProfileParams->pszShellFoldersKey,
255 0,
257 &hKey);
258 if (Error != ERROR_SUCCESS)
259 {
260 DPRINT1("Error: %lu\n", Error);
262 return FALSE;
263 }
264
265 /*
266 * NOTE: This is identical to UpdateUsersShellFolderSettings().
267 */
268 lpFolderData = pProfileParams->pFolderList;
269 while (lpFolderData->lpValueName != NULL)
270 {
271 if (lpFolderData->bShellFolder)
272 {
273 if (lpFolderData->bProgramData)
274 {
275 StringCbCopyW(szBuffer, sizeof(szBuffer), pszProgramDataPath);
276 }
277 else
278 {
279 StringCbCopyW(szBuffer, sizeof(szBuffer), szProfilePath);
280 }
281
282 StringCbCatW(szBuffer, sizeof(szBuffer), L"\\");
283 StringCbCatW(szBuffer, sizeof(szBuffer), lpFolderData->lpPath);
284
285 dwLength = (wcslen(szBuffer) + 1) * sizeof(WCHAR);
287 lpFolderData->lpValueName,
288 0,
289 REG_SZ,
290 (LPBYTE)szBuffer,
291 dwLength);
292 if (Error != ERROR_SUCCESS)
293 {
294 DPRINT1("Error: %lu\n", Error);
297 return FALSE;
298 }
299 }
300
301 lpFolderData++;
302 }
303
305
306 /* Set 'User Shell Folders' values */
307 Error = RegOpenKeyExW(pProfileParams->hRootKey,
308 pProfileParams->pszUserShellFoldersKey,
309 0,
311 &hKey);
312 if (Error != ERROR_SUCCESS)
313 {
314 DPRINT1("Error: %lu\n", Error);
316 return FALSE;
317 }
318
319 lpFolderData = pProfileParams->pFolderList;
320 while (lpFolderData->lpValueName != NULL)
321 {
322 if (lpFolderData->bUserShellFolder)
323 {
324 if (lpFolderData->bProgramData)
325 StringCbCopyW(szBuffer, sizeof(szBuffer), L"%ProgramData%");
326 else
327 StringCbCopyW(szBuffer, sizeof(szBuffer), pProfileParams->pszEnvVarProfilePath);
328 StringCbCatW(szBuffer, sizeof(szBuffer), L"\\");
329 StringCbCatW(szBuffer, sizeof(szBuffer), lpFolderData->lpPath);
330
331 dwLength = (wcslen(szBuffer) + 1) * sizeof(WCHAR);
333 lpFolderData->lpValueName,
334 0,
336 (LPBYTE)szBuffer,
337 dwLength);
338 if (Error != ERROR_SUCCESS)
339 {
340 DPRINT1("Error: %lu\n", Error);
343 return FALSE;
344 }
345 }
346
347 lpFolderData++;
348 }
349
351
352 return TRUE;
353}
354
355
356BOOL
357WINAPI
359{
360 LONG Error;
361 HKEY hKey;
363 WCHAR szProfilesPath[MAX_PATH];
364 WCHAR szProgramDataPath[MAX_PATH];
365 WCHAR szBuffer[MAX_PATH];
366
367 DPRINT("InitializeProfiles()\n");
368
370 L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList",
371 0,
373 &hKey);
374 if (Error != ERROR_SUCCESS)
375 {
376 DPRINT1("Error: %lu\n", Error);
378 return FALSE;
379 }
380
381 /* Create ProgramData directory */
382 StringCchCopyW(szBuffer, _countof(szBuffer), L"%SystemDrive%\\ProgramData");
383 if (!ExpandEnvironmentStringsW(szBuffer,
384 szProgramDataPath,
385 ARRAYSIZE(szProgramDataPath)))
386 {
387 DPRINT1("Error: %lu\n", GetLastError());
389 return FALSE;
390 }
391 if (!CreateDirectoryW(szProgramDataPath, NULL))
392 {
394 {
395 DPRINT1("Error: %lu\n", GetLastError());
397 return FALSE;
398 }
399 }
400 SetFileAttributesW(szProgramDataPath, FILE_ATTRIBUTE_HIDDEN);
401
402 /* Store the profiles directory path (unexpanded) in the registry */
403 dwLength = (wcslen(szBuffer) + 1) * sizeof(WCHAR);
405 L"ProgramData",
406 0,
408 (LPBYTE)szBuffer,
409 dwLength);
410 if (Error != ERROR_SUCCESS)
411 {
412 DPRINT1("Error: %lu\n", Error);
415 return FALSE;
416 }
417
418 /* Expand users path */
419 wcscpy(szBuffer, L"%SystemDrive%\\Users");
420 if (!ExpandEnvironmentStringsW(szBuffer,
421 szProfilesPath,
422 ARRAYSIZE(szProfilesPath)))
423 {
424 DPRINT1("Error: %lu\n", GetLastError());
426 return FALSE;
427 }
428
429 /* Create profiles directory */
430 // FIXME: Security!
431 if (!CreateDirectoryW(szProfilesPath, NULL))
432 {
434 {
435 DPRINT1("Error: %lu\n", GetLastError());
437 return FALSE;
438 }
439 }
440
441 /* Store the profiles directory path (unexpanded) in the registry */
442 dwLength = (wcslen(szBuffer) + 1) * sizeof(WCHAR);
444 L"ProfilesDirectory",
445 0,
447 (LPBYTE)szBuffer,
448 dwLength);
449 if (Error != ERROR_SUCCESS)
450 {
451 DPRINT1("Error: %lu\n", Error);
454 return FALSE;
455 }
456
457 /* Create 'Default User' profile directory path */
458 if (!CreateStandardProfile(szProfilesPath, szProgramDataPath, hKey, &StandardProfiles[0]))
459 {
460 DPRINT1("CreateStandardProfile(L\"%S\") failed.\n", StandardProfiles[0].pszProfileName);
462 return FALSE;
463 }
464
465 /* Create 'All Users' profile directory path */
466 if (!CreateStandardProfile(szProfilesPath, szProgramDataPath, hKey, &StandardProfiles[1]))
467 {
468 DPRINT1("CreateStandardProfile(L\"%S\") failed.\n", StandardProfiles[1].pszProfileName);
470 return FALSE;
471 }
472
474
475 DPRINT("Success\n");
476
477 return TRUE;
478}
479
480
481/*
482 * NOTE: See CreateStandardProfile() too.
483 * Used by registry.c!CreateUserHive()
484 */
485BOOL
487 HKEY hUserKey)
488{
489 WCHAR szBuffer[MAX_PATH];
491 PFOLDERDATA lpFolderData;
492 HKEY hFoldersKey;
493 LONG Error;
494
495 DPRINT("UpdateUsersShellFolderSettings() called\n");
496
497 DPRINT("User profile path: %S\n", lpUserProfilePath);
498
499 Error = RegOpenKeyExW(hUserKey,
500 L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders",
501 0,
503 &hFoldersKey);
504 if (Error != ERROR_SUCCESS)
505 {
506 DPRINT1("Error: %lu\n", Error);
508 return FALSE;
509 }
510
511 lpFolderData = &UserShellFolders[0];
512 while (lpFolderData->lpValueName != NULL)
513 {
514 if (lpFolderData->bShellFolder)
515 {
516 StringCbCopyW(szBuffer, sizeof(szBuffer), lpUserProfilePath);
517 StringCbCatW(szBuffer, sizeof(szBuffer), L"\\");
518 StringCbCatW(szBuffer, sizeof(szBuffer), lpFolderData->lpPath);
519
520 DPRINT("%S: %S\n", lpFolderData->lpValueName, szBuffer);
521
522 dwLength = (wcslen(szBuffer) + 1) * sizeof(WCHAR);
523 Error = RegSetValueExW(hFoldersKey,
524 lpFolderData->lpValueName,
525 0,
526 REG_SZ,
527 (LPBYTE)szBuffer,
528 dwLength);
529 if (Error != ERROR_SUCCESS)
530 {
531 DPRINT1("Error: %lu\n", Error);
532 RegCloseKey(hFoldersKey);
534 return FALSE;
535 }
536 }
537
538 lpFolderData++;
539 }
540
541 RegCloseKey(hFoldersKey);
542
543 DPRINT("UpdateUsersShellFolderSettings() done\n");
544
545 return TRUE;
546}
547
548/* EOF */
PRTL_UNICODE_STRING_BUFFER Path
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn UINT32 *TableIdx UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE Parent
Definition: acpixf.h:732
#define REG_SZ
Definition: layer.c:22
#define DPRINT1
Definition: precomp.h:8
BOOL Error
Definition: chkdsk.c:66
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ARRAYSIZE(a)
Definition: cat.c:25
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882
#define SetLastError(x)
Definition: compat.h:752
#define MAX_PATH
Definition: compat.h:34
static DWORD DWORD * dwLength
Definition: fusion.c:86
BOOL WINAPI DECLSPEC_HOTPATCH SetEnvironmentVariableW(IN LPCWSTR lpName, IN LPCWSTR lpValue)
Definition: environ.c:232
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:492
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:58
BOOL WINAPI SetFileAttributesW(LPCWSTR lpFileName, DWORD dwFileAttributes)
Definition: fileinfo.c:779
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4152
HRESULT WINAPI PathCchRemoveFileSpec(WCHAR *path, SIZE_T size)
Definition: path.c:844
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2988
BOOL AppendSystemPostfix(LPWSTR lpName, DWORD dwMaxLength)
Definition: profile.c:20
static PROFILEPARAMS StandardProfiles[]
Definition: setup.c:91
struct _FOLDERDATA FOLDERDATA
struct _FOLDERDATA * PFOLDERDATA
static BOOL CreateStandardProfile(_In_ LPCWSTR pszProfilesPath, _In_ LPCWSTR pszProgramDataPath, _In_ HKEY hProfileListKey, _In_ PPROFILEPARAMS pProfileParams)
Definition: setup.c:153
static BOOL CreateDirectoryRecursive(_In_ PCWSTR Path, _In_ LPSECURITY_ATTRIBUTES SecurityAttributes)
Definition: setup.c:112
struct _PROFILEPARAMS PROFILEPARAMS
BOOL WINAPI InitializeProfiles(VOID)
Definition: setup.c:358
static FOLDERDATA UserShellFolders[]
Definition: setup.c:29
BOOL UpdateUsersShellFolderSettings(LPCWSTR lpUserProfilePath, HKEY hUserKey)
Definition: setup.c:486
static FOLDERDATA CommonShellFolders[]
Definition: setup.c:61
struct _PROFILEPARAMS * PPROFILEPARAMS
#define L(x)
Definition: resources.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
#define FAILED(hr)
Definition: intsafe.h:51
#define ERROR_ALREADY_EXISTS
Definition: disk.h:80
#define _In_
Definition: no_sal2.h:158
#define FILE_ATTRIBUTE_HIDDEN
Definition: nt_native.h:703
#define REG_EXPAND_SZ
Definition: nt_native.h:1497
#define KEY_SET_VALUE
Definition: nt_native.h:1020
short WCHAR
Definition: pedump.c:58
long LONG
Definition: pedump.c:60
wcscpy
#define DPRINT
Definition: sndvol32.h:73
#define _countof(array)
Definition: sndvol32.h:70
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:166
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
STRSAFEAPI StringCbCatW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:342
BOOL bHidden
Definition: setup.c:21
LPWSTR lpPath
Definition: setup.c:20
BOOL bProgramData
Definition: setup.c:24
LPWSTR lpValueName
Definition: setup.c:19
BOOL bUserShellFolder
Definition: setup.c:23
BOOL bShellFolder
Definition: setup.c:22
LPCWSTR pszEnvVarProfilePath
Definition: setup.c:82
LPCWSTR pszProfileRegValue
Definition: setup.c:80
LPCWSTR pszProfileName
Definition: setup.c:79
LPCWSTR pszShellFoldersKey
Definition: setup.c:85
LPCWSTR pszUserShellFoldersKey
Definition: setup.c:86
PFOLDERDATA pFolderList
Definition: setup.c:83
HKEY hRootKey
Definition: setup.c:84
LPCWSTR pszEnvVar
Definition: setup.c:81
const uint16_t * PCWSTR
Definition: typedefs.h:57
const uint16_t * LPCWSTR
Definition: typedefs.h:57
unsigned char * LPBYTE
Definition: typedefs.h:53
uint16_t * LPWSTR
Definition: typedefs.h:56
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define WINAPI
Definition: msvc.h:6
#define ERROR_PATH_NOT_FOUND
Definition: winerror.h:228
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define HKEY_USERS
Definition: winreg.h:13