include/mscvpdb.h: Use flexible array members for the rest of structures.
[wine.git] / dlls / userenv / userenv_main.c
blobdd04c40446ef2ec0344ee483e7c8b0d663279751
1 /*
2 * Implementation of userenv.dll
4 * Copyright 2006 Mike McCormack for CodeWeavers
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 #include <stdarg.h>
23 #include "ntstatus.h"
24 #define WIN32_NO_STATUS
25 #include "windef.h"
26 #include "winbase.h"
27 #include "winreg.h"
28 #include "winternl.h"
29 #include "winnls.h"
30 #include "sddl.h"
31 #include "objbase.h"
32 #include "userenv.h"
34 #include "wine/debug.h"
36 WINE_DEFAULT_DEBUG_CHANNEL( userenv );
38 static BOOL get_reg_value(WCHAR *env, HKEY hkey, const WCHAR *name, WCHAR *val, DWORD size)
40 DWORD type, res_size=0;
42 if (RegQueryValueExW(hkey, name, 0, &type, NULL, &res_size) != ERROR_SUCCESS)
43 return FALSE;
45 if (type == REG_SZ)
47 if (res_size > size)
48 return FALSE;
50 return RegQueryValueExW(hkey, name, 0, NULL, (BYTE*)val, &size) == ERROR_SUCCESS;
52 else if (type == REG_EXPAND_SZ)
54 UNICODE_STRING us_buf, us_expanded;
55 WCHAR *buf = HeapAlloc(GetProcessHeap(), 0, res_size);
56 if (!buf)
57 return FALSE;
59 if (RegQueryValueExW(hkey, name, 0, NULL, (BYTE*)buf, &res_size) != ERROR_SUCCESS)
61 HeapFree(GetProcessHeap(), 0, buf);
62 return FALSE;
65 RtlInitUnicodeString(&us_buf, buf);
66 us_expanded.Buffer = val;
67 us_expanded.MaximumLength = size;
68 if (RtlExpandEnvironmentStrings_U(env, &us_buf, &us_expanded, &size) != STATUS_SUCCESS)
70 HeapFree(GetProcessHeap(), 0, buf);
71 return FALSE;
74 HeapFree(GetProcessHeap(), 0, buf);
75 return TRUE;
78 return FALSE;
81 static void set_env_var( WCHAR **env, const WCHAR *name, const WCHAR *val )
83 UNICODE_STRING nameW, valW;
85 RtlInitUnicodeString( &nameW, name );
86 RtlInitUnicodeString( &valW, val );
87 RtlSetEnvironmentVariable( env, &nameW, &valW );
90 static void set_registry_variables(WCHAR **env, HKEY hkey, DWORD type, BOOL set_path)
92 UNICODE_STRING us_name, us_value;
93 WCHAR name[1024], value[1024];
94 DWORD ret, index, size;
96 for (index = 0; ; index++)
98 size = ARRAY_SIZE(name);
99 ret = RegEnumValueW(hkey, index, name, &size, NULL, NULL, NULL, NULL);
100 if (ret != ERROR_SUCCESS)
101 break;
103 if (!wcsicmp(name, L"SystemRoot")) continue;
104 if (!wcsicmp(name, L"SystemDrive")) continue;
106 RtlInitUnicodeString(&us_name, name);
107 us_value.Buffer = value;
108 us_value.MaximumLength = sizeof(value);
109 if (!wcsicmp(name, L"PATH") &&
110 !RtlQueryEnvironmentVariable_U(*env, &us_name, &us_value))
112 if (!set_path)
113 continue;
115 size = lstrlenW(value)+1;
116 if (!get_reg_value(*env, hkey, name, value+size,
117 sizeof(value)-size*sizeof(WCHAR)))
118 continue;
120 value[size] = ';';
121 set_env_var(env, name, value);
122 continue;
125 if (get_reg_value(*env, hkey, name, value, sizeof(value)) && value[0])
126 set_env_var(env, name, value);
130 static void set_wow64_environment(WCHAR **env)
132 WCHAR buf[64];
133 HKEY hkey;
134 BOOL is_win64 = (sizeof(void *) > sizeof(int));
135 BOOL is_wow64;
137 IsWow64Process( GetCurrentProcess(), &is_wow64 );
139 if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion",
140 0, KEY_READ|KEY_WOW64_64KEY, &hkey))
141 return;
143 /* set the ProgramFiles variables */
145 if (get_reg_value(*env, hkey, L"ProgramFilesDir", buf, sizeof(buf)))
147 if (is_win64 || is_wow64) set_env_var(env, L"ProgramW6432", buf);
148 if (is_win64 || !is_wow64) set_env_var(env, L"ProgramFiles", buf);
150 if (get_reg_value(*env, hkey, L"ProgramFilesDir (x86)", buf, sizeof(buf)))
152 if (is_win64 || is_wow64) set_env_var(env, L"ProgramFiles(x86)", buf);
153 if (is_wow64) set_env_var(env, L"ProgramFiles", buf);
156 /* set the CommonProgramFiles variables */
158 if (get_reg_value(*env, hkey, L"CommonFilesDir", buf, sizeof(buf)))
160 if (is_win64 || is_wow64) set_env_var(env, L"CommonProgramW6432", buf);
161 if (is_win64 || !is_wow64) set_env_var(env, L"CommonProgramFiles", buf);
163 if (get_reg_value(*env, hkey, L"CommonFilesDir (x86)", buf, sizeof(buf)))
165 if (is_win64 || is_wow64) set_env_var(env, L"CommonProgramFiles(x86)", buf);
166 if (is_wow64) set_env_var(env, L"CommonProgramFiles", buf);
169 RegCloseKey(hkey);
172 BOOL WINAPI CreateEnvironmentBlock( LPVOID* lpEnvironment,
173 HANDLE hToken, BOOL bInherit )
175 static const WCHAR env_keyW[] = L"System\\CurrentControlSet\\Control\\Session Manager\\Environment";
176 static const WCHAR profile_keyW[] = L"Software\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList";
178 WCHAR *env, buf[UNICODE_STRING_MAX_CHARS], profiles_dir[MAX_PATH];
179 DWORD len;
180 HKEY hkey, hsubkey;
182 TRACE("%p %p %d\n", lpEnvironment, hToken, bInherit );
184 if (!lpEnvironment)
185 return FALSE;
187 if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, env_keyW, 0, KEY_READ, &hkey) != ERROR_SUCCESS)
188 return FALSE;
190 if (RtlCreateEnvironment(bInherit, &env) != STATUS_SUCCESS)
192 RegCloseKey(hkey);
193 return FALSE;
196 if (!GetEnvironmentVariableW(L"SystemRoot", buf, UNICODE_STRING_MAX_CHARS))
198 if (!get_reg_value(env, hkey, L"SystemRoot", buf, UNICODE_STRING_MAX_CHARS))
200 buf[0] = 0;
201 WARN("SystemRoot variable not set\n");
204 set_env_var(&env, L"SystemRoot", buf);
206 if (!GetEnvironmentVariableW(L"SystemDrive", buf, UNICODE_STRING_MAX_CHARS))
208 if (!get_reg_value(env, hkey, L"SystemDrive", buf, UNICODE_STRING_MAX_CHARS))
210 buf[0] = 0;
211 WARN("SystemDrive variable not set\n");
214 set_env_var(&env, L"SystemDrive", buf);
216 set_registry_variables(&env, hkey, REG_SZ, !bInherit);
217 set_registry_variables(&env, hkey, REG_EXPAND_SZ, !bInherit);
219 if (RegOpenKeyExW(hkey, L"Environment", 0, KEY_READ, &hsubkey) == ERROR_SUCCESS)
221 set_registry_variables(&env, hsubkey, REG_SZ, !bInherit);
222 set_registry_variables(&env, hsubkey, REG_EXPAND_SZ, !bInherit);
223 RegCloseKey(hsubkey);
226 if (RegOpenKeyExW(hkey, L"Volatile Environment", 0, KEY_READ, &hsubkey) == ERROR_SUCCESS)
228 set_registry_variables(&env, hsubkey, REG_SZ, !bInherit);
229 set_registry_variables(&env, hsubkey, REG_EXPAND_SZ, !bInherit);
230 RegCloseKey(hsubkey);
232 RegCloseKey(hkey);
234 if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, profile_keyW, 0, KEY_READ, &hkey) == ERROR_SUCCESS)
236 if (get_reg_value(env, hkey, L"ProfilesDirectory", profiles_dir, MAX_PATH - sizeof(WCHAR)))
238 len = lstrlenW(profiles_dir);
239 if (profiles_dir[len-1] != '\\')
241 profiles_dir[len++] = '\\';
242 profiles_dir[len] = '\0';
245 if (get_reg_value(env, hkey, L"ProgramData", buf, UNICODE_STRING_MAX_CHARS))
247 set_env_var(&env, L"ALLUSERSPROFILE", buf);
248 set_env_var(&env, L"ProgramData", buf);
251 else
253 profiles_dir[0] = 0;
256 RegCloseKey(hkey);
259 len = ARRAY_SIZE(buf);
260 if (GetComputerNameW(buf, &len))
261 set_env_var(&env, L"COMPUTERNAME", buf);
263 set_wow64_environment(&env);
265 if (!hToken)
267 if (profiles_dir[0])
269 len = lstrlenW(profiles_dir);
270 if (len * sizeof(WCHAR) + sizeof(L"Default") < sizeof(buf))
272 wcscpy(buf, profiles_dir);
273 wcscat(buf, L"Default");
274 set_env_var(&env, L"USERPROFILE", buf);
278 wcscpy(buf, L".Default");
280 else
282 TOKEN_USER *token_user = NULL;
283 SID_NAME_USE use;
284 WCHAR *sidW;
285 DWORD size, tmp=0;
287 if (GetTokenInformation(hToken, TokenUser, NULL, 0, &len) ||
288 GetLastError()!=ERROR_INSUFFICIENT_BUFFER ||
289 !(token_user = HeapAlloc(GetProcessHeap(), 0, len)) ||
290 !GetTokenInformation(hToken, TokenUser, token_user, len, &len) ||
291 !ConvertSidToStringSidW(token_user->User.Sid, &sidW))
293 HeapFree(GetProcessHeap(), 0, token_user);
294 RtlDestroyEnvironment(env);
295 return FALSE;
298 len = lstrlenW(profiles_dir);
299 memcpy(buf, profiles_dir, len*sizeof(WCHAR));
301 size = UNICODE_STRING_MAX_CHARS-len;
302 if (LookupAccountSidW(NULL, token_user->User.Sid,
303 buf+len, &size, NULL, &tmp, &use))
305 set_env_var(&env, L"USERNAME", buf+len);
306 if (len) set_env_var(&env, L"USERPROFILE", buf);
309 HeapFree(GetProcessHeap(), 0, token_user);
310 lstrcpyW(buf, sidW);
311 LocalFree(sidW);
314 if (RegOpenKeyExW(HKEY_USERS, buf, 0, KEY_READ, &hkey) == ERROR_SUCCESS)
316 if (RegOpenKeyExW(hkey, L"Environment", 0, KEY_READ, &hsubkey) == ERROR_SUCCESS)
318 set_registry_variables(&env, hsubkey, REG_SZ, !bInherit);
319 set_registry_variables(&env, hsubkey, REG_EXPAND_SZ, !bInherit);
320 RegCloseKey(hsubkey);
323 if (RegOpenKeyExW(hkey, L"Volatile Environment", 0, KEY_READ, &hsubkey) == ERROR_SUCCESS)
325 set_registry_variables(&env, hsubkey, REG_SZ, !bInherit);
326 set_registry_variables(&env, hsubkey, REG_EXPAND_SZ, !bInherit);
327 RegCloseKey(hsubkey);
329 RegCloseKey(hkey);
332 *lpEnvironment = env;
333 return TRUE;
336 BOOL WINAPI DestroyEnvironmentBlock(LPVOID lpEnvironment)
338 NTSTATUS r;
340 TRACE("%p\n", lpEnvironment);
341 r = RtlDestroyEnvironment(lpEnvironment);
342 if (r == STATUS_SUCCESS)
343 return TRUE;
344 return FALSE;
347 BOOL WINAPI ExpandEnvironmentStringsForUserA( HANDLE hToken, LPCSTR lpSrc,
348 LPSTR lpDest, DWORD dwSize )
350 BOOL ret;
352 TRACE("%p %s %p %ld\n", hToken, debugstr_a(lpSrc), lpDest, dwSize);
354 ret = ExpandEnvironmentStringsA( lpSrc, lpDest, dwSize );
355 TRACE("<- %s\n", debugstr_a(lpDest));
356 return ret;
359 BOOL WINAPI ExpandEnvironmentStringsForUserW( HANDLE hToken, LPCWSTR lpSrc,
360 LPWSTR lpDest, DWORD dwSize )
362 BOOL ret;
364 TRACE("%p %s %p %ld\n", hToken, debugstr_w(lpSrc), lpDest, dwSize);
366 ret = ExpandEnvironmentStringsW( lpSrc, lpDest, dwSize );
367 TRACE("<- %s\n", debugstr_w(lpDest));
368 return ret;
371 BOOL WINAPI GetDefaultUserProfileDirectoryA( LPSTR lpProfileDir, LPDWORD lpcchSize )
373 FIXME("%p %p\n", lpProfileDir, lpcchSize );
374 return FALSE;
377 BOOL WINAPI GetDefaultUserProfileDirectoryW( LPWSTR lpProfileDir, LPDWORD lpcchSize )
379 FIXME("%p %p\n", lpProfileDir, lpcchSize );
380 return FALSE;
383 BOOL WINAPI GetUserProfileDirectoryA( HANDLE hToken, LPSTR lpProfileDir,
384 LPDWORD lpcchSize )
386 BOOL ret;
387 WCHAR *dirW = NULL;
389 TRACE( "%p %p %p\n", hToken, lpProfileDir, lpcchSize );
391 if (!lpProfileDir || !lpcchSize)
393 SetLastError( ERROR_INVALID_PARAMETER );
394 return FALSE;
396 if (!(dirW = HeapAlloc( GetProcessHeap(), 0, *lpcchSize * sizeof(WCHAR) )))
397 return FALSE;
399 if ((ret = GetUserProfileDirectoryW( hToken, dirW, lpcchSize )))
400 WideCharToMultiByte( CP_ACP, 0, dirW, *lpcchSize, lpProfileDir, *lpcchSize, NULL, NULL );
402 HeapFree( GetProcessHeap(), 0, dirW );
403 return ret;
406 BOOL WINAPI GetUserProfileDirectoryW( HANDLE hToken, LPWSTR lpProfileDir,
407 LPDWORD lpcchSize )
409 TOKEN_USER *t;
410 WCHAR *userW = NULL, *dirW = NULL;
411 DWORD len, dir_len, domain_len;
412 SID_NAME_USE use;
413 BOOL ret = FALSE;
415 TRACE( "%p %p %p\n", hToken, lpProfileDir, lpcchSize );
417 if (!lpcchSize)
419 SetLastError( ERROR_INVALID_PARAMETER );
420 return FALSE;
423 len = 0;
424 GetTokenInformation( hToken, TokenUser, NULL, 0, &len );
425 if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) return FALSE;
426 if (!(t = HeapAlloc( GetProcessHeap(), 0, len ))) return FALSE;
427 if (!GetTokenInformation( hToken, TokenUser, t, len, &len )) goto done;
429 len = domain_len = 0;
430 LookupAccountSidW( NULL, t->User.Sid, NULL, &len, NULL, &domain_len, NULL );
431 if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) goto done;
432 if (!(userW = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) goto done;
433 if (!LookupAccountSidW( NULL, t->User.Sid, userW, &len, NULL, &domain_len, &use )) goto done;
435 dir_len = 0;
436 GetProfilesDirectoryW( NULL, &dir_len );
437 if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) goto done;
438 if (!(dirW = HeapAlloc( GetProcessHeap(), 0, (dir_len + 1) * sizeof(WCHAR) ))) goto done;
439 if (!GetProfilesDirectoryW( dirW, &dir_len )) goto done;
441 len += dir_len + 2;
442 if (*lpcchSize < len)
444 SetLastError( ERROR_INSUFFICIENT_BUFFER );
445 *lpcchSize = len;
446 goto done;
448 lstrcpyW( lpProfileDir, dirW );
449 lstrcatW( lpProfileDir, L"\\" );
450 lstrcatW( lpProfileDir, userW );
451 *lpcchSize = len;
452 ret = TRUE;
454 done:
455 HeapFree( GetProcessHeap(), 0, t );
456 HeapFree( GetProcessHeap(), 0, userW );
457 HeapFree( GetProcessHeap(), 0, dirW );
458 return ret;
461 static const char ProfileListA[] = "Software\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList";
463 BOOL WINAPI GetProfilesDirectoryA( LPSTR lpProfilesDir, LPDWORD lpcchSize )
465 static const char ProfilesDirectory[] = "ProfilesDirectory";
466 LONG l;
467 HKEY key;
468 BOOL ret = FALSE;
469 DWORD len = 0, expanded_len;
470 LPSTR unexpanded_profiles_dir = NULL;
472 TRACE("%p %p\n", lpProfilesDir, lpcchSize );
474 if (!lpProfilesDir || !lpcchSize)
476 SetLastError(ERROR_INVALID_PARAMETER);
477 return FALSE;
480 l = RegOpenKeyExA(HKEY_LOCAL_MACHINE, ProfileListA, 0, KEY_READ, &key);
481 if (l)
483 SetLastError(l);
484 return FALSE;
486 l = RegQueryValueExA(key, ProfilesDirectory, NULL, NULL, NULL, &len);
487 if (l)
489 SetLastError(l);
490 goto end;
492 unexpanded_profiles_dir = HeapAlloc(GetProcessHeap(), 0, len);
493 if (!unexpanded_profiles_dir)
495 SetLastError(ERROR_OUTOFMEMORY);
496 goto end;
498 l = RegQueryValueExA(key, ProfilesDirectory, NULL, NULL,
499 (BYTE *)unexpanded_profiles_dir, &len);
500 if (l)
502 SetLastError(l);
503 goto end;
505 expanded_len = ExpandEnvironmentStringsA(unexpanded_profiles_dir, NULL, 0);
506 /* The returned length doesn't include the NULL terminator. */
507 if (*lpcchSize < expanded_len - 1)
509 *lpcchSize = expanded_len - 1;
510 SetLastError(ERROR_INSUFFICIENT_BUFFER);
511 goto end;
513 *lpcchSize = expanded_len - 1;
514 /* The return value is also the expected length. */
515 ret = ExpandEnvironmentStringsA(unexpanded_profiles_dir, lpProfilesDir,
516 expanded_len) - 1;
517 end:
518 HeapFree(GetProcessHeap(), 0, unexpanded_profiles_dir);
519 RegCloseKey(key);
520 return ret;
523 BOOL WINAPI GetProfilesDirectoryW( LPWSTR lpProfilesDir, LPDWORD lpcchSize )
525 LONG l;
526 HKEY key;
527 BOOL ret = FALSE;
528 DWORD len = 0, expanded_len;
529 LPWSTR unexpanded_profiles_dir = NULL;
531 TRACE("%p %p\n", lpProfilesDir, lpcchSize );
533 if (!lpcchSize)
535 SetLastError(ERROR_INVALID_PARAMETER);
536 return FALSE;
539 l = RegOpenKeyExW(HKEY_LOCAL_MACHINE,
540 L"Software\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList",
541 0, KEY_READ, &key);
542 if (l)
544 SetLastError(l);
545 return FALSE;
547 l = RegQueryValueExW(key, L"ProfilesDirectory", NULL, NULL, NULL, &len);
548 if (l)
550 SetLastError(l);
551 goto end;
553 unexpanded_profiles_dir = HeapAlloc(GetProcessHeap(), 0, len);
554 if (!unexpanded_profiles_dir)
556 SetLastError(ERROR_OUTOFMEMORY);
557 goto end;
559 l = RegQueryValueExW(key, L"ProfilesDirectory", NULL, NULL,
560 (BYTE *)unexpanded_profiles_dir, &len);
561 if (l)
563 SetLastError(l);
564 goto end;
566 expanded_len = ExpandEnvironmentStringsW(unexpanded_profiles_dir, NULL, 0);
567 /* The returned length doesn't include the NULL terminator. */
568 if (*lpcchSize < expanded_len - 1 || !lpProfilesDir)
570 *lpcchSize = expanded_len - 1;
571 SetLastError(ERROR_INSUFFICIENT_BUFFER);
572 goto end;
574 *lpcchSize = expanded_len - 1;
575 /* The return value is also the expected length. */
576 ret = ExpandEnvironmentStringsW(unexpanded_profiles_dir, lpProfilesDir,
577 expanded_len) - 1;
578 end:
579 HeapFree(GetProcessHeap(), 0, unexpanded_profiles_dir);
580 RegCloseKey(key);
581 return ret;
584 BOOL WINAPI GetAllUsersProfileDirectoryA( LPSTR lpProfileDir, LPDWORD lpcchSize )
586 FIXME("%p %p\n", lpProfileDir, lpcchSize);
587 return FALSE;
590 BOOL WINAPI GetAllUsersProfileDirectoryW( LPWSTR lpProfileDir, LPDWORD lpcchSize )
592 FIXME("%p %p\n", lpProfileDir, lpcchSize);
593 return FALSE;
596 BOOL WINAPI GetProfileType( DWORD *pdwFlags )
598 FIXME("%p\n", pdwFlags );
599 *pdwFlags = 0;
600 return TRUE;
603 BOOL WINAPI LoadUserProfileA( HANDLE hToken, LPPROFILEINFOA lpProfileInfo )
605 FIXME("%p %p\n", hToken, lpProfileInfo );
606 lpProfileInfo->hProfile = HKEY_CURRENT_USER;
607 return TRUE;
610 BOOL WINAPI LoadUserProfileW( HANDLE hToken, LPPROFILEINFOW lpProfileInfo )
612 FIXME("%p %p\n", hToken, lpProfileInfo );
613 lpProfileInfo->hProfile = HKEY_CURRENT_USER;
614 return TRUE;
617 BOOL WINAPI RegisterGPNotification( HANDLE event, BOOL machine )
619 FIXME("%p %d\n", event, machine );
620 return TRUE;
623 BOOL WINAPI UnregisterGPNotification( HANDLE event )
625 FIXME("%p\n", event );
626 return TRUE;
629 BOOL WINAPI UnloadUserProfile( HANDLE hToken, HANDLE hProfile )
631 FIXME("(%p, %p): stub\n", hToken, hProfile);
632 return FALSE;
635 HANDLE WINAPI EnterCriticalPolicySection(BOOL bMachine)
637 FIXME("(%x)\n", bMachine);
638 SetLastError(ERROR_ACCESS_DENIED);
639 return NULL;
642 BOOL WINAPI LeaveCriticalPolicySection(HANDLE hSection)
644 FIXME("(%p)\n", hSection);
645 return TRUE;
648 DWORD WINAPI GetAppliedGPOListW(DWORD dwFlags, LPCWSTR pMachineName, PSID pSidUser, GUID *pGuidExtension,
649 PGROUP_POLICY_OBJECTW *ppGPOList)
651 FIXME("(%lx %s %p %s %p)\n", dwFlags, debugstr_w(pMachineName), pSidUser, debugstr_guid(pGuidExtension), ppGPOList);
652 return ERROR_ACCESS_DENIED;
655 /******************************************************************************
656 * USERENV.138
658 * Create .lnk file
660 * PARAMETERS
661 * int csidl [in] well-known directory location to create link in
662 * LPCSTR lnk_dir [in] directory (relative to directory specified by csidl) to create link in
663 * LPCSTR lnk_filename [in] filename of the link file without .lnk extension
664 * LPCSTR lnk_target [in] file/directory pointed to by link
665 * LPCSTR lnk_iconfile [in] link icon resource filename
666 * DWORD lnk_iconid [in] link icon resource id in file referred by lnk_iconfile
667 * LPCSTR work_directory [in] link target's work directory
668 * WORD hotkey [in] link hotkey (virtual key id)
669 * DWORD win_state [in] initial window size (SW_SHOWMAXIMIZED to start maximized,
670 * SW_SHOWMINNOACTIVE to start minimized, everything else is default state)
671 * LPCSTR comment [in] comment - link's comment
672 * LPCSTR loc_filename_resfile [in] resource file which holds localized filename for this link file
673 * DWORD loc_filename_resid [in] resource id for this link file's localized filename
675 * RETURNS
676 * TRUE: Link file was successfully created
677 * FALSE: Link file was not created
679 BOOL WINAPI USERENV_138( int csidl, LPCSTR lnk_dir, LPCSTR lnk_filename,
680 LPCSTR lnk_target, LPCSTR lnk_iconfile, DWORD lnk_iconid,
681 LPCSTR work_directory, WORD hotkey, DWORD win_state, LPCSTR comment,
682 LPCSTR loc_filename_resfile, DWORD loc_filename_resid)
684 FIXME("(%d,%s,%s,%s,%s,%ld,%s,0x%x,%ld,%s,%s,%ld) - stub\n", csidl, debugstr_a(lnk_dir),
685 debugstr_a(lnk_filename), debugstr_a(lnk_target), debugstr_a(lnk_iconfile),
686 lnk_iconid, debugstr_a(work_directory), hotkey, win_state,
687 debugstr_a(comment), debugstr_a(loc_filename_resfile), loc_filename_resid );
689 return FALSE;
692 HRESULT WINAPI CreateAppContainerProfile(PCWSTR container_name, PCWSTR display_name, PCWSTR description,
693 SID_AND_ATTRIBUTES *capabilities, DWORD capability_count,
694 SID **container_sid)
696 FIXME("(%s, %s, %s, %p, %ld, %p): stub\n", debugstr_w(container_name), debugstr_w(display_name),
697 debugstr_w(description), capabilities, capability_count, container_sid);
699 return E_NOTIMPL;