7 BOOL32 WINAPI IsValidSid (LPSID pSid);
8 BOOL32 WINAPI EqualSid (LPSID pSid1, LPSID pSid2);
9 BOOL32 WINAPI EqualPrefixSid (LPSID pSid1, LPSID pSid2);
10 DWORD WINAPI GetSidLengthRequired (BYTE nSubAuthorityCount);
11 BOOL32 WINAPI AllocateAndInitializeSid(LPSID_IDENTIFIER_AUTHORITY pIdentifierAuthority, BYTE nSubAuthorityCount, DWORD nSubAuthority0, DWORD nSubAuthority1, DWORD nSubAuthority2, DWORD nSubAuthority3, DWORD nSubAuthority4, DWORD nSubAuthority5, DWORD nSubAuthority6, DWORD nSubAuthority7, LPSID *pSid);
12 VOID* WINAPI FreeSid(LPSID pSid);
13 BOOL32 WINAPI InitializeSid (LPSID pSid, LPSID_IDENTIFIER_AUTHORITY pIdentifierAuthority, BYTE nSubAuthorityCount);
14 LPSID_IDENTIFIER_AUTHORITY WINAPI GetSidIdentifierAuthority(LPSID pSid);
15 DWORD* WINAPI GetSidSubAuthority(LPSID pSid, DWORD nSubAuthority);
16 BYTE* WINAPI GetSidSubAuthorityCount(LPSID pSid);
17 DWORD WINAPI GetLengthSid(LPSID pSid);
18 BOOL32 WINAPI CopySid(DWORD nDestinationSidLength, LPSID pDestinationSid, LPSID pSourceSid);
20 /******************************************************************************
21 * OpenProcessToken [ADVAPI32.109]
22 * Opens the access token associated with a process
25 * ProcessHandle [I] Handle to process
26 * DesiredAccess [I] Desired access to process
27 * TokenHandle [O] Pointer to handle of open access token
31 BOOL32 WINAPI OpenProcessToken( HANDLE32 ProcessHandle, DWORD DesiredAccess,
32 HANDLE32 *TokenHandle )
34 FIXME(advapi,"(%08x,%08lx,%p): stub\n",ProcessHandle,DesiredAccess,
40 /***********************************************************************
41 * OpenThreadToken [ADVAPI32.114]
43 BOOL32 WINAPI OpenThreadToken( HANDLE32 thread,DWORD desiredaccess,
44 BOOL32 openasself,HANDLE32 *thandle )
46 FIXME(advapi,"(%08x,%08lx,%d,%p): stub!\n",
47 thread,desiredaccess,openasself,thandle);
48 *thandle = 0; /* FIXME ... well, store something in there ;) */
53 /******************************************************************************
54 * LookupPrivilegeValue32A [ADVAPI32.92]
56 BOOL32 WINAPI LookupPrivilegeValue32A( LPCSTR lpSystemName,
57 LPCSTR lpName, LPVOID lpLuid)
59 LPWSTR lpSystemNameW = HEAP_strdupAtoW(GetProcessHeap(), 0, lpSystemName);
60 LPWSTR lpNameW = HEAP_strdupAtoW(GetProcessHeap(), 0, lpName);
61 BOOL32 ret = LookupPrivilegeValue32W( lpSystemNameW, lpNameW, lpLuid);
62 HeapFree(GetProcessHeap(), 0, lpNameW);
63 HeapFree(GetProcessHeap(), 0, lpSystemNameW);
68 /******************************************************************************
69 * LookupPrivilegeValue32W [ADVAPI32.93]
70 * Retrieves LUID used on a system to represent the privilege name.
73 * lpLuid should be PLUID
76 * lpSystemName [I] Address of string specifying the system
77 * lpName [I] Address of string specifying the privilege
78 * lpLuid [I] Address of locally unique identifier
82 BOOL32 WINAPI LookupPrivilegeValue32W( LPCWSTR lpSystemName,
83 LPCWSTR lpName, LPVOID lpLuid )
85 FIXME(advapi,"(%s,%s,%p): stub\n",debugstr_w(lpSystemName),
86 debugstr_w(lpName), lpLuid);
89 /******************************************************************************
90 * GetFileSecurityA [ADVAPI32.45]
91 * Obtains Specified information about the security of a file or directory
92 * The information obtained is constrained by the callers acces rights and
96 BOOL32 WINAPI GetFileSecurity32A( LPCSTR lpFileName,
97 SECURITY_INFORMATION RequestedInformation,
98 LPSECURITY_DESCRIPTOR pSecurityDescriptor,
100 LPDWORD lpnLengthNeeded)
102 FIXME(advapi, "(%s) : stub\n", debugstr_a(lpFileName));
106 /******************************************************************************
107 * GetFileSecurityiW [ADVAPI32.46]
108 * Obtains Specified information about the security of a file or directory
109 * The information obtained is constrained by the callers acces rights and
113 BOOL32 WINAPI GetFileSecurity32W( LPCWSTR lpFileName,
114 SECURITY_INFORMATION RequestedInformation,
115 LPSECURITY_DESCRIPTOR pSecurityDescriptor,
117 LPDWORD lpnLengthNeeded)
119 FIXME(advapi, "(%s) : stub\n", debugstr_w(lpFileName) );
124 /***********************************************************************
125 * AdjustTokenPrivileges [ADVAPI32.10]
127 BOOL32 WINAPI AdjustTokenPrivileges(HANDLE32 TokenHandle,BOOL32 DisableAllPrivileges,
128 LPVOID NewState,DWORD BufferLength,LPVOID PreviousState,
129 LPDWORD ReturnLength )
134 /***********************************************************************
135 * CopySid [ADVAPI.24]
137 BOOL32 WINAPI CopySid (DWORD nDestinationSidLength, LPSID pDestinationSid,
141 if (!IsValidSid(pSourceSid))
144 if (nDestinationSidLength < GetLengthSid(pSourceSid))
147 memcpy(pDestinationSid, pSourceSid, GetLengthSid(pSourceSid));
152 /***********************************************************************
153 * IsValidSid (ADVAPI.80)
155 BOOL32 WINAPI IsValidSid (LPSID pSid) {
156 if (!pSid || pSid->Revision != SID_REVISION)
162 /***********************************************************************
163 * EqualSid (ADVAPI.40)
165 BOOL32 WINAPI EqualSid (LPSID pSid1, LPSID pSid2) {
166 if (!IsValidSid(pSid1) || !IsValidSid(pSid2))
169 if (*GetSidSubAuthorityCount(pSid1) != *GetSidSubAuthorityCount(pSid2))
172 if (memcmp(pSid1, pSid2, GetLengthSid(pSid1)) != 0)
178 /***********************************************************************
179 * EqualPrefixSid (ADVAPI.39)
181 BOOL32 WINAPI EqualPrefixSid (LPSID pSid1, LPSID pSid2) {
182 if (!IsValidSid(pSid1) || !IsValidSid(pSid2))
185 if (*GetSidSubAuthorityCount(pSid1) != *GetSidSubAuthorityCount(pSid2))
188 if (memcmp(pSid1, pSid2, GetSidLengthRequired(pSid1->SubAuthorityCount - 1))
195 /***********************************************************************
196 * GetSidLengthRequired (ADVAPI.63)
198 DWORD WINAPI GetSidLengthRequired (BYTE nSubAuthorityCount) {
199 return sizeof (SID) + (nSubAuthorityCount - 1) * sizeof (DWORD);
202 /***********************************************************************
203 * GetTokenInformation [ADVAPI32.66]
205 BOOL32 WINAPI GetTokenInformation(
206 HANDLE32 token,/*TOKEN_INFORMATION_CLASS*/ DWORD tokeninfoclass,LPVOID tokeninfo,
207 DWORD tokeninfolength,LPDWORD retlen
209 FIXME(advapi,"(%08x,%ld,%p,%ld,%p): stub\n",
210 token,tokeninfoclass,tokeninfo,tokeninfolength,retlen);
214 /***********************************************************************
215 * AllocateAndInitializeSid (ADVAPI.11)
217 BOOL32 WINAPI AllocateAndInitializeSid(LPSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
218 BYTE nSubAuthorityCount,
219 DWORD nSubAuthority0, DWORD nSubAuthority1,
220 DWORD nSubAuthority2, DWORD nSubAuthority3,
221 DWORD nSubAuthority4, DWORD nSubAuthority5,
222 DWORD nSubAuthority6, DWORD nSubAuthority7,
225 if (!(*pSid = HeapAlloc( GetProcessHeap(), 0,
226 GetSidLengthRequired(nSubAuthorityCount))))
228 (*pSid)->Revision = SID_REVISION;
229 if (pIdentifierAuthority)
230 memcpy(&(*pSid)->IdentifierAuthority, pIdentifierAuthority,
231 sizeof (SID_IDENTIFIER_AUTHORITY));
232 *GetSidSubAuthorityCount(*pSid) = nSubAuthorityCount;
234 if (nSubAuthorityCount > 0)
235 *GetSidSubAuthority(*pSid, 0) = nSubAuthority0;
236 if (nSubAuthorityCount > 1)
237 *GetSidSubAuthority(*pSid, 1) = nSubAuthority1;
238 if (nSubAuthorityCount > 2)
239 *GetSidSubAuthority(*pSid, 2) = nSubAuthority2;
240 if (nSubAuthorityCount > 3)
241 *GetSidSubAuthority(*pSid, 3) = nSubAuthority3;
242 if (nSubAuthorityCount > 4)
243 *GetSidSubAuthority(*pSid, 4) = nSubAuthority4;
244 if (nSubAuthorityCount > 5)
245 *GetSidSubAuthority(*pSid, 5) = nSubAuthority5;
246 if (nSubAuthorityCount > 6)
247 *GetSidSubAuthority(*pSid, 6) = nSubAuthority6;
248 if (nSubAuthorityCount > 7)
249 *GetSidSubAuthority(*pSid, 7) = nSubAuthority7;
254 /***********************************************************************
255 * FreeSid (ADVAPI.42)
257 VOID* WINAPI FreeSid(LPSID pSid)
259 HeapFree( GetProcessHeap(), 0, pSid );
263 /***********************************************************************
264 * InitializeSecurityDescriptor (ADVAPI.73)
266 BOOL32 WINAPI InitializeSecurityDescriptor( SECURITY_DESCRIPTOR *pDescr,
269 FIXME(security, "(%p,%#lx): stub\n", pDescr, revision);
273 /***********************************************************************
274 * GetSecurityDescriptorLength (ADVAPI.55)
276 DWORD WINAPI GetSecurityDescriptorLength( SECURITY_DESCRIPTOR *pDescr)
278 FIXME(security, "(%p), stub\n", pDescr);
282 /***********************************************************************
283 * GetSecurityDescriptorOwner (ADVAPI.56)
285 BOOL32 WINAPI GetSecurityDescriptorOwner (SECURITY_DESCRIPTOR *pDescr,LPSID *pOwner,LPBOOL32 lpbOwnerDefaulted)
287 FIXME(security, "(%p,%p,%p), stub\n", pDescr,pOwner,lpbOwnerDefaulted);
288 *lpbOwnerDefaulted = TRUE;
292 /***********************************************************************
293 * GetSecurityDescriptorGroup (ADVAPI.54)
295 BOOL32 WINAPI GetSecurityDescriptorGroup(SECURITY_DESCRIPTOR *pDescr,LPSID *pGroup,LPBOOL32 lpbOwnerDefaulted)
297 FIXME(security, "(%p,%p,%p), stub\n", pDescr,pGroup,lpbOwnerDefaulted);
298 *lpbOwnerDefaulted = TRUE;
302 /***********************************************************************
303 * InitializeSid (ADVAPI.74)
305 BOOL32 WINAPI InitializeSid (LPSID pSid, LPSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
306 BYTE nSubAuthorityCount)
310 pSid->Revision = SID_REVISION;
311 if (pIdentifierAuthority)
312 memcpy(&pSid->IdentifierAuthority, pIdentifierAuthority,
313 sizeof (SID_IDENTIFIER_AUTHORITY));
314 *GetSidSubAuthorityCount(pSid) = nSubAuthorityCount;
316 for (i = 0; i < nSubAuthorityCount; i++)
317 *GetSidSubAuthority(pSid, i) = 0;
322 /***********************************************************************
323 * GetSidIdentifierAuthority (ADVAPI.62)
325 LPSID_IDENTIFIER_AUTHORITY WINAPI GetSidIdentifierAuthority (LPSID pSid)
327 return &pSid->IdentifierAuthority;
330 /***********************************************************************
331 * GetSidSubAuthority (ADVAPI.64)
333 DWORD * WINAPI GetSidSubAuthority (LPSID pSid, DWORD nSubAuthority)
335 return &pSid->SubAuthority[nSubAuthority];
338 /***********************************************************************
339 * GetSidSubAuthorityCount [ADVAPI.65]
341 BYTE * WINAPI GetSidSubAuthorityCount (LPSID pSid)
343 return &pSid->SubAuthorityCount;
346 /***********************************************************************
347 * GetLengthSid [ADVAPI.48]
349 DWORD WINAPI GetLengthSid (LPSID pSid)
351 return GetSidLengthRequired(*GetSidSubAuthorityCount(pSid));
354 /******************************************************************************
355 * IsValidSecurityDescriptor [ADVAPI32]
357 BOOL32 WINAPI IsValidSecurityDescriptor(LPSECURITY_DESCRIPTOR lpsecdesc) {
358 FIXME(advapi,"(%p),stub!\n",lpsecdesc);
362 /***********************************************************************
363 * LookupAccountSidA [ADVAPI32.86]
365 BOOL32 WINAPI LookupAccountSid32A(LPCSTR system,PSID sid,
366 LPCSTR account,LPDWORD accountSize,
367 LPCSTR domain, LPDWORD domainSize,
368 PSID_NAME_USE name_use)
370 FIXME(security,"(%s,%p,%p,%p,%p,%p,%p): stub\n",
371 system,sid,account,accountSize,domain,domainSize,name_use);
372 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
376 /***********************************************************************
377 * LookupAccountSidW [ADVAPI32.86]
379 BOOL32 WINAPI LookupAccountSid32W(LPCWSTR system,PSID sid,
380 LPCWSTR account,LPDWORD accountSize,
381 LPCWSTR domain, LPDWORD domainSize,
382 PSID_NAME_USE name_use)
384 FIXME(security,"(%p,%p,%p,%p,%p,%p,%p): stub\n",
385 system,sid,account,accountSize,domain,domainSize,name_use);
386 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
390 /******************************************************************************
391 * SetFileSecurityA [ADVAPI32.182]
392 * Sets the security of a file or directory
395 BOOL32 WINAPI SetFileSecurity32A( LPCSTR lpFileName,
396 SECURITY_INFORMATION RequestedInformation,
397 LPSECURITY_DESCRIPTOR pSecurityDescriptor)
399 FIXME(advapi, "(%s) : stub\n", debugstr_a(lpFileName));
403 /******************************************************************************
404 * SetFileSecurityW [ADVAPI32.183]
405 * Sets the security of a file or directory
408 BOOL32 WINAPI SetFileSecurity32W( LPCWSTR lpFileName,
409 SECURITY_INFORMATION RequestedInformation,
410 LPSECURITY_DESCRIPTOR pSecurityDescriptor)
412 FIXME(advapi, "(%s) : stub\n", debugstr_w(lpFileName) );
415 /******************************************************************************
416 * MakeSelfRelativeSD [ADVAPI32]
418 BOOL32 WINAPI MakeSelfRelativeSD(
419 LPSECURITY_DESCRIPTOR lpabssecdesc,
420 LPSECURITY_DESCRIPTOR lpselfsecdesc,LPDWORD lpbuflen
422 FIXME(advapi,"(%p,%p,%p),stub!\n",lpabssecdesc,lpselfsecdesc,lpbuflen);
426 /******************************************************************************
427 * QueryWindows31FilesMigration [ADVAPI32]
429 BOOL32 WINAPI QueryWindows31FilesMigration(DWORD x1) {
430 FIXME(advapi,"(%ld),stub!\n",x1);
434 /******************************************************************************
435 * SynchronizeWindows31FilesAndWindowsNTRegistry [ADVAPI32]
437 BOOL32 WINAPI SynchronizeWindows31FilesAndWindowsNTRegistry(DWORD x1,DWORD x2,DWORD x3,DWORD x4) {
438 FIXME(advapi,"(0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",x1,x2,x3,x4);
442 /******************************************************************************
443 * LsaOpenPolicy [ADVAPI32]
445 BOOL32 WINAPI LsaOpenPolicy(DWORD x1,DWORD x2,DWORD x3,DWORD x4) {
446 FIXME(advapi,"(0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",x1,x2,x3,x4);
447 return 0xc0000000; /* generic error */
450 /******************************************************************************
451 * NotifyBootConfigStatus [ADVAPI32]
453 BOOL32 WINAPI NotifyBootConfigStatus(DWORD x1) {
454 FIXME(advapi,"(0x%08lx),stub!\n",x1);
458 /******************************************************************************
459 * RevertToSelf [ADVAPI32]
461 BOOL32 WINAPI RevertToSelf(void) {
462 FIXME(advapi,"(), stub\n");