Ignore:
Timestamp:
Feb 18, 2002, 10:33:29 PM (24 years ago)
Author:
phaller
Message:

Fix: GetModuleHandleW(lpwszModuleName == NULL) fixed free(NULL)

File:
1 edited

Legend:

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

    r7849 r7947  
    1 /* $Id: wprocess.cpp,v 1.144 2002-02-09 12:45:14 sandervl Exp $ */
     1/* $Id: wprocess.cpp,v 1.145 2002-02-18 21:33:29 phaller Exp $ */
    22
    33/*
     
    240240    SID_IDENTIFIER_AUTHORITY sidIdAuth = {0};
    241241    winteb->o.odin.threadinfo.dwType = SECTYPE_PROCESS | SECTYPE_INITIALIZED;
    242     RtlAllocateAndInitializeSid(&sidIdAuth, 1, 0, 0, 0, 0, 0, 0, 0, 0, &winteb->o.odin.threadinfo.SidUser.User.Sid);
     242 
     243    if (NULL != RtlAllocateAndInitializeSid)
     244      RtlAllocateAndInitializeSid(&sidIdAuth, 1, 0, 0, 0, 0, 0, 0, 0, 0, &winteb->o.odin.threadinfo.SidUser.User.Sid);
     245 
    243246    winteb->o.odin.threadinfo.SidUser.User.Attributes = 0; //?????????
    244247
    245248    winteb->o.odin.threadinfo.pTokenGroups = (TOKEN_GROUPS*)malloc(sizeof(TOKEN_GROUPS));
    246249    winteb->o.odin.threadinfo.pTokenGroups->GroupCount = 1;
    247     RtlAllocateAndInitializeSid(&sidIdAuth, 1, 0, 0, 0, 0, 0, 0, 0, 0, &winteb->o.odin.threadinfo.PrimaryGroup.PrimaryGroup);
     250 
     251    if (NULL != RtlAllocateAndInitializeSid)
     252      RtlAllocateAndInitializeSid(&sidIdAuth, 1, 0, 0, 0, 0, 0, 0, 0, 0, &winteb->o.odin.threadinfo.PrimaryGroup.PrimaryGroup);
     253 
    248254    winteb->o.odin.threadinfo.pTokenGroups->Groups[0].Sid = winteb->o.odin.threadinfo.PrimaryGroup.PrimaryGroup;
    249255    winteb->o.odin.threadinfo.pTokenGroups->Groups[0].Attributes = 0; //????
     
    15921598//******************************************************************************
    15931599//******************************************************************************
    1594 HMODULE WIN32API GetModuleHandleW(LPCWSTR arg1)
    1595 {
    1596  HMODULE rc;
    1597  char   *astring;
    1598 
    1599     astring = UnicodeToAsciiString((LPWSTR)arg1);
    1600     rc = GetModuleHandleA(astring);
    1601     dprintf(("KERNEL32:  OS2GetModuleHandleW %s returned %X\n", astring, rc));
     1600HMODULE WIN32API GetModuleHandleW(LPCWSTR lpwszModuleName)
     1601{
     1602  HMODULE rc;
     1603  char   *astring = NULL;
     1604
     1605  if (NULL != lpwszModuleName)
     1606    astring = UnicodeToAsciiString((LPWSTR)lpwszModuleName);
     1607 
     1608  rc = GetModuleHandleA(astring);
     1609  dprintf(("KERNEL32:  OS2GetModuleHandleW %s returned %X\n", astring, rc));
     1610 
     1611  if (NULL != astring)
    16021612    FreeAsciiString(astring);
    1603     return(rc);
     1613 
     1614  return(rc);
    16041615}
    16051616//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.