[7983] | 1 | /* $Id: security_odin.cpp,v 1.1 2002-02-21 22:52:01 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 | */
|
---|
[21916] | 14 |
|
---|
| 15 | #include <string.h>
|
---|
| 16 |
|
---|
[7983] | 17 | #ifdef __WIN32OS2__
|
---|
| 18 | #include <os2win.h>
|
---|
| 19 | #include <heapstring.h>
|
---|
| 20 | #endif
|
---|
| 21 |
|
---|
| 22 | #include "windef.h"
|
---|
| 23 | #include "winerror.h"
|
---|
| 24 | #include "heap.h"
|
---|
| 25 | #include "ntddk.h"
|
---|
| 26 | #include "ntsecapi.h"
|
---|
| 27 | #include "debugtools.h"
|
---|
| 28 |
|
---|
| 29 | DECLARE_DEBUG_CHANNEL(advapi-security)
|
---|
| 30 |
|
---|
| 31 | static BOOL fInitSecurity = FALSE;
|
---|
| 32 | static BOOL fHasSecurity = FALSE;
|
---|
| 33 |
|
---|
| 34 | 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 |
|
---|
| 70 | /*****************************************************************************
|
---|
| 71 | * Name : AddAce
|
---|
| 72 | * Purpose : The AddAce function adds one or more ACEs to a specified ACL.
|
---|
| 73 | * An ACE is an access-control entry. An ACL is an access-control list.
|
---|
| 74 | * Parameters: PACL pAcl address of access-control list
|
---|
| 75 | * DWORD dwAceRevision ACL revision level
|
---|
| 76 | * DWORD dwStartingAceIndex index of ACE position in ACL
|
---|
| 77 | * LPVOID pAceList address of one or more ACEs
|
---|
| 78 | * DWORD nAceListLength size of buffer for ACEs
|
---|
| 79 | * Variables :
|
---|
| 80 | * Result :
|
---|
| 81 | * Remark :
|
---|
| 82 | * Status : UNTESTED STUB
|
---|
| 83 | *
|
---|
| 84 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
| 85 | *****************************************************************************/
|
---|
| 86 |
|
---|
| 87 | BOOL WIN32API AddAce(PACL pAcl,
|
---|
| 88 | DWORD dwAceRevision,
|
---|
| 89 | DWORD dwStartingAceIndex,
|
---|
| 90 | LPVOID pAceList,
|
---|
| 91 | DWORD nAceListLength)
|
---|
| 92 | {
|
---|
| 93 | CallWin32ToNt (RtlAddAce(pAcl, dwAceRevision, dwStartingAceIndex, (PACE_HEADER)pAceList, nAceListLength));
|
---|
| 94 | }
|
---|
| 95 |
|
---|
| 96 |
|
---|