Ignore:
Timestamp:
Dec 18, 1999, 10:45:13 PM (26 years ago)
Author:
sandervl
Message:

Token api update

File:
1 edited

Legend:

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

    r2122 r2128  
    1 /* $Id: nt.cpp,v 1.3 1999-12-18 20:01:13 sandervl Exp $ */
     1/* $Id: nt.cpp,v 1.4 1999-12-18 21:45:13 sandervl Exp $ */
    22
    33
     
    1515#include <string.h>
    1616#include <time.h>
     17#include <os2win.h>
     18#include <handlemanager.h>
    1719
    1820#include "ntdll.h"
     
    258260                                   PHANDLE TokenHandle)
    259261{
    260   dprintf(("NTDLL: NtOpenProcessToken(%08xh,%08xh,%08xh) not implemented.\n",
     262  dprintf(("NTDLL: NtOpenProcessToken(%08xh,%08xh,%08xh) not correctly implemented.\n",
    261263           ProcessHandle,
    262264           DesiredAccess,
    263265           TokenHandle));
    264266
    265   *TokenHandle = 0xcafe;
    266   return 0;
     267  if(ProcessHandle == GetCurrentProcess()) {
     268        HMOpenProcessToken(ProcessHandle, DesiredAccess, (ULONG)&ProcSecInfo, TokenHandle);
     269        return STATUS_SUCCESS;
     270  }
     271  *TokenHandle = 0;
     272  return ERROR_INVALID_HANDLE;
    267273}
    268274
     
    282288           TokenHandle));
    283289
    284   *TokenHandle = 0xcafe;
    285   return 0;
     290  *TokenHandle = 0;
     291  return ERROR_INVALID_HANDLE;
    286292}
    287293
     
    321327                                        LPDWORD ReturnLength)
    322328{
    323   dprintf(("NTDLL: NtQueryInformationToken(%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",
     329 PROCESSTHREAD_SECURITYINFO *pSecInfo;
     330
     331  dprintf(("NTDLL: NtQueryInformationToken(%08xh,%08xh,%08xh,%08xh,%08xh) not correctly implemented.\n",
    324332           Token,
    325333           TokenInformationClass,
     
    328336           ReturnLength));
    329337
     338  pSecInfo = (PROCESSTHREAD_SECURITYINFO*)HMHandleGetUserData(Token);
     339  if((ULONG)pSecInfo == -1) {
     340        return ERROR_INVALID_HANDLE;
     341  }
    330342  switch (TokenInformationClass)
    331343  {
     
    335347                return STATUS_BUFFER_TOO_SMALL;
    336348        }
    337         memset(TokenInformation, 0, sizeof(TOKEN_GROUPS));
     349        memcpy(TokenInformation, (LPVOID)pSecInfo->pTokenGroups, sizeof(TOKEN_GROUPS));
    338350        break;
    339351    case TokenUser:                     /* 1 */
Note: See TracChangeset for help on using the changeset viewer.