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
24 #define WIN32_NO_STATUS
34 #include "wine/debug.h"
36 WINE_DEFAULT_DEBUG_CHANNEL( userenv
);
38 BOOL WINAPI
DllMain(HINSTANCE hinstDLL
, DWORD fdwReason
, LPVOID lpvReserved
)
40 TRACE("%p %d %p\n", hinstDLL
, fdwReason
, lpvReserved
);
44 case DLL_WINE_PREATTACH
:
45 return FALSE
; /* prefer native version */
46 case DLL_PROCESS_ATTACH
:
47 DisableThreadLibraryCalls(hinstDLL
);
53 static BOOL
get_reg_value(WCHAR
*env
, HKEY hkey
, const WCHAR
*name
, WCHAR
*val
, DWORD size
)
55 DWORD type
, res_size
=0;
57 if (RegQueryValueExW(hkey
, name
, 0, &type
, NULL
, &res_size
) != ERROR_SUCCESS
)
65 return RegQueryValueExW(hkey
, name
, 0, NULL
, (BYTE
*)val
, &size
) == ERROR_SUCCESS
;
67 else if (type
== REG_EXPAND_SZ
)
69 UNICODE_STRING us_buf
, us_expanded
;
70 WCHAR
*buf
= HeapAlloc(GetProcessHeap(), 0, res_size
);
74 if (RegQueryValueExW(hkey
, name
, 0, NULL
, (BYTE
*)buf
, &res_size
) != ERROR_SUCCESS
)
76 HeapFree(GetProcessHeap(), 0, buf
);
80 RtlInitUnicodeString(&us_buf
, buf
);
81 us_expanded
.Buffer
= val
;
82 us_expanded
.MaximumLength
= size
;
83 if (RtlExpandEnvironmentStrings_U(env
, &us_buf
, &us_expanded
, &size
) != STATUS_SUCCESS
)
85 HeapFree(GetProcessHeap(), 0, buf
);
89 HeapFree(GetProcessHeap(), 0, buf
);
96 static void set_env_var( WCHAR
**env
, const WCHAR
*name
, const WCHAR
*val
)
98 UNICODE_STRING nameW
, valW
;
100 RtlInitUnicodeString( &nameW
, name
);
101 RtlInitUnicodeString( &valW
, val
);
102 RtlSetEnvironmentVariable( env
, &nameW
, &valW
);
105 static void set_registry_variables(WCHAR
**env
, HKEY hkey
, DWORD type
, BOOL set_path
)
107 UNICODE_STRING us_name
, us_value
;
108 WCHAR name
[1024], value
[1024];
109 DWORD ret
, index
, size
;
111 for (index
= 0; ; index
++)
113 size
= ARRAY_SIZE(name
);
114 ret
= RegEnumValueW(hkey
, index
, name
, &size
, NULL
, NULL
, NULL
, NULL
);
115 if (ret
!= ERROR_SUCCESS
)
118 if (!wcsicmp(name
, L
"SystemRoot")) continue;
119 if (!wcsicmp(name
, L
"SystemDrive")) continue;
121 RtlInitUnicodeString(&us_name
, name
);
122 us_value
.Buffer
= value
;
123 us_value
.MaximumLength
= sizeof(value
);
124 if (!wcsicmp(name
, L
"PATH") &&
125 !RtlQueryEnvironmentVariable_U(*env
, &us_name
, &us_value
))
130 size
= lstrlenW(value
)+1;
131 if (!get_reg_value(*env
, hkey
, name
, value
+size
,
132 sizeof(value
)-size
*sizeof(WCHAR
)))
136 set_env_var(env
, name
, value
);
140 if (get_reg_value(*env
, hkey
, name
, value
, sizeof(value
)) && value
[0])
141 set_env_var(env
, name
, value
);
145 static void set_wow64_environment(WCHAR
**env
)
149 BOOL is_win64
= (sizeof(void *) > sizeof(int));
152 IsWow64Process( GetCurrentProcess(), &is_wow64
);
154 if (RegOpenKeyExW(HKEY_LOCAL_MACHINE
, L
"Software\\Microsoft\\Windows\\CurrentVersion",
155 0, KEY_READ
|KEY_WOW64_64KEY
, &hkey
))
158 /* set the ProgramFiles variables */
160 if (get_reg_value(*env
, hkey
, L
"ProgramFilesDir", buf
, sizeof(buf
)))
162 if (is_win64
|| is_wow64
) set_env_var(env
, L
"ProgramW6432", buf
);
163 if (is_win64
|| !is_wow64
) set_env_var(env
, L
"ProgramFiles", buf
);
165 if (get_reg_value(*env
, hkey
, L
"ProgramFilesDir (x86)", buf
, sizeof(buf
)))
167 if (is_win64
|| is_wow64
) set_env_var(env
, L
"ProgramFiles(x86)", buf
);
168 if (is_wow64
) set_env_var(env
, L
"ProgramFiles", buf
);
171 /* set the CommonProgramFiles variables */
173 if (get_reg_value(*env
, hkey
, L
"CommonFilesDir", buf
, sizeof(buf
)))
175 if (is_win64
|| is_wow64
) set_env_var(env
, L
"CommonProgramW6432", buf
);
176 if (is_win64
|| !is_wow64
) set_env_var(env
, L
"CommonProgramFiles", buf
);
178 if (get_reg_value(*env
, hkey
, L
"CommonFilesDir (x86)", buf
, sizeof(buf
)))
180 if (is_win64
|| is_wow64
) set_env_var(env
, L
"CommonProgramFiles(x86)", buf
);
181 if (is_wow64
) set_env_var(env
, L
"CommonProgramFiles", buf
);
187 BOOL WINAPI
CreateEnvironmentBlock( LPVOID
* lpEnvironment
,
188 HANDLE hToken
, BOOL bInherit
)
190 static const WCHAR env_keyW
[] = L
"System\\CurrentControlSet\\Control\\Session Manager\\Environment";
191 static const WCHAR profile_keyW
[] = L
"Software\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList";
193 WCHAR
*env
, buf
[UNICODE_STRING_MAX_CHARS
], profiles_dir
[MAX_PATH
];
197 TRACE("%p %p %d\n", lpEnvironment
, hToken
, bInherit
);
202 if (RegOpenKeyExW(HKEY_LOCAL_MACHINE
, env_keyW
, 0, KEY_READ
, &hkey
) != ERROR_SUCCESS
)
205 if (RtlCreateEnvironment(bInherit
, &env
) != STATUS_SUCCESS
)
211 if (!GetEnvironmentVariableW(L
"SystemRoot", buf
, UNICODE_STRING_MAX_CHARS
))
213 if (!get_reg_value(env
, hkey
, L
"SystemRoot", buf
, UNICODE_STRING_MAX_CHARS
))
216 WARN("SystemRoot variable not set\n");
219 set_env_var(&env
, L
"SystemRoot", buf
);
221 if (!GetEnvironmentVariableW(L
"SystemDrive", buf
, UNICODE_STRING_MAX_CHARS
))
223 if (!get_reg_value(env
, hkey
, L
"SystemDrive", buf
, UNICODE_STRING_MAX_CHARS
))
226 WARN("SystemDrive variable not set\n");
229 set_env_var(&env
, L
"SystemDrive", buf
);
231 set_registry_variables(&env
, hkey
, REG_SZ
, !bInherit
);
232 set_registry_variables(&env
, hkey
, REG_EXPAND_SZ
, !bInherit
);
234 if (RegOpenKeyExW(hkey
, L
"Environment", 0, KEY_READ
, &hsubkey
) == ERROR_SUCCESS
)
236 set_registry_variables(&env
, hsubkey
, REG_SZ
, !bInherit
);
237 set_registry_variables(&env
, hsubkey
, REG_EXPAND_SZ
, !bInherit
);
238 RegCloseKey(hsubkey
);
241 if (RegOpenKeyExW(hkey
, L
"Volatile Environment", 0, KEY_READ
, &hsubkey
) == ERROR_SUCCESS
)
243 set_registry_variables(&env
, hsubkey
, REG_SZ
, !bInherit
);
244 set_registry_variables(&env
, hsubkey
, REG_EXPAND_SZ
, !bInherit
);
245 RegCloseKey(hsubkey
);
249 if (RegOpenKeyExW(HKEY_LOCAL_MACHINE
, profile_keyW
, 0, KEY_READ
, &hkey
) == ERROR_SUCCESS
)
251 if (get_reg_value(env
, hkey
, L
"ProfilesDirectory", profiles_dir
, MAX_PATH
- sizeof(WCHAR
)))
253 len
= lstrlenW(profiles_dir
);
254 if (profiles_dir
[len
-1] != '\\')
256 profiles_dir
[len
++] = '\\';
257 profiles_dir
[len
] = '\0';
260 if (get_reg_value(env
, hkey
, L
"Public", buf
, UNICODE_STRING_MAX_CHARS
))
261 set_env_var(&env
, L
"ALLUSERSPROFILE", buf
);
271 len
= ARRAY_SIZE(buf
);
272 if (GetComputerNameW(buf
, &len
))
273 set_env_var(&env
, L
"COMPUTERNAME", buf
);
275 set_wow64_environment(&env
);
281 len
= lstrlenW(profiles_dir
);
282 if (len
* sizeof(WCHAR
) + sizeof(L
"Default") < sizeof(buf
))
284 wcscpy(buf
, profiles_dir
);
285 wcscat(buf
, L
"Default");
286 set_env_var(&env
, L
"USERPROFILE", buf
);
290 wcscpy(buf
, L
".Default");
294 TOKEN_USER
*token_user
= NULL
;
299 if (GetTokenInformation(hToken
, TokenUser
, NULL
, 0, &len
) ||
300 GetLastError()!=ERROR_INSUFFICIENT_BUFFER
||
301 !(token_user
= HeapAlloc(GetProcessHeap(), 0, len
)) ||
302 !GetTokenInformation(hToken
, TokenUser
, token_user
, len
, &len
) ||
303 !ConvertSidToStringSidW(token_user
->User
.Sid
, &sidW
))
305 HeapFree(GetProcessHeap(), 0, token_user
);
306 RtlDestroyEnvironment(env
);
310 len
= lstrlenW(profiles_dir
);
311 memcpy(buf
, profiles_dir
, len
*sizeof(WCHAR
));
313 size
= UNICODE_STRING_MAX_CHARS
-len
;
314 if (LookupAccountSidW(NULL
, token_user
->User
.Sid
,
315 buf
+len
, &size
, NULL
, &tmp
, &use
))
317 set_env_var(&env
, L
"USERNAME", buf
+len
);
318 if (len
) set_env_var(&env
, L
"USERPROFILE", buf
);
321 HeapFree(GetProcessHeap(), 0, token_user
);
326 if (RegOpenKeyExW(HKEY_USERS
, buf
, 0, KEY_READ
, &hkey
) == ERROR_SUCCESS
)
328 if (RegOpenKeyExW(hkey
, L
"Environment", 0, KEY_READ
, &hsubkey
) == ERROR_SUCCESS
)
330 set_registry_variables(&env
, hsubkey
, REG_SZ
, !bInherit
);
331 set_registry_variables(&env
, hsubkey
, REG_EXPAND_SZ
, !bInherit
);
332 RegCloseKey(hsubkey
);
335 if (RegOpenKeyExW(hkey
, L
"Volatile Environment", 0, KEY_READ
, &hsubkey
) == ERROR_SUCCESS
)
337 set_registry_variables(&env
, hsubkey
, REG_SZ
, !bInherit
);
338 set_registry_variables(&env
, hsubkey
, REG_EXPAND_SZ
, !bInherit
);
339 RegCloseKey(hsubkey
);
344 *lpEnvironment
= env
;
348 BOOL WINAPI
DestroyEnvironmentBlock(LPVOID lpEnvironment
)
352 TRACE("%p\n", lpEnvironment
);
353 r
= RtlDestroyEnvironment(lpEnvironment
);
354 if (r
== STATUS_SUCCESS
)
359 BOOL WINAPI
ExpandEnvironmentStringsForUserA( HANDLE hToken
, LPCSTR lpSrc
,
360 LPSTR lpDest
, DWORD dwSize
)
364 TRACE("%p %s %p %d\n", hToken
, debugstr_a(lpSrc
), lpDest
, dwSize
);
366 ret
= ExpandEnvironmentStringsA( lpSrc
, lpDest
, dwSize
);
367 TRACE("<- %s\n", debugstr_a(lpDest
));
371 BOOL WINAPI
ExpandEnvironmentStringsForUserW( HANDLE hToken
, LPCWSTR lpSrc
,
372 LPWSTR lpDest
, DWORD dwSize
)
376 TRACE("%p %s %p %d\n", hToken
, debugstr_w(lpSrc
), lpDest
, dwSize
);
378 ret
= ExpandEnvironmentStringsW( lpSrc
, lpDest
, dwSize
);
379 TRACE("<- %s\n", debugstr_w(lpDest
));
383 BOOL WINAPI
GetDefaultUserProfileDirectoryA( LPSTR lpProfileDir
, LPDWORD lpcchSize
)
385 FIXME("%p %p\n", lpProfileDir
, lpcchSize
);
389 BOOL WINAPI
GetDefaultUserProfileDirectoryW( LPWSTR lpProfileDir
, LPDWORD lpcchSize
)
391 FIXME("%p %p\n", lpProfileDir
, lpcchSize
);
395 BOOL WINAPI
GetUserProfileDirectoryA( HANDLE hToken
, LPSTR lpProfileDir
,
401 TRACE( "%p %p %p\n", hToken
, lpProfileDir
, lpcchSize
);
403 if (!lpProfileDir
|| !lpcchSize
)
405 SetLastError( ERROR_INVALID_PARAMETER
);
408 if (!(dirW
= HeapAlloc( GetProcessHeap(), 0, *lpcchSize
* sizeof(WCHAR
) )))
411 if ((ret
= GetUserProfileDirectoryW( hToken
, dirW
, lpcchSize
)))
412 WideCharToMultiByte( CP_ACP
, 0, dirW
, *lpcchSize
, lpProfileDir
, *lpcchSize
, NULL
, NULL
);
414 HeapFree( GetProcessHeap(), 0, dirW
);
418 BOOL WINAPI
GetUserProfileDirectoryW( HANDLE hToken
, LPWSTR lpProfileDir
,
422 WCHAR
*userW
= NULL
, *dirW
= NULL
;
423 DWORD len
, dir_len
, domain_len
;
427 TRACE( "%p %p %p\n", hToken
, lpProfileDir
, lpcchSize
);
431 SetLastError( ERROR_INVALID_PARAMETER
);
436 GetTokenInformation( hToken
, TokenUser
, NULL
, 0, &len
);
437 if (GetLastError() != ERROR_INSUFFICIENT_BUFFER
) return FALSE
;
438 if (!(t
= HeapAlloc( GetProcessHeap(), 0, len
))) return FALSE
;
439 if (!GetTokenInformation( hToken
, TokenUser
, t
, len
, &len
)) goto done
;
441 len
= domain_len
= 0;
442 LookupAccountSidW( NULL
, t
->User
.Sid
, NULL
, &len
, NULL
, &domain_len
, NULL
);
443 if (GetLastError() != ERROR_INSUFFICIENT_BUFFER
) goto done
;
444 if (!(userW
= HeapAlloc( GetProcessHeap(), 0, len
* sizeof(WCHAR
) ))) goto done
;
445 if (!LookupAccountSidW( NULL
, t
->User
.Sid
, userW
, &len
, NULL
, &domain_len
, &use
)) goto done
;
448 GetProfilesDirectoryW( NULL
, &dir_len
);
449 if (GetLastError() != ERROR_INSUFFICIENT_BUFFER
) goto done
;
450 if (!(dirW
= HeapAlloc( GetProcessHeap(), 0, (dir_len
+ 1) * sizeof(WCHAR
) ))) goto done
;
451 if (!GetProfilesDirectoryW( dirW
, &dir_len
)) goto done
;
454 if (*lpcchSize
< len
)
456 SetLastError( ERROR_INSUFFICIENT_BUFFER
);
460 lstrcpyW( lpProfileDir
, dirW
);
461 lstrcatW( lpProfileDir
, L
"\\" );
462 lstrcatW( lpProfileDir
, userW
);
467 HeapFree( GetProcessHeap(), 0, t
);
468 HeapFree( GetProcessHeap(), 0, userW
);
469 HeapFree( GetProcessHeap(), 0, dirW
);
473 static const char ProfileListA
[] = "Software\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList";
475 BOOL WINAPI
GetProfilesDirectoryA( LPSTR lpProfilesDir
, LPDWORD lpcchSize
)
477 static const char ProfilesDirectory
[] = "ProfilesDirectory";
481 DWORD len
= 0, expanded_len
;
482 LPSTR unexpanded_profiles_dir
= NULL
;
484 TRACE("%p %p\n", lpProfilesDir
, lpcchSize
);
486 if (!lpProfilesDir
|| !lpcchSize
)
488 SetLastError(ERROR_INVALID_PARAMETER
);
492 l
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, ProfileListA
, 0, KEY_READ
, &key
);
498 l
= RegQueryValueExA(key
, ProfilesDirectory
, NULL
, NULL
, NULL
, &len
);
504 unexpanded_profiles_dir
= HeapAlloc(GetProcessHeap(), 0, len
);
505 if (!unexpanded_profiles_dir
)
507 SetLastError(ERROR_OUTOFMEMORY
);
510 l
= RegQueryValueExA(key
, ProfilesDirectory
, NULL
, NULL
,
511 (BYTE
*)unexpanded_profiles_dir
, &len
);
517 expanded_len
= ExpandEnvironmentStringsA(unexpanded_profiles_dir
, NULL
, 0);
518 /* The returned length doesn't include the NULL terminator. */
519 if (*lpcchSize
< expanded_len
- 1)
521 *lpcchSize
= expanded_len
- 1;
522 SetLastError(ERROR_INSUFFICIENT_BUFFER
);
525 *lpcchSize
= expanded_len
- 1;
526 /* The return value is also the expected length. */
527 ret
= ExpandEnvironmentStringsA(unexpanded_profiles_dir
, lpProfilesDir
,
530 HeapFree(GetProcessHeap(), 0, unexpanded_profiles_dir
);
535 BOOL WINAPI
GetProfilesDirectoryW( LPWSTR lpProfilesDir
, LPDWORD lpcchSize
)
540 DWORD len
= 0, expanded_len
;
541 LPWSTR unexpanded_profiles_dir
= NULL
;
543 TRACE("%p %p\n", lpProfilesDir
, lpcchSize
);
547 SetLastError(ERROR_INVALID_PARAMETER
);
551 l
= RegOpenKeyExW(HKEY_LOCAL_MACHINE
,
552 L
"Software\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList",
559 l
= RegQueryValueExW(key
, L
"ProfilesDirectory", NULL
, NULL
, NULL
, &len
);
565 unexpanded_profiles_dir
= HeapAlloc(GetProcessHeap(), 0, len
);
566 if (!unexpanded_profiles_dir
)
568 SetLastError(ERROR_OUTOFMEMORY
);
571 l
= RegQueryValueExW(key
, L
"ProfilesDirectory", NULL
, NULL
,
572 (BYTE
*)unexpanded_profiles_dir
, &len
);
578 expanded_len
= ExpandEnvironmentStringsW(unexpanded_profiles_dir
, NULL
, 0);
579 /* The returned length doesn't include the NULL terminator. */
580 if (*lpcchSize
< expanded_len
- 1 || !lpProfilesDir
)
582 *lpcchSize
= expanded_len
- 1;
583 SetLastError(ERROR_INSUFFICIENT_BUFFER
);
586 *lpcchSize
= expanded_len
- 1;
587 /* The return value is also the expected length. */
588 ret
= ExpandEnvironmentStringsW(unexpanded_profiles_dir
, lpProfilesDir
,
591 HeapFree(GetProcessHeap(), 0, unexpanded_profiles_dir
);
596 BOOL WINAPI
GetAllUsersProfileDirectoryA( LPSTR lpProfileDir
, LPDWORD lpcchSize
)
598 FIXME("%p %p\n", lpProfileDir
, lpcchSize
);
602 BOOL WINAPI
GetAllUsersProfileDirectoryW( LPWSTR lpProfileDir
, LPDWORD lpcchSize
)
604 FIXME("%p %p\n", lpProfileDir
, lpcchSize
);
608 BOOL WINAPI
GetProfileType( DWORD
*pdwFlags
)
610 FIXME("%p\n", pdwFlags
);
615 BOOL WINAPI
LoadUserProfileA( HANDLE hToken
, LPPROFILEINFOA lpProfileInfo
)
617 FIXME("%p %p\n", hToken
, lpProfileInfo
);
618 lpProfileInfo
->hProfile
= HKEY_CURRENT_USER
;
622 BOOL WINAPI
LoadUserProfileW( HANDLE hToken
, LPPROFILEINFOW lpProfileInfo
)
624 FIXME("%p %p\n", hToken
, lpProfileInfo
);
625 lpProfileInfo
->hProfile
= HKEY_CURRENT_USER
;
629 BOOL WINAPI
RegisterGPNotification( HANDLE event
, BOOL machine
)
631 FIXME("%p %d\n", event
, machine
);
635 BOOL WINAPI
UnregisterGPNotification( HANDLE event
)
637 FIXME("%p\n", event
);
641 BOOL WINAPI
UnloadUserProfile( HANDLE hToken
, HANDLE hProfile
)
643 FIXME("(%p, %p): stub\n", hToken
, hProfile
);
647 HANDLE WINAPI
EnterCriticalPolicySection(BOOL bMachine
)
649 FIXME("(%x)\n", bMachine
);
650 SetLastError(ERROR_ACCESS_DENIED
);
654 BOOL WINAPI
LeaveCriticalPolicySection(HANDLE hSection
)
656 FIXME("(%p)\n", hSection
);
660 DWORD WINAPI
GetAppliedGPOListW(DWORD dwFlags
, LPCWSTR pMachineName
, PSID pSidUser
, GUID
*pGuidExtension
,
661 PGROUP_POLICY_OBJECTW
*ppGPOList
)
663 FIXME("(%x %s %p %s %p)\n", dwFlags
, debugstr_w(pMachineName
), pSidUser
, debugstr_guid(pGuidExtension
), ppGPOList
);
664 return ERROR_ACCESS_DENIED
;
667 /******************************************************************************
673 * int csidl [in] well-known directory location to create link in
674 * LPCSTR lnk_dir [in] directory (relative to directory specified by csidl) to create link in
675 * LPCSTR lnk_filename [in] filename of the link file without .lnk extension
676 * LPCSTR lnk_target [in] file/directory pointed to by link
677 * LPCSTR lnk_iconfile [in] link icon resource filename
678 * DWORD lnk_iconid [in] link icon resource id in file referred by lnk_iconfile
679 * LPCSTR work_directory [in] link target's work directory
680 * WORD hotkey [in] link hotkey (virtual key id)
681 * DWORD win_state [in] initial window size (SW_SHOWMAXIMIZED to start maximized,
682 * SW_SHOWMINNOACTIVE to start minimized, everything else is default state)
683 * LPCSTR comment [in] comment - link's comment
684 * LPCSTR loc_filename_resfile [in] resource file which holds localized filename for this link file
685 * DWORD loc_filename_resid [in] resource id for this link file's localized filename
688 * TRUE: Link file was successfully created
689 * FALSE: Link file was not created
691 BOOL WINAPI
USERENV_138( int csidl
, LPCSTR lnk_dir
, LPCSTR lnk_filename
,
692 LPCSTR lnk_target
, LPCSTR lnk_iconfile
, DWORD lnk_iconid
,
693 LPCSTR work_directory
, WORD hotkey
, DWORD win_state
, LPCSTR comment
,
694 LPCSTR loc_filename_resfile
, DWORD loc_filename_resid
)
696 FIXME("(%d,%s,%s,%s,%s,%d,%s,0x%x,%d,%s,%s,%d) - stub\n", csidl
, debugstr_a(lnk_dir
),
697 debugstr_a(lnk_filename
), debugstr_a(lnk_target
), debugstr_a(lnk_iconfile
),
698 lnk_iconid
, debugstr_a(work_directory
), hotkey
, win_state
,
699 debugstr_a(comment
), debugstr_a(loc_filename_resfile
), loc_filename_resid
);