wintrust: Use path in WIN_TRUST_SUBJECT_FILE structure rather than assuming a path...
[wine] / dlls / userenv / userenv_main.c
1 /*
2  * Implementation of userenv.dll
3  *
4  * Copyright 2006 Mike McCormack for CodeWeavers
5  *
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.
10  *
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.
15  *
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
19  */
20
21 #include <stdarg.h>
22
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 "userenv.h"
30
31 #include "wine/debug.h"
32
33 WINE_DEFAULT_DEBUG_CHANNEL( userenv );
34
35 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
36 {
37     TRACE("%p %d %p\n", hinstDLL, fdwReason, lpvReserved);
38
39     switch (fdwReason)
40     {
41     case DLL_WINE_PREATTACH:
42         return FALSE;  /* prefer native version */
43     case DLL_PROCESS_ATTACH:
44         DisableThreadLibraryCalls(hinstDLL);
45         break;
46     case DLL_PROCESS_DETACH:
47         break;
48     }
49     return TRUE;
50 }
51
52 BOOL WINAPI CreateEnvironmentBlock( LPVOID* lpEnvironment,
53                      HANDLE hToken, BOOL bInherit )
54 {
55     NTSTATUS r;
56
57     TRACE("%p %p %d\n", lpEnvironment, hToken, bInherit );
58
59     if (!lpEnvironment)
60         return FALSE;
61
62     r = RtlCreateEnvironment(bInherit, (WCHAR **)lpEnvironment);
63     if (r == STATUS_SUCCESS)
64         return TRUE;
65     return FALSE;
66 }
67
68 BOOL WINAPI ExpandEnvironmentStringsForUserA( HANDLE hToken, LPCSTR lpSrc,
69                      LPSTR lpDest, DWORD dwSize )
70 {
71     BOOL ret;
72
73     TRACE("%p %s %p %d\n", hToken, debugstr_a(lpSrc), lpDest, dwSize);
74
75     ret = ExpandEnvironmentStringsA( lpSrc, lpDest, dwSize );
76     TRACE("<- %s\n", debugstr_a(lpDest));
77     return ret;
78 }
79
80 BOOL WINAPI ExpandEnvironmentStringsForUserW( HANDLE hToken, LPCWSTR lpSrc,
81                      LPWSTR lpDest, DWORD dwSize )
82 {
83     BOOL ret;
84
85     TRACE("%p %s %p %d\n", hToken, debugstr_w(lpSrc), lpDest, dwSize);
86
87     ret = ExpandEnvironmentStringsW( lpSrc, lpDest, dwSize );
88     TRACE("<- %s\n", debugstr_w(lpDest));
89     return ret;
90 }
91
92 BOOL WINAPI GetUserProfileDirectoryA( HANDLE hToken, LPSTR lpProfileDir,
93                      LPDWORD lpcchSize )
94 {
95     FIXME("%p %p %p\n", hToken, lpProfileDir, lpcchSize );
96     return FALSE;
97 }
98
99 BOOL WINAPI GetUserProfileDirectoryW( HANDLE hToken, LPWSTR lpProfileDir,
100                      LPDWORD lpcchSize )
101 {
102     FIXME("%p %p %p\n", hToken, lpProfileDir, lpcchSize );
103     return FALSE;
104 }
105
106 BOOL WINAPI GetProfilesDirectoryA( LPSTR lpProfilesDir, LPDWORD lpcchSize )
107 {
108     FIXME("%p %p\n", lpProfilesDir, lpcchSize );
109     return FALSE;
110 }
111
112 BOOL WINAPI GetProfilesDirectoryW( LPWSTR lpProfilesDir, LPDWORD lpcchSize )
113 {
114     FIXME("%p %p\n", lpProfilesDir, lpcchSize );
115     return FALSE;
116 }
117
118 BOOL WINAPI GetProfileType( DWORD *pdwFlags )
119 {
120     FIXME("%p\n", pdwFlags );
121     *pdwFlags = 0;
122     return TRUE;
123 }
124
125 BOOL WINAPI LoadUserProfileA( HANDLE hToken, LPPROFILEINFOA lpProfileInfo )
126 {
127     FIXME("%p %p\n", hToken, lpProfileInfo );
128     lpProfileInfo->hProfile = HKEY_CURRENT_USER;
129     return TRUE;
130 }
131
132 BOOL WINAPI RegisterGPNotification( HANDLE event, BOOL machine )
133 {
134     FIXME("%p %d\n", event, machine );
135     return TRUE;
136 }
137
138 BOOL WINAPI UnregisterGPNotification( HANDLE event )
139 {
140     FIXME("%p\n", event );
141     return TRUE;
142 }
143
144 BOOL WINAPI UnloadUserProfile( HANDLE hToken, HANDLE hProfile )
145 {
146     FIXME("(%p, %p): stub\n", hToken, hProfile);
147     return FALSE;
148 }