Changeset 1134 for trunk/src


Ignore:
Timestamp:
Oct 5, 1999, 12:25:02 AM (26 years ago)
Author:
phaller
Message:

Fix: DisableThreadLibraryCalls added

Location:
trunk/src/kernel32
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/KERNEL32.CPP

    r1009 r1134  
    1 /* $Id: KERNEL32.CPP,v 1.20 1999-09-22 11:27:48 sandervl Exp $ */
     1/* $Id: KERNEL32.CPP,v 1.21 1999-10-04 22:25:01 phaller Exp $ */
    22
    33/*
     
    654654}
    655655//******************************************************************************
    656 //TODO:What does this do exactly??
    657 // @@@OPH -> see WINE
    658 //******************************************************************************
    659 BOOL WIN32API DisableThreadLibraryCalls(HMODULE hLibModule)
    660 {
    661   dprintf(("KERNEL32:  (NI!)OS2DisableThreadLibraryCalls of %X\n", hLibModule));
    662   return(TRUE);
    663 }
    664 //******************************************************************************
    665656//******************************************************************************
    666657//TODO: Query processor info to complete this api
  • trunk/src/kernel32/windllbase.cpp

    r956 r1134  
    1 /* $Id: windllbase.cpp,v 1.1 1999-09-15 23:39:07 sandervl Exp $ */
     1/* $Id: windllbase.cpp,v 1.2 1999-10-04 22:25:02 phaller Exp $ */
    22
    33/*
     
    3838//******************************************************************************
    3939//******************************************************************************
    40 Win32DllBase::Win32DllBase(HINSTANCE hinstance, WIN32DLLENTRY DllEntryPoint) 
     40Win32DllBase::Win32DllBase(HINSTANCE hinstance, WIN32DLLENTRY DllEntryPoint)
    4141                 : Win32ImageBase(hinstance),
    42                    referenced(0), fSkipEntryCalls(FALSE), 
     42                   referenced(0), fSkipEntryCalls(FALSE),
    4343                   fAttachedToProcess(FALSE), fUnloaded(FALSE)
    4444{
     
    6060  dprintf(("Win32DllBase::~Win32DllBase %s", szModule));
    6161
    62   if(errorState == NO_ERROR && !fUnloaded) 
     62  if(errorState == NO_ERROR && !fUnloaded)
    6363  {
    6464        detachProcess();
     
    8686//******************************************************************************
    8787ULONG Win32DllBase::Release()
    88 { 
     88{
    8989 ULONG ret = --referenced;
    9090
     
    105105  if(fAttachedToProcess)
    106106        return TRUE;
    107  
     107
    108108  fAttachedToProcess = TRUE;
    109109
     
    341341//******************************************************************************
    342342//******************************************************************************
     343void Win32DllBase::setThreadLibraryCalls(BOOL fEnable)
     344{
     345  // if fEnable == true, do call the ATTACH_THREAD, DETACH_THREAD functions
     346  // if fEnable == false, do not call the ATTACH_THREAD, DETACH_THREAD functions
     347  fSkipEntryCalls = !fEnable;
     348}
     349
     350//******************************************************************************
     351//******************************************************************************
    343352Win32DllBase *Win32DllBase::head = NULL;
  • trunk/src/kernel32/wprocess.cpp

    r1118 r1134  
    1 /* $Id: wprocess.cpp,v 1.34 1999-10-04 09:55:57 sandervl Exp $ */
     1/* $Id: wprocess.cpp,v 1.35 1999-10-04 22:25:01 phaller Exp $ */
    22
    33/*
     
    1010 *
    1111 */
     12#include <odin.h>
     13#include <odinwrap.h>
    1214#include <os2win.h>
    1315#include <stdio.h>
     
    3335#include "mmap.h"
    3436
     37
     38ODINDEBUGCHANNEL(KERNEL32-WPROCESS)
     39
     40
     41//******************************************************************************
     42//******************************************************************************
    3543BOOL      fFreeLibrary = FALSE;
    3644
     
    299307  }
    300308
    301   if(Win32ImageBase::isPEImage((char *)modname)) 
     309  if(Win32ImageBase::isPEImage((char *)modname))
    302310  {
    303311        module = Win32DllBase::findModule((char *)modname);
     
    499507}
    500508//******************************************************************************
    501 //NOTE: GetModuleHandleA does NOT support files with multiple dots (i.e. 
     509//NOTE: GetModuleHandleA does NOT support files with multiple dots (i.e.
    502510//      very.weird.exe)
    503511//******************************************************************************
     
    522530        else {
    523531                if(!strstr(szModule, ".")) {
    524                         //if there's no extension or trainling dot, we 
     532                        //if there's no extension or trainling dot, we
    525533                        //assume it's a dll (see Win32 SDK docs)
    526534                        fDllModule = TRUE;
     
    702710}
    703711
     712//******************************************************************************
     713//TODO:What does this do exactly??
     714//******************************************************************************
     715ODINFUNCTION1(BOOL,DisableThreadLibraryCalls,HMODULE,hModule)
     716{
     717  Win32DllBase *winmod;
     718  FARPROC   proc;
     719  ULONG     ulAPIOrdinal;
     720
     721  winmod = Win32DllBase::findModule((HINSTANCE)hModule);
     722  if(winmod)
     723  {
     724    // don't call ATTACH/DETACH thread functions in DLL
     725    winmod->setThreadLibraryCalls(FALSE);
     726    return TRUE;
     727  }
     728  else
     729  {
     730    // raise error condition
     731    SetLastError(ERROR_INVALID_HANDLE);
     732    return FALSE;
     733  }
     734}
     735
Note: See TracChangeset for help on using the changeset viewer.