2 * Win32 advapi functions
4 * Copyright 1995 Sven Verdoolaege
15 /***********************************************************************
16 * StartServiceCtrlDispatcherA [ADVAPI32.196]
18 BOOL32 WINAPI StartServiceCtrlDispatcher32A(LPSERVICE_TABLE_ENTRY32A servent)
20 FIXME(advapi,"(%p '%s'): STUB.\n",servent,servent->lpServiceName);
24 /***********************************************************************
25 * StartServiceCtrlDispatcherW [ADVAPI32.197]
27 BOOL32 WINAPI StartServiceCtrlDispatcher32W(LPSERVICE_TABLE_ENTRY32W servent)
31 lstrcpynWtoA(buffer,servent->lpServiceName,200);
32 FIXME(advapi,"(%p '%s'): STUB.\n",servent,buffer);
37 /******************************************************************************
38 * OpenProcessToken [ADVAPI32.109]
39 * Opens the access token associated with a process
42 * ProcessHandle [I] Handle to process
43 * DesiredAccess [I] Desired access to process
44 * TokenHandle [O] Pointer to handle of open access token
48 BOOL32 WINAPI OpenProcessToken( HANDLE32 ProcessHandle, DWORD DesiredAccess,
49 HANDLE32 *TokenHandle )
51 FIXME(advapi,"(%08x,%08lx,%p): stub\n",ProcessHandle,DesiredAccess,
57 /***********************************************************************
58 * OpenThreadToken [ADVAPI32.114]
60 BOOL32 WINAPI OpenThreadToken( HANDLE32 thread,DWORD desiredaccess,
61 BOOL32 openasself,HANDLE32 *thandle )
63 FIXME(advapi,"(%08x,%08lx,%d,%p): stub!\n",
64 thread,desiredaccess,openasself,thandle);
69 /******************************************************************************
70 * LookupPrivilegeValue32A [ADVAPI32.92]
72 BOOL32 WINAPI LookupPrivilegeValue32A( LPCSTR lpSystemName,
73 LPCSTR lpName, LPVOID lpLuid)
75 LPWSTR lpSystemNameW = HEAP_strdupAtoW(GetProcessHeap(), 0, lpSystemName);
76 LPWSTR lpNameW = HEAP_strdupAtoW(GetProcessHeap(), 0, lpName);
77 BOOL32 ret = LookupPrivilegeValue32W( lpSystemNameW, lpNameW, lpLuid);
78 HeapFree(GetProcessHeap(), 0, lpNameW);
79 HeapFree(GetProcessHeap(), 0, lpSystemNameW);
84 /******************************************************************************
85 * LookupPrivilegeValue32W [ADVAPI32.93]
86 * Retrieves LUID used on a system to represent the privilege name.
89 * lpLuid should be PLUID
92 * lpSystemName [I] Address of string specifying the system
93 * lpName [I] Address of string specifying the privilege
94 * lpLuid [I] Address of locally unique identifier
98 BOOL32 WINAPI LookupPrivilegeValue32W( LPCWSTR lpSystemName,
99 LPCWSTR lpName, LPVOID lpLuid )
101 FIXME(advapi,"(%s,%s,%p): stub\n",debugstr_w(lpSystemName),
102 debugstr_w(lpName), lpLuid);
107 /***********************************************************************
108 * AdjustTokenPrivileges [ADVAPI32.10]
110 BOOL32 WINAPI AdjustTokenPrivileges(HANDLE32 TokenHandle,BOOL32 DisableAllPrivileges,
111 LPVOID NewState,DWORD BufferLength,LPVOID PreviousState,
112 LPDWORD ReturnLength )
117 /***********************************************************************
118 * GetTokenInformation [ADVAPI32.66]
120 BOOL32 WINAPI GetTokenInformation(
121 HANDLE32 token,TOKEN_INFORMATION_CLASS tokeninfoclass,LPVOID tokeninfo,
122 DWORD tokeninfolength,LPDWORD retlen
124 FIXME(advapi,"(%08x,%d,%p,%ld,%p): stub\n",
125 token,tokeninfoclass,tokeninfo,tokeninfolength,retlen);
130 /******************************************************************************
131 * OpenSCManager32A [ADVAPI32.110]
133 HANDLE32 WINAPI OpenSCManager32A( LPCSTR lpMachineName, LPCSTR lpDatabaseName,
134 DWORD dwDesiredAccess )
136 LPWSTR lpMachineNameW = HEAP_strdupAtoW(GetProcessHeap(),0,lpMachineName);
137 LPWSTR lpDatabaseNameW = HEAP_strdupAtoW(GetProcessHeap(),0,lpDatabaseName);
138 DWORD ret = OpenSCManager32W(lpMachineNameW,lpDatabaseNameW,
140 HeapFree(GetProcessHeap(),0,lpDatabaseNameW);
141 HeapFree(GetProcessHeap(),0,lpMachineNameW);
146 /******************************************************************************
147 * OpenSCManager32W [ADVAPI32.111]
148 * Establishes a connection to the service control manager and opens database
151 * This should return a SC_HANDLE
154 * lpMachineName [I] Pointer to machine name string
155 * lpDatabaseName [I] Pointer to database name string
156 * dwDesiredAccess [I] Type of access
159 * Success: Handle to service control manager database
162 HANDLE32 WINAPI OpenSCManager32W( LPCWSTR lpMachineName, LPCWSTR lpDatabaseName,
163 DWORD dwDesiredAccess )
165 FIXME(advapi,"(%s,%s,0x%08lx): stub\n", debugstr_w(lpMachineName),
166 debugstr_w(lpDatabaseName), dwDesiredAccess);
171 BOOL32 WINAPI AllocateLocallyUniqueId(LPLUID lpluid) {
172 lpluid->LowPart = time(NULL);
173 lpluid->HighPart = 0;
178 /******************************************************************************
179 * ControlService [ADVAPI32.23]
180 * Sends a control code to a Win32-based service.
183 * hService should be SC_HANDLE
187 BOOL32 WINAPI ControlService( HANDLE32 hService, DWORD dwControl,
188 LPSERVICE_STATUS lpServiceStatus )
190 FIXME(advapi, "(%d,%ld,%p): stub\n",hService,dwControl,lpServiceStatus);
195 /******************************************************************************
196 * CloseServiceHandle [ADVAPI32.22]
197 * Close handle to service or service control manager
200 * hSCObject [I] Handle to service or service control manager database
203 * hSCObject should be SC_HANDLE
207 BOOL32 WINAPI CloseServiceHandle( HANDLE32 hSCObject )
209 FIXME(advapi, "(%d): stub\n", hSCObject);
214 /******************************************************************************
215 * GetFileSecurityA [32.45]
216 * Obtains Specified information about the security of a file or directory
217 * The information obtained is constrained by the callers acces rights and
221 BOOL32 WINAPI GetFileSecurity32A( LPCSTR lpFileName,
222 SECURITY_INFORMATION RequestedInformation,
223 LPSECURITY_DESCRIPTOR pSecurityDescriptor,
225 LPDWORD lpnLengthNeeded)
227 FIXME(advapi, "(%s) : stub\n", debugstr_a(lpFileName));
231 /******************************************************************************
232 * GetFileSecurityiW [32.46]
233 * Obtains Specified information about the security of a file or directory
234 * The information obtained is constrained by the callers acces rights and
238 BOOL32 WINAPI GetFileSecurity32W( LPCWSTR lpFileName,
239 SECURITY_INFORMATION RequestedInformation,
240 LPSECURITY_DESCRIPTOR pSecurityDescriptor,
242 LPDWORD lpnLengthNeeded)
244 FIXME(advapi, "(%s) : stub\n", debugstr_w(lpFileName) );
248 /******************************************************************************
249 * SetFileSecurityA [32.182]
250 * Sets the security of a file or directory
253 BOOL32 WINAPI SetFileSecurity32A( LPCSTR lpFileName,
254 SECURITY_INFORMATION RequestedInformation,
255 LPSECURITY_DESCRIPTOR pSecurityDescriptor)
257 FIXME(advapi, "(%s) : stub\n", debugstr_a(lpFileName));
261 /******************************************************************************
262 * SetFileSecurityW [32.183]
263 * Sets the security of a file or directory
266 BOOL32 WINAPI SetFileSecurity32W( LPCWSTR lpFileName,
267 SECURITY_INFORMATION RequestedInformation,
268 LPSECURITY_DESCRIPTOR pSecurityDescriptor)
270 FIXME(advapi, "(%s) : stub\n", debugstr_w(lpFileName) );
274 /******************************************************************************
275 * OpenService32A [ADVAPI32.112]
277 HANDLE32 WINAPI OpenService32A( HANDLE32 hSCManager, LPCSTR lpServiceName,
278 DWORD dwDesiredAccess )
280 LPWSTR lpServiceNameW = HEAP_strdupAtoW(GetProcessHeap(),0,lpServiceName);
281 DWORD ret = OpenService32W( hSCManager, lpServiceNameW, dwDesiredAccess);
282 HeapFree(GetProcessHeap(),0,lpServiceNameW);
287 /******************************************************************************
288 * OpenService32W [ADVAPI32.113]
289 * Opens a handle to an existing service
292 * The return value should be SC_HANDLE
293 * hSCManager should be SC_HANDLE
296 * Success: Handle to the service
299 HANDLE32 WINAPI OpenService32W( HANDLE32 hSCManager, LPCWSTR lpServiceName,
300 DWORD dwDesiredAccess )
302 FIXME(advapi, "(%d,%p,%ld): stub\n",hSCManager, lpServiceName,
308 /******************************************************************************
309 * CreateServiceA [ADVAPI32.28]
311 DWORD WINAPI CreateServiceA( DWORD hSCManager, LPCSTR lpServiceName,
312 LPCSTR lpDisplayName, DWORD dwDesiredAccess,
313 DWORD dwServiceType, DWORD dwStartType,
314 DWORD dwErrorControl, LPCSTR lpBinaryPathName,
315 LPCSTR lpLoadOrderGroup, LPDWORD lpdwTagId,
316 LPCSTR lpDependencies, LPCSTR lpServiceStartName,
319 FIXME(advapi, "(%ld,%s,%s,...): stub\n",
320 hSCManager, debugstr_a(lpServiceName), debugstr_a(lpDisplayName));
325 /******************************************************************************
326 * DeleteService [ADVAPI32.31]
329 * hService [I] Handle to service
334 * hService should be SC_HANDLE
336 BOOL32 WINAPI DeleteService( HANDLE32 hService )
338 FIXME(advapi, "(%d): stub\n",hService);
343 /******************************************************************************
344 * StartService32A [ADVAPI32.195]
347 * How do we convert lpServiceArgVectors to use the 32W version?
349 BOOL32 WINAPI StartService32A( HANDLE32 hService, DWORD dwNumServiceArgs,
350 LPCSTR *lpServiceArgVectors )
352 FIXME(advapi, "(%d,%ld,%p): stub\n",hService,dwNumServiceArgs,lpServiceArgVectors);
357 /******************************************************************************
358 * StartService32W [ADVAPI32.198]
362 * hService [I] Handle of service
363 * dwNumServiceArgs [I] Number of arguments
364 * lpServiceArgVectors [I] Address of array of argument string pointers
369 * hService should be SC_HANDLE
371 BOOL32 WINAPI StartService32W( HANDLE32 hService, DWORD dwNumServiceArgs,
372 LPCWSTR *lpServiceArgVectors )
374 FIXME(advapi, "(%d,%ld,%p): stub\n",hService,dwNumServiceArgs,
375 lpServiceArgVectors);
380 /******************************************************************************
381 * DeregisterEventSource [ADVAPI32.32]
382 * Closes a handle to the specified event log
385 * hEventLog [I] Handle to event log
389 BOOL32 WINAPI DeregisterEventSource( HANDLE32 hEventLog )
391 FIXME(advapi, "(%d): stub\n",hEventLog);
396 /******************************************************************************
397 * RegisterEventSource32A [ADVAPI32.174]
399 HANDLE32 WINAPI RegisterEventSource32A( LPCSTR lpUNCServerName,
400 LPCSTR lpSourceName )
402 LPWSTR lpUNCServerNameW = HEAP_strdupAtoW(GetProcessHeap(),0,lpUNCServerName);
403 LPWSTR lpSourceNameW = HEAP_strdupAtoW(GetProcessHeap(),0,lpSourceName);
404 HANDLE32 ret = RegisterEventSource32W(lpUNCServerNameW,lpSourceNameW);
405 HeapFree(GetProcessHeap(),0,lpSourceNameW);
406 HeapFree(GetProcessHeap(),0,lpUNCServerNameW);
411 /******************************************************************************
412 * RegisterEventSource32W [ADVAPI32.175]
413 * Returns a registered handle to an event log
416 * lpUNCServerName [I] Server name for source
417 * lpSourceName [I] Source name for registered handle
423 HANDLE32 WINAPI RegisterEventSource32W( LPCWSTR lpUNCServerName,
424 LPCWSTR lpSourceName )
426 FIXME(advapi, "(%s,%s): stub\n", debugstr_w(lpUNCServerName),
427 debugstr_w(lpSourceName));