| 1 | /* $Id: security.cpp,v 1.2 1999-12-19 12:24:52 sandervl Exp $ */
|
|---|
| 2 | /*
|
|---|
| 3 | * Win32 security API functions for OS/2
|
|---|
| 4 | *
|
|---|
| 5 | * Copyright 1998 Sander van Leeuwen (OS/2 Port)
|
|---|
| 6 | *
|
|---|
| 7 | * Based on Wine code (dlls\advapi32\security.c)
|
|---|
| 8 | *
|
|---|
| 9 | * Copyright original Wine author(s) (????)
|
|---|
| 10 | *
|
|---|
| 11 | * dlls/advapi32/security.c
|
|---|
| 12 | * FIXME: for all functions thunking down to Rtl* functions: implement SetLastError()
|
|---|
| 13 | */
|
|---|
| 14 | #ifdef __WIN32OS2__
|
|---|
| 15 | #include <os2win.h>
|
|---|
| 16 | #include <heapstring.h>
|
|---|
| 17 | #endif
|
|---|
| 18 |
|
|---|
| 19 | #include <string.h>
|
|---|
| 20 |
|
|---|
| 21 | #include "windef.h"
|
|---|
| 22 | #include "winerror.h"
|
|---|
| 23 | #include "heap.h"
|
|---|
| 24 | #include "ntddk.h"
|
|---|
| 25 | #include "ntsecapi.h"
|
|---|
| 26 | #include "debugtools.h"
|
|---|
| 27 |
|
|---|
| 28 | DECLARE_DEBUG_CHANNEL(advapi)
|
|---|
| 29 | DECLARE_DEBUG_CHANNEL(security)
|
|---|
| 30 |
|
|---|
| 31 | static BOOL fInitSecurity = FALSE;
|
|---|
| 32 | static BOOL fHasSecurity = FALSE;
|
|---|
| 33 |
|
|---|
| 34 | static BOOL Wine_HasSecurity(void)
|
|---|
| 35 | {
|
|---|
| 36 | //SvL: Let's not check this for every single call please...
|
|---|
| 37 | if(!fInitSecurity)
|
|---|
| 38 | {
|
|---|
| 39 | OSVERSIONINFOA osi;
|
|---|
| 40 | osi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA);
|
|---|
| 41 | GetVersionExA(&osi);
|
|---|
| 42 | if (osi.dwPlatformId == VER_PLATFORM_WIN32_NT) {
|
|---|
| 43 | fHasSecurity = TRUE;
|
|---|
| 44 | }
|
|---|
| 45 | fInitSecurity = TRUE;
|
|---|
| 46 | }
|
|---|
| 47 | if(!fHasSecurity) {
|
|---|
| 48 | SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
|---|
| 49 | return FALSE;
|
|---|
| 50 | }
|
|---|
| 51 | return TRUE;
|
|---|
| 52 | }
|
|---|
| 53 |
|
|---|
| 54 |
|
|---|
| 55 | #define CallWin32ToNt(func) \
|
|---|
| 56 | { NTSTATUS ret; \
|
|---|
| 57 | ret = (func); \
|
|---|
| 58 | if (ret !=STATUS_SUCCESS) \
|
|---|
| 59 | { SetLastError (RtlNtStatusToDosError(ret)); return FALSE; } \
|
|---|
| 60 | return TRUE; \
|
|---|
| 61 | }
|
|---|
| 62 |
|
|---|
| 63 | /* ##############################
|
|---|
| 64 | ###### TOKEN FUNCTIONS ######
|
|---|
| 65 | ##############################
|
|---|
| 66 | */
|
|---|
| 67 |
|
|---|
| 68 | /******************************************************************************
|
|---|
| 69 | * OpenProcessToken [ADVAPI32.109]
|
|---|
| 70 | * Opens the access token associated with a process
|
|---|
| 71 | *
|
|---|
| 72 | * PARAMS
|
|---|
| 73 | * ProcessHandle [I] Handle to process
|
|---|
| 74 | * DesiredAccess [I] Desired access to process
|
|---|
| 75 | * TokenHandle [O] Pointer to handle of open access token
|
|---|
| 76 | *
|
|---|
| 77 | * RETURNS STD
|
|---|
| 78 | */
|
|---|
| 79 | BOOL WINAPI
|
|---|
| 80 | OpenProcessToken( HANDLE ProcessHandle, DWORD DesiredAccess,
|
|---|
| 81 | HANDLE *TokenHandle )
|
|---|
| 82 | {
|
|---|
| 83 | if (!Wine_HasSecurity()) return FALSE;
|
|---|
| 84 | CallWin32ToNt(NtOpenProcessToken( ProcessHandle, DesiredAccess, TokenHandle ));
|
|---|
| 85 | }
|
|---|
| 86 |
|
|---|
| 87 | /******************************************************************************
|
|---|
| 88 | * OpenThreadToken [ADVAPI32.114]
|
|---|
| 89 | *
|
|---|
| 90 | * PARAMS
|
|---|
| 91 | * thread []
|
|---|
| 92 | * desiredaccess []
|
|---|
| 93 | * openasself []
|
|---|
| 94 | * thandle []
|
|---|
| 95 | */
|
|---|
| 96 | BOOL WINAPI
|
|---|
| 97 | OpenThreadToken( HANDLE ThreadHandle, DWORD DesiredAccess,
|
|---|
| 98 | BOOL OpenAsSelf, HANDLE *TokenHandle)
|
|---|
| 99 | {
|
|---|
| 100 | if (!Wine_HasSecurity()) return FALSE;
|
|---|
| 101 | CallWin32ToNt (NtOpenThreadToken(ThreadHandle, DesiredAccess, OpenAsSelf, TokenHandle));
|
|---|
| 102 | }
|
|---|
| 103 |
|
|---|
| 104 | /******************************************************************************
|
|---|
| 105 | * AdjustTokenPrivileges [ADVAPI32.10]
|
|---|
| 106 | *
|
|---|
| 107 | * PARAMS
|
|---|
| 108 | * TokenHandle []
|
|---|
| 109 | * DisableAllPrivileges []
|
|---|
| 110 | * NewState []
|
|---|
| 111 | * BufferLength []
|
|---|
| 112 | * PreviousState []
|
|---|
| 113 | * ReturnLength []
|
|---|
| 114 | */
|
|---|
| 115 | BOOL WINAPI
|
|---|
| 116 | AdjustTokenPrivileges( HANDLE TokenHandle, BOOL DisableAllPrivileges,
|
|---|
| 117 | PTOKEN_PRIVILEGES NewState, DWORD BufferLength,
|
|---|
| 118 | PTOKEN_PRIVILEGES PreviousState, LPDWORD ReturnLength )
|
|---|
| 119 | {
|
|---|
| 120 | CallWin32ToNt(NtAdjustPrivilegesToken(TokenHandle, DisableAllPrivileges, NewState, BufferLength, PreviousState, ReturnLength));
|
|---|
| 121 | }
|
|---|
| 122 |
|
|---|
| 123 | /******************************************************************************
|
|---|
| 124 | * GetTokenInformation [ADVAPI32.66]
|
|---|
| 125 | *
|
|---|
| 126 | * PARAMS
|
|---|
| 127 | * token []
|
|---|
| 128 | * tokeninfoclass []
|
|---|
| 129 | * tokeninfo []
|
|---|
| 130 | * tokeninfolength []
|
|---|
| 131 | * retlen []
|
|---|
| 132 | *
|
|---|
| 133 | */
|
|---|
| 134 | BOOL WINAPI
|
|---|
| 135 | GetTokenInformation( HANDLE token, TOKEN_INFORMATION_CLASS tokeninfoclass,
|
|---|
| 136 | LPVOID tokeninfo, DWORD tokeninfolength, LPDWORD retlen )
|
|---|
| 137 | {
|
|---|
| 138 | CallWin32ToNt (NtQueryInformationToken( token, tokeninfoclass, tokeninfo, tokeninfolength, retlen));
|
|---|
| 139 | }
|
|---|
| 140 |
|
|---|
| 141 | /* ##############################
|
|---|
| 142 | ###### SID FUNCTIONS ######
|
|---|
| 143 | ##############################
|
|---|
| 144 | */
|
|---|
| 145 |
|
|---|
| 146 | /******************************************************************************
|
|---|
| 147 | * CopySid [ADVAPI32.24]
|
|---|
| 148 | *
|
|---|
| 149 | * PARAMS
|
|---|
| 150 | * nDestinationSidLength []
|
|---|
| 151 | * pDestinationSid []
|
|---|
| 152 | * pSourceSid []
|
|---|
| 153 | */
|
|---|
| 154 | BOOL WINAPI
|
|---|
| 155 | CopySid( DWORD nDestinationSidLength, PSID pDestinationSid, PSID pSourceSid )
|
|---|
| 156 | {
|
|---|
| 157 | CallWin32ToNt (RtlCopySid( nDestinationSidLength, pDestinationSid, pSourceSid));
|
|---|
| 158 | }
|
|---|
| 159 |
|
|---|
| 160 | /******************************************************************************
|
|---|
| 161 | * IsValidSid [ADVAPI32.80]
|
|---|
| 162 | *
|
|---|
| 163 | * PARAMS
|
|---|
| 164 | * pSid []
|
|---|
| 165 | */
|
|---|
| 166 | BOOL WINAPI
|
|---|
| 167 | IsValidSid( PSID pSid )
|
|---|
| 168 | {
|
|---|
| 169 | CallWin32ToNt (RtlValidSid( pSid));
|
|---|
| 170 | }
|
|---|
| 171 |
|
|---|
| 172 | /******************************************************************************
|
|---|
| 173 | * EqualSid [ADVAPI32.40]
|
|---|
| 174 | *
|
|---|
| 175 | * PARAMS
|
|---|
| 176 | * pSid1 []
|
|---|
| 177 | * pSid2 []
|
|---|
| 178 | */
|
|---|
| 179 | BOOL WINAPI
|
|---|
| 180 | EqualSid( PSID pSid1, PSID pSid2 )
|
|---|
| 181 | {
|
|---|
| 182 | CallWin32ToNt (RtlEqualSid( pSid1, pSid2));
|
|---|
| 183 | }
|
|---|
| 184 |
|
|---|
| 185 | /******************************************************************************
|
|---|
| 186 | * EqualPrefixSid [ADVAPI32.39]
|
|---|
| 187 | */
|
|---|
| 188 | BOOL WINAPI EqualPrefixSid (PSID pSid1, PSID pSid2)
|
|---|
| 189 | {
|
|---|
| 190 | CallWin32ToNt (RtlEqualPrefixSid( pSid1, pSid2));
|
|---|
| 191 | }
|
|---|
| 192 |
|
|---|
| 193 | /******************************************************************************
|
|---|
| 194 | * InitializeSid [ADVAPI32.74]
|
|---|
| 195 | *
|
|---|
| 196 | * PARAMS
|
|---|
| 197 | * pIdentifierAuthority []
|
|---|
| 198 | */
|
|---|
| 199 | BOOL WINAPI
|
|---|
| 200 | InitializeSid (PSID pSid, PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
|
|---|
| 201 | BYTE nSubAuthorityCount)
|
|---|
| 202 | {
|
|---|
| 203 | CallWin32ToNt (RtlInitializeSid( pSid, pIdentifierAuthority, nSubAuthorityCount));
|
|---|
| 204 | }
|
|---|
| 205 |
|
|---|
| 206 | /* ##############################################
|
|---|
| 207 | ###### SECURITY DESCRIPTOR FUNCTIONS ######
|
|---|
| 208 | ##############################################
|
|---|
| 209 | */
|
|---|
| 210 |
|
|---|
| 211 | /******************************************************************************
|
|---|
| 212 | * InitializeSecurityDescriptor [ADVAPI32.73]
|
|---|
| 213 | *
|
|---|
| 214 | * PARAMS
|
|---|
| 215 | * pDescr []
|
|---|
| 216 | * revision []
|
|---|
| 217 | */
|
|---|
| 218 | BOOL WINAPI
|
|---|
| 219 | InitializeSecurityDescriptor( SECURITY_DESCRIPTOR *pDescr, DWORD revision )
|
|---|
| 220 | {
|
|---|
| 221 | CallWin32ToNt (RtlCreateSecurityDescriptor(pDescr, revision ));
|
|---|
| 222 | }
|
|---|
| 223 |
|
|---|
| 224 | /******************************************************************************
|
|---|
| 225 | * GetSecurityDescriptorLength [ADVAPI32.55]
|
|---|
| 226 | */
|
|---|
| 227 | DWORD WINAPI GetSecurityDescriptorLength( SECURITY_DESCRIPTOR *pDescr)
|
|---|
| 228 | {
|
|---|
| 229 | return (RtlLengthSecurityDescriptor(pDescr));
|
|---|
| 230 | }
|
|---|
| 231 |
|
|---|
| 232 | /******************************************************************************
|
|---|
| 233 | * GetSecurityDescriptorOwner [ADVAPI32.56]
|
|---|
| 234 | *
|
|---|
| 235 | * PARAMS
|
|---|
| 236 | * pOwner []
|
|---|
| 237 | * lpbOwnerDefaulted []
|
|---|
| 238 | */
|
|---|
| 239 | BOOL WINAPI
|
|---|
| 240 | GetSecurityDescriptorOwner( SECURITY_DESCRIPTOR *pDescr, PSID *pOwner,
|
|---|
| 241 | LPBOOL lpbOwnerDefaulted )
|
|---|
| 242 | {
|
|---|
| 243 | CallWin32ToNt (RtlGetOwnerSecurityDescriptor( pDescr, pOwner, (PBOOLEAN)lpbOwnerDefaulted ));
|
|---|
| 244 | }
|
|---|
| 245 |
|
|---|
| 246 | /******************************************************************************
|
|---|
| 247 | * SetSecurityDescriptorOwner [ADVAPI32]
|
|---|
| 248 | *
|
|---|
| 249 | * PARAMS
|
|---|
| 250 | */
|
|---|
| 251 | BOOL WINAPI SetSecurityDescriptorOwner( PSECURITY_DESCRIPTOR pSecurityDescriptor,
|
|---|
| 252 | PSID pOwner, BOOL bOwnerDefaulted)
|
|---|
| 253 | {
|
|---|
| 254 | CallWin32ToNt (RtlSetOwnerSecurityDescriptor(pSecurityDescriptor, pOwner, bOwnerDefaulted));
|
|---|
| 255 | }
|
|---|
| 256 | /******************************************************************************
|
|---|
| 257 | * GetSecurityDescriptorGroup [ADVAPI32.54]
|
|---|
| 258 | */
|
|---|
| 259 | BOOL WINAPI GetSecurityDescriptorGroup(
|
|---|
| 260 | PSECURITY_DESCRIPTOR SecurityDescriptor,
|
|---|
| 261 | PSID *Group,
|
|---|
| 262 | LPBOOL GroupDefaulted)
|
|---|
| 263 | {
|
|---|
| 264 | CallWin32ToNt (RtlGetGroupSecurityDescriptor(SecurityDescriptor, Group, (PBOOLEAN)GroupDefaulted));
|
|---|
| 265 | }
|
|---|
| 266 | /******************************************************************************
|
|---|
| 267 | * SetSecurityDescriptorGroup
|
|---|
| 268 | */
|
|---|
| 269 | BOOL WINAPI SetSecurityDescriptorGroup ( PSECURITY_DESCRIPTOR SecurityDescriptor,
|
|---|
| 270 | PSID Group, BOOL GroupDefaulted)
|
|---|
| 271 | {
|
|---|
| 272 | CallWin32ToNt (RtlSetGroupSecurityDescriptor( SecurityDescriptor, Group, GroupDefaulted));
|
|---|
| 273 | }
|
|---|
| 274 |
|
|---|
| 275 | /******************************************************************************
|
|---|
| 276 | * IsValidSecurityDescriptor [ADVAPI32.79]
|
|---|
| 277 | *
|
|---|
| 278 | * PARAMS
|
|---|
| 279 | * lpsecdesc []
|
|---|
| 280 | */
|
|---|
| 281 | BOOL WINAPI
|
|---|
| 282 | IsValidSecurityDescriptor( PSECURITY_DESCRIPTOR SecurityDescriptor )
|
|---|
| 283 | {
|
|---|
| 284 | CallWin32ToNt (RtlValidSecurityDescriptor(SecurityDescriptor));
|
|---|
| 285 | }
|
|---|
| 286 |
|
|---|
| 287 | /******************************************************************************
|
|---|
| 288 | * GetSecurityDescriptorDacl [ADVAPI.91]
|
|---|
| 289 | */
|
|---|
| 290 | BOOL WINAPI GetSecurityDescriptorDacl(
|
|---|
| 291 | IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
|
|---|
| 292 | OUT LPBOOL lpbDaclPresent,
|
|---|
| 293 | OUT PACL *pDacl,
|
|---|
| 294 | OUT LPBOOL lpbDaclDefaulted)
|
|---|
| 295 | {
|
|---|
| 296 | CallWin32ToNt (RtlGetDaclSecurityDescriptor(pSecurityDescriptor, (PBOOLEAN)lpbDaclPresent,
|
|---|
| 297 | pDacl, (PBOOLEAN)lpbDaclDefaulted));
|
|---|
| 298 | }
|
|---|
| 299 |
|
|---|
| 300 | /******************************************************************************
|
|---|
| 301 | * SetSecurityDescriptorDacl [ADVAPI.224]
|
|---|
| 302 | */
|
|---|
| 303 | BOOL WINAPI
|
|---|
| 304 | SetSecurityDescriptorDacl (
|
|---|
| 305 | PSECURITY_DESCRIPTOR lpsd,
|
|---|
| 306 | BOOL daclpresent,
|
|---|
| 307 | PACL dacl,
|
|---|
| 308 | BOOL dacldefaulted )
|
|---|
| 309 | {
|
|---|
| 310 | CallWin32ToNt (RtlSetDaclSecurityDescriptor (lpsd, daclpresent, dacl, dacldefaulted ));
|
|---|
| 311 | }
|
|---|
| 312 | /******************************************************************************
|
|---|
| 313 | * GetSecurityDescriptorSacl [ADVAPI.]
|
|---|
| 314 | */
|
|---|
| 315 | BOOL WINAPI GetSecurityDescriptorSacl(
|
|---|
| 316 | IN PSECURITY_DESCRIPTOR lpsd,
|
|---|
| 317 | OUT LPBOOL lpbSaclPresent,
|
|---|
| 318 | OUT PACL *pSacl,
|
|---|
| 319 | OUT LPBOOL lpbSaclDefaulted)
|
|---|
| 320 | {
|
|---|
| 321 | CallWin32ToNt (RtlGetSaclSecurityDescriptor(lpsd, (PBOOLEAN)lpbSaclPresent,
|
|---|
| 322 | pSacl, (PBOOLEAN)lpbSaclDefaulted));
|
|---|
| 323 | }
|
|---|
| 324 |
|
|---|
| 325 | /**************************************************************************
|
|---|
| 326 | * SetSecurityDescriptorSacl [NTDLL.488]
|
|---|
| 327 | */
|
|---|
| 328 | BOOL WINAPI SetSecurityDescriptorSacl (
|
|---|
| 329 | PSECURITY_DESCRIPTOR lpsd,
|
|---|
| 330 | BOOL saclpresent,
|
|---|
| 331 | PACL lpsacl,
|
|---|
| 332 | BOOL sacldefaulted)
|
|---|
| 333 | {
|
|---|
| 334 | CallWin32ToNt (RtlSetSaclSecurityDescriptor(lpsd, saclpresent, lpsacl, sacldefaulted));
|
|---|
| 335 | }
|
|---|
| 336 | /******************************************************************************
|
|---|
| 337 | * MakeSelfRelativeSD [ADVAPI32.95]
|
|---|
| 338 | *
|
|---|
| 339 | * PARAMS
|
|---|
| 340 | * lpabssecdesc []
|
|---|
| 341 | * lpselfsecdesc []
|
|---|
| 342 | * lpbuflen []
|
|---|
| 343 | */
|
|---|
| 344 | BOOL WINAPI
|
|---|
| 345 | MakeSelfRelativeSD( PSECURITY_DESCRIPTOR lpabssecdesc,
|
|---|
| 346 | PSECURITY_DESCRIPTOR lpselfsecdesc, LPDWORD lpbuflen )
|
|---|
| 347 | {
|
|---|
| 348 | FIXME_(advapi)("(%p,%p,%p),stub!\n",lpabssecdesc,lpselfsecdesc,lpbuflen);
|
|---|
| 349 | return TRUE;
|
|---|
| 350 | }
|
|---|
| 351 |
|
|---|
| 352 | /******************************************************************************
|
|---|
| 353 | * GetSecurityDescriptorControl32 [ADVAPI32]
|
|---|
| 354 | */
|
|---|
| 355 |
|
|---|
| 356 | BOOL WINAPI GetSecurityDescriptorControl ( PSECURITY_DESCRIPTOR pSecurityDescriptor,
|
|---|
| 357 | PSECURITY_DESCRIPTOR_CONTROL pControl, LPDWORD lpdwRevision)
|
|---|
| 358 | { FIXME_(advapi)("(%p,%p,%p),stub!\n",pSecurityDescriptor,pControl,lpdwRevision);
|
|---|
| 359 | return 1;
|
|---|
| 360 | }
|
|---|
| 361 |
|
|---|
| 362 | /* ##############################
|
|---|
| 363 | ###### MISC FUNCTIONS ######
|
|---|
| 364 | ##############################
|
|---|
| 365 | */
|
|---|
| 366 |
|
|---|
| 367 | /******************************************************************************
|
|---|
| 368 | * LookupPrivilegeValue32W [ADVAPI32.93]
|
|---|
| 369 | * Retrieves LUID used on a system to represent the privilege name.
|
|---|
| 370 | *
|
|---|
| 371 | * NOTES
|
|---|
| 372 | * lpLuid should be PLUID
|
|---|
| 373 | *
|
|---|
| 374 | * PARAMS
|
|---|
| 375 | * lpSystemName [I] Address of string specifying the system
|
|---|
| 376 | * lpName [I] Address of string specifying the privilege
|
|---|
| 377 | * lpLuid [I] Address of locally unique identifier
|
|---|
| 378 | *
|
|---|
| 379 | * RETURNS STD
|
|---|
| 380 | */
|
|---|
| 381 | BOOL WINAPI
|
|---|
| 382 | LookupPrivilegeValueW( LPCWSTR lpSystemName, LPCWSTR lpName, LPVOID lpLuid )
|
|---|
| 383 | {
|
|---|
| 384 | FIXME_(advapi)("(%s,%s,%p): stub\n",debugstr_w(lpSystemName),
|
|---|
| 385 | debugstr_w(lpName), lpLuid);
|
|---|
| 386 | return TRUE;
|
|---|
| 387 | }
|
|---|
| 388 |
|
|---|
| 389 | /******************************************************************************
|
|---|
| 390 | * LookupPrivilegeValue32A [ADVAPI32.92]
|
|---|
| 391 | */
|
|---|
| 392 | BOOL WINAPI
|
|---|
| 393 | LookupPrivilegeValueA( LPCSTR lpSystemName, LPCSTR lpName, LPVOID lpLuid )
|
|---|
| 394 | {
|
|---|
| 395 | LPWSTR lpSystemNameW = HEAP_strdupAtoW(GetProcessHeap(), 0, lpSystemName);
|
|---|
| 396 | LPWSTR lpNameW = HEAP_strdupAtoW(GetProcessHeap(), 0, lpName);
|
|---|
| 397 | BOOL ret = LookupPrivilegeValueW( lpSystemNameW, lpNameW, lpLuid);
|
|---|
| 398 | HeapFree(GetProcessHeap(), 0, lpNameW);
|
|---|
| 399 | HeapFree(GetProcessHeap(), 0, lpSystemNameW);
|
|---|
| 400 | return ret;
|
|---|
| 401 | }
|
|---|
| 402 |
|
|---|
| 403 | /******************************************************************************
|
|---|
| 404 | * GetFileSecurity32A [ADVAPI32.45]
|
|---|
| 405 | *
|
|---|
| 406 | * Obtains Specified information about the security of a file or directory
|
|---|
| 407 | * The information obtained is constrained by the callers access rights and
|
|---|
| 408 | * privileges
|
|---|
| 409 | */
|
|---|
| 410 | BOOL WINAPI
|
|---|
| 411 | GetFileSecurityA( LPCSTR lpFileName,
|
|---|
| 412 | SECURITY_INFORMATION RequestedInformation,
|
|---|
| 413 | PSECURITY_DESCRIPTOR pSecurityDescriptor,
|
|---|
| 414 | DWORD nLength, LPDWORD lpnLengthNeeded )
|
|---|
| 415 | {
|
|---|
| 416 | FIXME_(advapi)("(%s) : stub\n", debugstr_a(lpFileName));
|
|---|
| 417 | return TRUE;
|
|---|
| 418 | }
|
|---|
| 419 |
|
|---|
| 420 | /******************************************************************************
|
|---|
| 421 | * GetFileSecurity32W [ADVAPI32.46]
|
|---|
| 422 | *
|
|---|
| 423 | * Obtains Specified information about the security of a file or directory
|
|---|
| 424 | * The information obtained is constrained by the callers access rights and
|
|---|
| 425 | * privileges
|
|---|
| 426 | *
|
|---|
| 427 | * PARAMS
|
|---|
| 428 | * lpFileName []
|
|---|
| 429 | * RequestedInformation []
|
|---|
| 430 | * pSecurityDescriptor []
|
|---|
| 431 | * nLength []
|
|---|
| 432 | * lpnLengthNeeded []
|
|---|
| 433 | */
|
|---|
| 434 | BOOL WINAPI
|
|---|
| 435 | GetFileSecurityW( LPCWSTR lpFileName,
|
|---|
| 436 | SECURITY_INFORMATION RequestedInformation,
|
|---|
| 437 | PSECURITY_DESCRIPTOR pSecurityDescriptor,
|
|---|
| 438 | DWORD nLength, LPDWORD lpnLengthNeeded )
|
|---|
| 439 | {
|
|---|
| 440 | FIXME_(advapi)("(%s) : stub\n", debugstr_w(lpFileName) );
|
|---|
| 441 | return TRUE;
|
|---|
| 442 | }
|
|---|
| 443 |
|
|---|
| 444 |
|
|---|
| 445 | /******************************************************************************
|
|---|
| 446 | * LookupAccountSid32A [ADVAPI32.86]
|
|---|
| 447 | */
|
|---|
| 448 | BOOL WINAPI
|
|---|
| 449 | LookupAccountSidA( LPCSTR system, PSID sid, LPCSTR account,
|
|---|
| 450 | LPDWORD accountSize, LPCSTR domain, LPDWORD domainSize,
|
|---|
| 451 | PSID_NAME_USE name_use )
|
|---|
| 452 | {
|
|---|
| 453 | FIXME_(security)("(%s,%p,%p,%p,%p,%p,%p): stub\n",
|
|---|
| 454 | system,sid,account,accountSize,domain,domainSize,name_use);
|
|---|
| 455 | SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
|---|
| 456 | return FALSE;
|
|---|
| 457 | }
|
|---|
| 458 |
|
|---|
| 459 | /******************************************************************************
|
|---|
| 460 | * LookupAccountSid32W [ADVAPI32.87]
|
|---|
| 461 | *
|
|---|
| 462 | * PARAMS
|
|---|
| 463 | * system []
|
|---|
| 464 | * sid []
|
|---|
| 465 | * account []
|
|---|
| 466 | * accountSize []
|
|---|
| 467 | * domain []
|
|---|
| 468 | * domainSize []
|
|---|
| 469 | * name_use []
|
|---|
| 470 | */
|
|---|
| 471 | BOOL WINAPI
|
|---|
| 472 | LookupAccountSidW( LPCWSTR system, PSID sid, LPCWSTR account,
|
|---|
| 473 | LPDWORD accountSize, LPCWSTR domain, LPDWORD domainSize,
|
|---|
| 474 | PSID_NAME_USE name_use )
|
|---|
| 475 | {
|
|---|
| 476 | FIXME_(security)("(%p,%p,%p,%p,%p,%p,%p): stub\n",
|
|---|
| 477 | system,sid,account,accountSize,domain,domainSize,name_use);
|
|---|
| 478 | SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
|---|
| 479 | return FALSE;
|
|---|
| 480 | }
|
|---|
| 481 |
|
|---|
| 482 | /******************************************************************************
|
|---|
| 483 | * SetFileSecurity32A [ADVAPI32.182]
|
|---|
| 484 | * Sets the security of a file or directory
|
|---|
| 485 | */
|
|---|
| 486 | BOOL WINAPI SetFileSecurityA( LPCSTR lpFileName,
|
|---|
| 487 | SECURITY_INFORMATION RequestedInformation,
|
|---|
| 488 | PSECURITY_DESCRIPTOR pSecurityDescriptor)
|
|---|
| 489 | {
|
|---|
| 490 | FIXME_(advapi)("(%s) : stub\n", debugstr_a(lpFileName));
|
|---|
| 491 | return TRUE;
|
|---|
| 492 | }
|
|---|
| 493 |
|
|---|
| 494 | /******************************************************************************
|
|---|
| 495 | * SetFileSecurity32W [ADVAPI32.183]
|
|---|
| 496 | * Sets the security of a file or directory
|
|---|
| 497 | *
|
|---|
| 498 | * PARAMS
|
|---|
| 499 | * lpFileName []
|
|---|
| 500 | * RequestedInformation []
|
|---|
| 501 | * pSecurityDescriptor []
|
|---|
| 502 | */
|
|---|
| 503 | BOOL WINAPI
|
|---|
| 504 | SetFileSecurityW( LPCWSTR lpFileName,
|
|---|
| 505 | SECURITY_INFORMATION RequestedInformation,
|
|---|
| 506 | PSECURITY_DESCRIPTOR pSecurityDescriptor )
|
|---|
| 507 | {
|
|---|
| 508 | FIXME_(advapi)("(%s) : stub\n", debugstr_w(lpFileName) );
|
|---|
| 509 | return TRUE;
|
|---|
| 510 | }
|
|---|
| 511 |
|
|---|
| 512 | /******************************************************************************
|
|---|
| 513 | * QueryWindows31FilesMigration [ADVAPI32.266]
|
|---|
| 514 | *
|
|---|
| 515 | * PARAMS
|
|---|
| 516 | * x1 []
|
|---|
| 517 | */
|
|---|
| 518 | BOOL WINAPI
|
|---|
| 519 | QueryWindows31FilesMigration( DWORD x1 )
|
|---|
| 520 | {
|
|---|
| 521 | FIXME_(advapi)("(%ld):stub\n",x1);
|
|---|
| 522 | return TRUE;
|
|---|
| 523 | }
|
|---|
| 524 |
|
|---|
| 525 | /******************************************************************************
|
|---|
| 526 | * SynchronizeWindows31FilesAndWindowsNTRegistry [ADVAPI32.265]
|
|---|
| 527 | *
|
|---|
| 528 | * PARAMS
|
|---|
| 529 | * x1 []
|
|---|
| 530 | * x2 []
|
|---|
| 531 | * x3 []
|
|---|
| 532 | * x4 []
|
|---|
| 533 | */
|
|---|
| 534 | BOOL WINAPI
|
|---|
| 535 | SynchronizeWindows31FilesAndWindowsNTRegistry( DWORD x1, DWORD x2, DWORD x3,
|
|---|
| 536 | DWORD x4 )
|
|---|
| 537 | {
|
|---|
| 538 | FIXME_(advapi)("(0x%08lx,0x%08lx,0x%08lx,0x%08lx):stub\n",x1,x2,x3,x4);
|
|---|
| 539 | return TRUE;
|
|---|
| 540 | }
|
|---|
| 541 |
|
|---|
| 542 | /******************************************************************************
|
|---|
| 543 | * LsaOpenPolicy [ADVAPI32.200]
|
|---|
| 544 | *
|
|---|
| 545 | * PARAMS
|
|---|
| 546 | * x1 []
|
|---|
| 547 | * x2 []
|
|---|
| 548 | * x3 []
|
|---|
| 549 | * x4 []
|
|---|
| 550 | */
|
|---|
| 551 | NTSTATUS WINAPI
|
|---|
| 552 | LsaOpenPolicy(PLSA_UNICODE_STRING SystemName,
|
|---|
| 553 | PLSA_OBJECT_ATTRIBUTES ObjectAttributes,
|
|---|
| 554 | ACCESS_MASK DesiredAccess,
|
|---|
| 555 | PLSA_HANDLE PolicyHandle)
|
|---|
| 556 | {
|
|---|
| 557 | FIXME_(advapi)("(%p,%p,0x%08lx,%p):stub\n",
|
|---|
| 558 | SystemName, ObjectAttributes,
|
|---|
| 559 | DesiredAccess, PolicyHandle);
|
|---|
| 560 | return 0xc0000000; /* generic error */
|
|---|
| 561 | }
|
|---|
| 562 |
|
|---|
| 563 | /******************************************************************************
|
|---|
| 564 | * NotifyBootConfigStatus [ADVAPI32.97]
|
|---|
| 565 | *
|
|---|
| 566 | * PARAMS
|
|---|
| 567 | * x1 []
|
|---|
| 568 | */
|
|---|
| 569 | BOOL WINAPI
|
|---|
| 570 | NotifyBootConfigStatus( DWORD x1 )
|
|---|
| 571 | {
|
|---|
| 572 | FIXME_(advapi)("(0x%08lx):stub\n",x1);
|
|---|
| 573 | return 1;
|
|---|
| 574 | }
|
|---|
| 575 |
|
|---|
| 576 | /******************************************************************************
|
|---|
| 577 | * RevertToSelf [ADVAPI32.180]
|
|---|
| 578 | *
|
|---|
| 579 | * PARAMS
|
|---|
| 580 | * void []
|
|---|
| 581 | */
|
|---|
| 582 | BOOL WINAPI
|
|---|
| 583 | RevertToSelf( void )
|
|---|
| 584 | {
|
|---|
| 585 | FIXME_(advapi)("(), stub\n");
|
|---|
| 586 | return TRUE;
|
|---|
| 587 | }
|
|---|
| 588 |
|
|---|
| 589 | /******************************************************************************
|
|---|
| 590 | * ImpersonateSelf [ADVAPI32.71]
|
|---|
| 591 | */
|
|---|
| 592 | BOOL WINAPI
|
|---|
| 593 | ImpersonateSelf(SECURITY_IMPERSONATION_LEVEL ImpersonationLevel)
|
|---|
| 594 | {
|
|---|
| 595 | FIXME_(advapi)("(%08x), stub\n", ImpersonationLevel);
|
|---|
| 596 | return TRUE;
|
|---|
| 597 | }
|
|---|
| 598 |
|
|---|
| 599 | /******************************************************************************
|
|---|
| 600 | * AccessCheck32 [ADVAPI32.71]
|
|---|
| 601 | */
|
|---|
| 602 | BOOL WINAPI
|
|---|
| 603 | AccessCheck(PSECURITY_DESCRIPTOR pSecurityDescriptor, HANDLE ClientToken,
|
|---|
| 604 | DWORD DesiredAccess, PGENERIC_MAPPING GenericMapping, PPRIVILEGE_SET PrivilegeSet,
|
|---|
| 605 | LPDWORD PrivilegeSetLength, LPDWORD GrantedAccess, LPBOOL AccessStatus)
|
|---|
| 606 | {
|
|---|
| 607 | FIXME_(advapi)("(%p, %04x, %08lx, %p, %p, %p, %p, %p), stub\n",
|
|---|
| 608 | pSecurityDescriptor, ClientToken, DesiredAccess, GenericMapping,
|
|---|
| 609 | PrivilegeSet, PrivilegeSetLength, GrantedAccess, AccessStatus);
|
|---|
| 610 | *AccessStatus = TRUE;
|
|---|
| 611 | return TRUE;
|
|---|
| 612 | }
|
|---|
| 613 |
|
|---|
| 614 | /*************************************************************************
|
|---|
| 615 | * SetThreadToken [ADVAPI32.231]
|
|---|
| 616 | *
|
|---|
| 617 | * Assigns an "impersonation token" to a thread so it can assume the
|
|---|
| 618 | * security privledges of another thread or process. Can also remove
|
|---|
| 619 | * a previously assigned token. Only supported on NT - it's a stub
|
|---|
| 620 | * exactly like this one on Win9X.
|
|---|
| 621 | *
|
|---|
| 622 | */
|
|---|
| 623 |
|
|---|
| 624 | BOOL WINAPI SetThreadToken(PHANDLE thread, HANDLE token)
|
|---|
| 625 | {
|
|---|
| 626 | FIXME_(advapi)("(%p, %x): stub\n", thread, token);
|
|---|
| 627 |
|
|---|
| 628 | SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
|---|
| 629 |
|
|---|
| 630 | return FALSE;
|
|---|
| 631 | }
|
|---|
| 632 |
|
|---|
| 633 |
|
|---|
| 634 |
|
|---|
| 635 |
|
|---|