Ignore:
Timestamp:
Dec 18, 1999, 9:01:14 PM (26 years ago)
Author:
sandervl
Message:

Partially implemented some Token & SID apis

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/NTDLL/sec.cpp

    r278 r2122  
    1 /* $Id: sec.cpp,v 1.3 1999-07-06 15:48:45 phaller Exp $ */
     1/* $Id: sec.cpp,v 1.4 1999-12-18 20:01:14 sandervl Exp $ */
    22
    33/*
     
    4444 *
    4545 */
    46 BOOLEAN WINAPI RtlAllocateAndInitializeSid (PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
    47                                             DWORD                    nSubAuthorityCount,
    48                                             DWORD                     x3,
    49                                             DWORD                     x4,
    50                                             DWORD                     x5,
    51                                             DWORD                     x6,
    52                                             DWORD                     x7,
    53                                             DWORD                     x8,
    54                                             DWORD                     x9,
    55                                             DWORD                     x10,
    56                                             PSID                      pSid)
     46BOOLEAN WINAPI RtlAllocateAndInitializeSid ( PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
     47                                             BYTE nSubAuthorityCount,
     48                                             DWORD nSubAuthority0,
     49                                             DWORD nSubAuthority1,
     50                                             DWORD nSubAuthority2,
     51                                             DWORD nSubAuthority3,
     52                                             DWORD nSubAuthority4,
     53                                             DWORD nSubAuthority5,
     54                                             DWORD nSubAuthority6,
     55                                             DWORD nSubAuthority7,
     56                                             PSID *pSid)
    5757{
    5858  dprintf(("NTDLL: RtlAllocateAndInitializeSid(%08xh,%08xh,%08xh,"
     
    6060           pIdentifierAuthority,
    6161           nSubAuthorityCount,
    62            x3,
    63            x4,
    64            x5,
    65            x6,
    66            x7,
    67            x8,
    68            x9,
    69            x10,
     62           nSubAuthority0,
     63           nSubAuthority1,
     64           nSubAuthority2,
     65           nSubAuthority3,
     66           nSubAuthority4,
     67           nSubAuthority5,
     68           nSubAuthority6,
     69           nSubAuthority7,
    7070           pSid));
    7171
    72   return 0;
     72  *pSid = (PSID)Heap_Alloc(sizeof(SID)+nSubAuthorityCount*sizeof(DWORD));
     73  if(*pSid == NULL) {
     74        SetLastError(ERROR_NOT_ENOUGH_MEMORY);
     75        return FALSE;
     76  }
     77  (*pSid)->Revision          = SID_REVISION;
     78  (*pSid)->SubAuthorityCount = nSubAuthorityCount;
     79  (*pSid)->SubAuthority[0]   = nSubAuthority0;
     80  (*pSid)->SubAuthority[1]   = nSubAuthority1;
     81  (*pSid)->SubAuthority[2]   = nSubAuthority2;
     82  (*pSid)->SubAuthority[3]   = nSubAuthority3;
     83  (*pSid)->SubAuthority[4]   = nSubAuthority4;
     84  (*pSid)->SubAuthority[5]   = nSubAuthority5;
     85  (*pSid)->SubAuthority[6]   = nSubAuthority6;
     86  (*pSid)->SubAuthority[7]   = nSubAuthority7;
     87  memcpy((PVOID)&(*pSid)->IdentifierAuthority, (PVOID)pIdentifierAuthority, sizeof(SID_IDENTIFIER_AUTHORITY));
     88  return TRUE;
    7389}
    7490
     
    7894 *
    7995 */
    80 DWORD WINAPI RtlEqualSid(DWORD x1,
    81                          DWORD x2)
     96BOOL WINAPI RtlEqualSid(PSID pSid1, PSID pSid2)
    8297{
    8398  dprintf(("NTDLL: RtlEqualSid(%08x, %08x) not implemented.\n",
    84            x1,
    85            x2));
     99           pSid1,
     100           pSid2));
    86101
    87102  return TRUE;
     
    92107 *  RtlFreeSid    [NTDLL.376]
    93108 */
    94 DWORD WINAPI RtlFreeSid(DWORD x1)
     109VOID* WINAPI RtlFreeSid(PSID pSid)
    95110{
    96111  dprintf(("NTDLL: RtlFreeSid(%08xh) not implemented.\n",
    97            x1));
    98 
    99   return TRUE;
     112           pSid));
     113
     114  Heap_Free(pSid);
     115  return (VOID*)TRUE; //??????
    100116}
    101117
Note: See TracChangeset for help on using the changeset viewer.