Ignore:
Timestamp:
May 22, 2000, 9:08:01 PM (25 years ago)
Author:
sandervl
Message:

GetFileTime bugfix + FindResource(Ex)A/W changes + setup thread security objects during creation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/wprocess.cpp

    r3483 r3588  
    1 /* $Id: wprocess.cpp,v 1.80 2000-05-02 20:53:15 sandervl Exp $ */
     1/* $Id: wprocess.cpp,v 1.81 2000-05-22 19:08:01 sandervl Exp $ */
    22
    33/*
     
    6262static THDB     *threadList = 0;
    6363static VMutex    threadListMutex;
     64
     65//TODO: This should not be here: (need to rearrange NTDLL; kernel32 can't depend on ntdll)
     66BOOLEAN (* WINAPI RtlAllocateAndInitializeSid) ( PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
     67                                                 BYTE nSubAuthorityCount,
     68                                                 DWORD nSubAuthority0,
     69                                                 DWORD nSubAuthority1,
     70                                                 DWORD nSubAuthority2,
     71                                                 DWORD nSubAuthority3,
     72                                                 DWORD nSubAuthority4,
     73                                                 DWORD nSubAuthority5,
     74                                                 DWORD nSubAuthority6,
     75                                                 DWORD nSubAuthority7,
     76                                                 PSID *pSid);
     77static HINSTANCE hInstNTDll = 0;
    6478//******************************************************************************
    6579//******************************************************************************
     
    202216    }
    203217    else thdb->flags      = 0;  //todo textmode
     218
     219    //Initialize thread security objects (TODO: Not complete)
     220    if(hInstNTDll == 0) {
     221        hInstNTDll = LoadLibraryA("NTDLL.DLL");
     222        *(ULONG *)&RtlAllocateAndInitializeSid = (ULONG)GetProcAddress(hInstNTDll, "RtlAllocateAndInitializeSid");
     223        if(RtlAllocateAndInitializeSid == NULL) {
     224                DebugInt3();
     225        }
     226    }
     227    SID_IDENTIFIER_AUTHORITY sidIdAuth = {0};
     228    thdb->threadinfo.dwType = SECTYPE_PROCESS | SECTYPE_INITIALIZED;
     229    RtlAllocateAndInitializeSid(&sidIdAuth, 1, 0, 0, 0, 0, 0, 0, 0, 0, &thdb->threadinfo.SidUser.User.Sid);
     230    thdb->threadinfo.SidUser.User.Attributes = 0; //?????????
     231 
     232    thdb->threadinfo.pTokenGroups = (TOKEN_GROUPS*)malloc(sizeof(TOKEN_GROUPS));
     233    thdb->threadinfo.pTokenGroups->GroupCount = 1;
     234    RtlAllocateAndInitializeSid(&sidIdAuth, 1, 0, 0, 0, 0, 0, 0, 0, 0, &thdb->threadinfo.PrimaryGroup.PrimaryGroup);
     235    thdb->threadinfo.pTokenGroups->Groups[0].Sid = thdb->threadinfo.PrimaryGroup.PrimaryGroup;
     236    thdb->threadinfo.pTokenGroups->Groups[0].Attributes = 0; //????
     237//        pPrivilegeSet   = NULL;
     238//        pTokenPrivileges= NULL;
     239//        TokenOwner      = {0};
     240//        DefaultDACL     = {0};
     241//        TokenSource     = {0};
     242    thdb->threadinfo.TokenType = TokenPrimary;
    204243
    205244    if(fMainThread)
Note: See TracChangeset for help on using the changeset viewer.