Ignore:
Timestamp:
Jun 14, 2000, 4:28:43 AM (25 years ago)
Author:
phaller
Message:

Fix: StarCraft STORM.DLL requires reserved DllEntryPoint parameter

File:
1 edited

Legend:

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

    r3483 r3704  
    1 /* $Id: windllbase.cpp,v 1.13 2000-05-02 20:53:14 sandervl Exp $ */
     1/* $Id: windllbase.cpp,v 1.14 2000-06-14 02:27:33 phaller Exp $ */
    22
    33/*
     
    421421
    422422  dprintf(("attachProcess to dll %s", szModule));
    423 
    424   rc = dllEntryPoint(hinstance, DLL_PROCESS_ATTACH, 0);
     423 
     424  // @@@PH 2000/06/13 lpvReserved, Starcraft STORM.DLL
     425  // if DLL_PROCESS_ATTACH, lpvReserved is NULL for dynamic loads
     426  //   and non-NULL for static loads.
     427  // same goes for process termination
     428  LPVOID lpvReserved;
     429 
     430  if (isDynamicLib())
     431    lpvReserved = NULL;
     432  else
     433    lpvReserved = (LPVOID)0xdeadface; // some arbitrary value
     434 
     435  rc = dllEntryPoint(hinstance, DLL_PROCESS_ATTACH, lpvReserved);
    425436
    426437  dprintf(("attachProcess to dll %s DONE", szModule));
     
    461472  fUnloaded = TRUE;
    462473  sel = SetWin32TIB();
    463   rc = dllEntryPoint(hinstance, DLL_PROCESS_DETACH, 0);
     474 
     475  // @@@PH 2000/06/13 lpvReserved, Starcraft STORM.DLL
     476  // if DLL_PROCESS_ATTACH, lpvReserved is NULL for dynamic loads
     477  //   and non-NULL for static loads.
     478  // same goes for process termination
     479  LPVOID lpvReserved;
     480 
     481  if (isDynamicLib())
     482    lpvReserved = NULL;
     483  else
     484    lpvReserved = (LPVOID)0xdeadface; // some arbitrary value
     485 
     486  rc = dllEntryPoint(hinstance, DLL_PROCESS_DETACH, lpvReserved);
     487 
    464488  SetFS(sel);
    465489  tlsDetachThread();    //destroy TLS (main thread)
     
    481505
    482506  dprintf(("attachThread to dll %s", szModule));
    483 
     507 
    484508  rc = dllEntryPoint(hinstance, DLL_THREAD_ATTACH, 0);
    485509
     
    499523
    500524  dprintf(("detachThread from dll %s", szModule));
    501 
     525 
    502526  rc =  dllEntryPoint(hinstance, DLL_THREAD_DETACH, 0);
    503527  return rc;
Note: See TracChangeset for help on using the changeset viewer.