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
31 #include "wine/debug.h"
33 WINE_DEFAULT_DEBUG_CHANNEL( userenv );
35 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
37 TRACE("%p %d %p\n", hinstDLL, fdwReason, lpvReserved);
41 case DLL_WINE_PREATTACH:
42 return FALSE; /* prefer native version */
43 case DLL_PROCESS_ATTACH:
44 DisableThreadLibraryCalls(hinstDLL);
46 case DLL_PROCESS_DETACH:
52 BOOL WINAPI CreateEnvironmentBlock( LPVOID* lpEnvironment,
53 HANDLE hToken, BOOL bInherit )
57 TRACE("%p %p %d\n", lpEnvironment, hToken, bInherit );
62 r = RtlCreateEnvironment(bInherit, (WCHAR **)lpEnvironment);
63 if (r == STATUS_SUCCESS)
68 BOOL WINAPI DestroyEnvironmentBlock(LPVOID lpEnvironment)
72 TRACE("%p\n", lpEnvironment);
73 r = RtlDestroyEnvironment(lpEnvironment);
74 if (r == STATUS_SUCCESS)
79 BOOL WINAPI ExpandEnvironmentStringsForUserA( HANDLE hToken, LPCSTR lpSrc,
80 LPSTR lpDest, DWORD dwSize )
84 TRACE("%p %s %p %d\n", hToken, debugstr_a(lpSrc), lpDest, dwSize);
86 ret = ExpandEnvironmentStringsA( lpSrc, lpDest, dwSize );
87 TRACE("<- %s\n", debugstr_a(lpDest));
91 BOOL WINAPI ExpandEnvironmentStringsForUserW( HANDLE hToken, LPCWSTR lpSrc,
92 LPWSTR lpDest, DWORD dwSize )
96 TRACE("%p %s %p %d\n", hToken, debugstr_w(lpSrc), lpDest, dwSize);
98 ret = ExpandEnvironmentStringsW( lpSrc, lpDest, dwSize );
99 TRACE("<- %s\n", debugstr_w(lpDest));
103 BOOL WINAPI GetUserProfileDirectoryA( HANDLE hToken, LPSTR lpProfileDir,
106 FIXME("%p %p %p\n", hToken, lpProfileDir, lpcchSize );
110 BOOL WINAPI GetUserProfileDirectoryW( HANDLE hToken, LPWSTR lpProfileDir,
113 FIXME("%p %p %p\n", hToken, lpProfileDir, lpcchSize );
117 BOOL WINAPI GetProfilesDirectoryA( LPSTR lpProfilesDir, LPDWORD lpcchSize )
119 FIXME("%p %p\n", lpProfilesDir, lpcchSize );
123 BOOL WINAPI GetProfilesDirectoryW( LPWSTR lpProfilesDir, LPDWORD lpcchSize )
125 FIXME("%p %p\n", lpProfilesDir, lpcchSize );
129 BOOL WINAPI GetAllUsersProfileDirectoryA( LPSTR lpProfileDir, LPDWORD lpcchSize )
131 FIXME("%p %p\n", lpProfileDir, lpcchSize);
135 BOOL WINAPI GetAllUsersProfileDirectoryW( LPWSTR lpProfileDir, LPDWORD lpcchSize )
137 FIXME("%p %p\n", lpProfileDir, lpcchSize);
141 BOOL WINAPI GetProfileType( DWORD *pdwFlags )
143 FIXME("%p\n", pdwFlags );
148 BOOL WINAPI LoadUserProfileA( HANDLE hToken, LPPROFILEINFOA lpProfileInfo )
150 FIXME("%p %p\n", hToken, lpProfileInfo );
151 lpProfileInfo->hProfile = HKEY_CURRENT_USER;
155 BOOL WINAPI LoadUserProfileW( HANDLE hToken, LPPROFILEINFOW lpProfileInfo )
157 FIXME("%p %p\n", hToken, lpProfileInfo );
158 lpProfileInfo->hProfile = HKEY_CURRENT_USER;
162 BOOL WINAPI RegisterGPNotification( HANDLE event, BOOL machine )
164 FIXME("%p %d\n", event, machine );
168 BOOL WINAPI UnregisterGPNotification( HANDLE event )
170 FIXME("%p\n", event );
174 BOOL WINAPI UnloadUserProfile( HANDLE hToken, HANDLE hProfile )
176 FIXME("(%p, %p): stub\n", hToken, hProfile);
180 /******************************************************************************
186 * int csidl [in] well-known directory location to create link in
187 * LPCSTR lnk_dir [in] directory (relative to directory specified by csidl) to create link in
188 * LPCSTR lnk_filename [in] filename of the link file without .lnk extension
189 * LPCSTR lnk_target [in] file/directory pointed to by link
190 * LPCSTR lnk_iconfile [in] link icon resource filename
191 * DWORD lnk_iconid [in] link icon resource id in file referred by lnk_iconfile
192 * LPCSTR work_directory [in] link target's work directory
193 * WORD hotkey [in] link hotkey (virtual key id)
194 * DWORD win_state [in] initial window size (SW_SHOWMAXIMIZED to start maximized,
195 * SW_SHOWMINNOACTIVE to start minimized, everything else is default state)
196 * LPCSTR comment [in] comment - link's comment
197 * LPCSTR loc_filename_resfile [in] resource file which holds localized filename for this link file
198 * DWORD loc_filename_resid [in] resource id for this link file's localized filename
201 * TRUE: Link file was successfully created
202 * FALSE: Link file was not created
204 BOOL WINAPI USERENV_138( int csidl, LPCSTR lnk_dir, LPCSTR lnk_filename,
205 LPCSTR lnk_target, LPCSTR lnk_iconfile, DWORD lnk_iconid,
206 LPCSTR work_directory, WORD hotkey, DWORD win_state, LPCSTR comment,
207 LPCSTR loc_filename_resfile, DWORD loc_filename_resid)
209 FIXME("(%d,%s,%s,%s,%s,%d,%s,0x%x,%d,%s,%s,%d) - stub\n", csidl, debugstr_a(lnk_dir),
210 debugstr_a(lnk_filename), debugstr_a(lnk_target), debugstr_a(lnk_iconfile),
211 lnk_iconid, debugstr_a(work_directory), hotkey, win_state,
212 debugstr_a(comment), debugstr_a(loc_filename_resfile), loc_filename_resid );