- Timestamp:
- Jul 20, 2001, 5:42:38 PM (24 years ago)
- Location:
- trunk/src
- Files:
-
- 25 added
- 47 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comctl32/comctl32.def
r5630 r6375 1 ; $Id: comctl32.def,v 1.2 2 2001-04-29 10:30:56sandervl Exp $1 ; $Id: comctl32.def,v 1.23 2001-07-20 15:35:30 sandervl Exp $ 2 2 LIBRARY COMCTL32 INITINSTANCE 3 3 DESCRIPTION 'Odin32 System DLL - ComCtl32 - Common Controls Library' … … 155 155 DSA_EnumCallback = _DSA_EnumCallback@12 @387 156 156 DSA_DestroyCallback = _DSA_DestroyCallback@12 @388 157 _COMCTL32_389@8 @389 158 _COMCTL32_390@16 @390 157 _COMCTL32_389@8 @389 NONAME 158 _COMCTL32_390@16 @390 NONAME 159 159 160 160 StrCSpnA = _COMCTL32_StrCSpnA@8 @356 -
trunk/src/comctl32/initterm.cpp
r5416 r6375 36 36 #include <initdll.h> 37 37 38 extern "C" {39 //Win32 resource table (produced by wrc)40 extern DWORD _Resource_PEResTab;41 }42 43 static HMODULE dllHandle = 0;44 45 BOOL WINAPI COMCTL32_LibMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved);46 47 //******************************************************************************48 //******************************************************************************49 BOOL WINAPI LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)50 {51 switch (fdwReason)52 {53 case DLL_PROCESS_ATTACH:54 case DLL_THREAD_ATTACH:55 case DLL_THREAD_DETACH:56 return COMCTL32_LibMain(hinstDLL, fdwReason, fImpLoad);57 58 case DLL_PROCESS_DETACH:59 {60 BOOL ret = COMCTL32_LibMain(hinstDLL, fdwReason, fImpLoad);61 ctordtorTerm();62 return ret;63 }64 }65 return FALSE;66 }67 38 /****************************************************************************/ 68 39 /* _DLL_InitTerm is the function that gets called by the operating system */ … … 87 58 switch (ulFlag) { 88 59 case 0 : 89 90 60 ctordtorInit(); 91 92 /*******************************************************************/93 /* A DosExitList routine must be used to clean up if runtime calls */94 /* are required and the runtime is dynamically linked. */95 /*******************************************************************/96 97 dllHandle = RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab,98 COMCTL32_MAJORIMAGE_VERSION, COMCTL32_MINORIMAGE_VERSION,99 IMAGE_SUBSYSTEM_WINDOWS_GUI);100 if(dllHandle == 0)101 return 0UL;102 103 61 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/ 104 62 63 return inittermComctl32(hModule, ulFlag); 64 65 case 1 : 66 inittermComctl32(hModule, ulFlag); 67 ctordtorTerm(); 105 68 break; 106 case 1 : 107 if(dllHandle) { 108 UnregisterLxDll(dllHandle); 109 } 110 break; 69 111 70 default : 112 71 return 0UL; -
trunk/src/comctl32/makefile
r5630 r6375 1 # $Id: makefile,v 1.3 2 2001-04-29 10:30:56sandervl Exp $1 # $Id: makefile,v 1.33 2001-07-20 15:35:30 sandervl Exp $ 2 2 3 3 # … … 20 20 $(OBJDIR)\comctl32.obj \ 21 21 $(OBJDIR)\initterm.obj \ 22 $(OBJDIR)\initcomctl32.obj \ 22 23 $(OBJDIR)\progress.obj \ 23 24 $(OBJDIR)\comctl32undoc.obj \ -
trunk/src/comdlg32/initterm.cpp
r5135 r6375 36 36 #include <initdll.h> 37 37 38 extern "C" {39 //Win32 resource table (produced by wrc)40 extern DWORD _Resource_PEResTab;41 42 BOOL WINAPI COMDLG32_DllEntryPoint(HINSTANCE hInstance, DWORD Reason, LPVOID Reserved);43 }44 45 static HMODULE dllHandle = 0;46 47 //******************************************************************************48 //******************************************************************************49 BOOL WINAPI LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)50 {51 switch (fdwReason)52 {53 case DLL_PROCESS_ATTACH:54 case DLL_THREAD_ATTACH:55 case DLL_THREAD_DETACH:56 return COMDLG32_DllEntryPoint(hinstDLL, fdwReason, fImpLoad);57 58 case DLL_PROCESS_DETACH:59 COMDLG32_DllEntryPoint(hinstDLL, fdwReason, fImpLoad);60 ctordtorTerm();61 return TRUE;62 }63 return FALSE;64 }65 38 /****************************************************************************/ 66 39 /* _DLL_InitTerm is the function that gets called by the operating system */ … … 89 62 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/ 90 63 91 /*******************************************************************/ 92 /* A DosExitList routine must be used to clean up if runtime calls */ 93 /* are required and the runtime is dynamically linked. */ 94 /*******************************************************************/ 64 return inittermComdlg32(hModule, ulFlag); 95 65 96 dllHandle = RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab, 97 COMDLG32_MAJORIMAGE_VERSION, COMDLG32_MINORIMAGE_VERSION, 98 IMAGE_SUBSYSTEM_WINDOWS_GUI); 99 if(dllHandle == 0) 100 return 0UL; 66 case 1 : 67 inittermComdlg32(hModule, ulFlag); 68 ctordtorTerm(); 69 break; 101 70 102 break;103 case 1 :104 if(dllHandle) {105 UnregisterLxDll(dllHandle);106 }107 break;108 71 default : 109 72 return 0UL; -
trunk/src/comdlg32/makefile
r6365 r6375 1 # $Id: makefile,v 1.2 7 2001-07-19 20:00:22sandervl Exp $1 # $Id: makefile,v 1.28 2001-07-20 15:36:49 sandervl Exp $ 2 2 3 3 # … … 28 28 $(OBJDIR)\fontdlg.obj \ 29 29 $(OBJDIR)\initterm.obj \ 30 $(OBJDIR)\initcomdlg32.obj \ 30 31 $(OBJDIR)\cdlg32.obj \ 31 32 $(OBJDIR)\filetitle.obj \ -
trunk/src/gdi32/dbglocal.cpp
r6331 r6375 1 /* $Id: dbglocal.cpp,v 1. 6 2001-07-14 15:31:38sandervl Exp $ */1 /* $Id: dbglocal.cpp,v 1.7 2001-07-20 15:35:57 sandervl Exp $ */ 2 2 3 3 /* … … 16 16 #ifdef DEBUG 17 17 18 USHORT DbgEnabled [DBG_MAXFILES] = {0};19 USHORT DbgEnabledLvl2 [DBG_MAXFILES] = {0};18 USHORT DbgEnabledGDI32[DBG_MAXFILES] = {0}; 19 USHORT DbgEnabledLvl2GDI32[DBG_MAXFILES] = {0}; 20 20 21 char *DbgFileNames[DBG_MAXFILES] =21 static char *DbgFileNames[DBG_MAXFILES] = 22 22 { 23 23 "gdi32", … … 44 44 //****************************************************************************** 45 45 //****************************************************************************** 46 void ParseLogStatus ()46 void ParseLogStatusGDI32() 47 47 { 48 48 char *envvar = getenv(DBG_ENVNAME); … … 52 52 53 53 for(i=0;i<DBG_MAXFILES;i++) { 54 DbgEnabled [i] = 1;54 DbgEnabledGDI32[i] = 1; 55 55 } 56 56 … … 62 62 if(*(dbgvar-1) == '-') { 63 63 for(i=0;i<DBG_MAXFILES;i++) { 64 DbgEnabled [i] = 0;64 DbgEnabledGDI32[i] = 0; 65 65 } 66 66 } … … 70 70 if(dbgvar) { 71 71 if(*(dbgvar-1) == '-') { 72 DbgEnabled [i] = 0;72 DbgEnabledGDI32[i] = 0; 73 73 } 74 74 else 75 75 if(*(dbgvar-1) == '+') { 76 DbgEnabled [i] = 1;76 DbgEnabledGDI32[i] = 1; 77 77 } 78 78 } … … 83 83 if(*(dbgvar-1) == '+') { 84 84 for(i=0;i<DBG_MAXFILES;i++) { 85 DbgEnabledLvl2 [i] = 1;85 DbgEnabledLvl2GDI32[i] = 1; 86 86 } 87 87 } … … 91 91 if(dbgvar) { 92 92 if(*(dbgvar-1) == '-') { 93 DbgEnabledLvl2 [i] = 0;93 DbgEnabledLvl2GDI32[i] = 0; 94 94 } 95 95 else 96 96 if(*(dbgvar-1) == '+') { 97 DbgEnabledLvl2 [i] = 1;97 DbgEnabledLvl2GDI32[i] = 1; 98 98 } 99 99 } -
trunk/src/gdi32/dbglocal.h
r6331 r6375 1 /* $Id: dbglocal.h,v 1. 6 2001-07-14 15:31:39sandervl Exp $ */1 /* $Id: dbglocal.h,v 1.7 2001-07-20 15:35:57 sandervl Exp $ */ 2 2 3 3 /* … … 15 15 #ifdef DEBUG 16 16 //Parses environment variable for selective enabling/disabling of logging 17 void ParseLogStatus ();17 void ParseLogStatusGDI32(); 18 18 19 19 #define DBG_ENVNAME "dbg_gdi32" … … 42 42 #define DBG_MAXFILES 20 43 43 44 extern USHORT DbgEnabled [DBG_MAXFILES];45 extern USHORT DbgEnabledLvl2 [DBG_MAXFILES];44 extern USHORT DbgEnabledGDI32[DBG_MAXFILES]; 45 extern USHORT DbgEnabledLvl2GDI32[DBG_MAXFILES]; 46 46 47 47 #ifdef dprintf … … 49 49 #endif 50 50 51 #define dprintf(a) if(DbgEnabled [DBG_LOCALLOG] == 1) WriteLog a51 #define dprintf(a) if(DbgEnabledGDI32[DBG_LOCALLOG] == 1) WriteLog a 52 52 53 53 #ifdef dprintf2 … … 55 55 #endif 56 56 57 #define dprintf2(a) if(DbgEnabledLvl2 [DBG_LOCALLOG] == 1) WriteLog a57 #define dprintf2(a) if(DbgEnabledLvl2GDI32[DBG_LOCALLOG] == 1) WriteLog a 58 58 59 59 #else 60 60 61 #define ParseLogStatus ()61 #define ParseLogStatusGDI32() 62 62 63 63 #endif //DEBUG -
trunk/src/gdi32/initterm.cpp
r5356 r6375 39 39 #include <initdll.h> 40 40 41 extern "C" {42 //Win32 resource table (produced by wrc)43 extern DWORD _Resource_PEResTab;44 }45 static HMODULE dllHandle = 0;46 //******************************************************************************47 //******************************************************************************48 BOOL WINAPI OdinLibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)49 {50 switch (fdwReason)51 {52 case DLL_PROCESS_ATTACH:53 return TRUE;54 55 case DLL_THREAD_ATTACH:56 case DLL_THREAD_DETACH:57 return TRUE;58 59 case DLL_PROCESS_DETACH:60 ctordtorTerm();61 return TRUE;62 }63 return FALSE;64 }65 41 /****************************************************************************/ 66 42 /* _DLL_InitTerm is the function that gets called by the operating system */ … … 86 62 ctordtorInit(); 87 63 88 ParseLogStatus();89 64 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/ 90 65 91 if(InitRegionSpace() == FALSE) { 92 return 0UL; 93 } 94 dllHandle = RegisterLxDll(hModule, OdinLibMain, (PVOID)&_Resource_PEResTab, 95 GDI32_MAJORIMAGE_VERSION, GDI32_MINORIMAGE_VERSION, 96 IMAGE_SUBSYSTEM_NATIVE); 97 if(dllHandle == 0) 98 return 0UL; 66 return inittermGdi32(hModule, ulFlag); 99 67 100 dprintf(("gdi32 init %s %s (%x)", __DATE__, __TIME__, DLLENTRYPOINT_NAME)); 68 case 1 : 69 return inittermGdi32(hModule, ulFlag); 101 70 102 break;103 case 1 :104 if(dllHandle) {105 UnregisterLxDll(dllHandle);106 }107 break;108 71 default : 109 72 return 0UL; -
trunk/src/gdi32/makefile
r6331 r6375 1 # $Id: makefile,v 1.3 6 2001-07-14 15:31:44sandervl Exp $1 # $Id: makefile,v 1.37 2001-07-20 15:35:57 sandervl Exp $ 2 2 3 3 # … … 31 31 $(OBJDIR)\dibsect.obj \ 32 32 $(OBJDIR)\initterm.obj \ 33 $(OBJDIR)\initgdi32.obj \ 33 34 $(OBJDIR)\oslibgdi.obj \ 34 35 $(OBJDIR)\font.obj \ -
trunk/src/kernel32/KERNEL32.DEF
r6263 r6375 1 ; $Id: KERNEL32.DEF,v 1.11 4 2001-07-09 07:58:12sandervl Exp $1 ; $Id: KERNEL32.DEF,v 1.115 2001-07-20 15:33:28 sandervl Exp $ 2 2 3 3 ;Basis is Windows95 KERNEL32 … … 1164 1164 _Odin32GetBuildNumber@0 @1293 NONAME 1165 1165 1166 ;Export for MSACM321167 _wsnprintfA @2000 NONAME1168 1169 1166 IsExeStarted__Fv @2001 NONAME 1170 1167 CheckCurFS @2002 NONAME -
trunk/src/kernel32/dbglocal.cpp
r5587 r6375 1 /* $Id: dbglocal.cpp,v 1.1 5 2001-04-26 13:22:43sandervl Exp $ */1 /* $Id: dbglocal.cpp,v 1.16 2001-07-20 15:33:29 sandervl Exp $ */ 2 2 3 3 /* … … 16 16 #ifdef DEBUG 17 17 18 USHORT DbgEnabled [DBG_MAXFILES] = {0};19 USHORT DbgEnabledLvl2 [DBG_MAXFILES] = {0};18 USHORT DbgEnabledKERNEL32[DBG_MAXFILES] = {0}; 19 USHORT DbgEnabledLvl2KERNEL32[DBG_MAXFILES] = {0}; 20 20 21 char *DbgFileNames[DBG_MAXFILES] =21 static char *DbgFileNames[DBG_MAXFILES] = 22 22 { 23 23 "kernel32", … … 128 128 //****************************************************************************** 129 129 //****************************************************************************** 130 void ParseLogStatus ()130 void ParseLogStatusKERNEL32() 131 131 { 132 132 char *envvar = getenv(DBG_ENVNAME); … … 136 136 137 137 for(i=0;i<DBG_MAXFILES;i++) { 138 DbgEnabled [i] = 1;138 DbgEnabledKERNEL32[i] = 1; 139 139 } 140 140 … … 144 144 if(*(dbgvar-1) == '-') { 145 145 for(i=0;i<DBG_MAXFILES;i++) { 146 DbgEnabled [i] = 0;146 DbgEnabledKERNEL32[i] = 0; 147 147 } 148 148 } … … 152 152 if(dbgvar) { 153 153 if(*(dbgvar-1) == '-') { 154 DbgEnabled [i] = 0;154 DbgEnabledKERNEL32[i] = 0; 155 155 } 156 156 else 157 157 if(*(dbgvar-1) == '+') { 158 DbgEnabled [i] = 1;158 DbgEnabledKERNEL32[i] = 1; 159 159 } 160 160 } … … 166 166 if(*(dbgvar-1) == '+') { 167 167 for(i=0;i<DBG_MAXFILES;i++) { 168 DbgEnabledLvl2 [i] = 1;168 DbgEnabledLvl2KERNEL32[i] = 1; 169 169 } 170 170 } … … 174 174 if(dbgvar) { 175 175 if(*(dbgvar-1) == '-') { 176 DbgEnabledLvl2 [i] = 0;176 DbgEnabledLvl2KERNEL32[i] = 0; 177 177 } 178 178 else 179 179 if(*(dbgvar-1) == '+') { 180 DbgEnabledLvl2 [i] = 1;180 DbgEnabledLvl2KERNEL32[i] = 1; 181 181 } 182 182 } -
trunk/src/kernel32/dbglocal.h
r5587 r6375 13 13 #ifdef DEBUG 14 14 //Parses environment variable for selective enabling/disabling of logging 15 void ParseLogStatus ();15 void ParseLogStatusKERNEL32(); 16 16 17 17 #define DBG_ENVNAME "dbg_kernel32" … … 124 124 #define DBG_MAXFILES 104 125 125 126 extern USHORT DbgEnabled [DBG_MAXFILES];127 extern USHORT DbgEnabledLvl2 [DBG_MAXFILES];126 extern USHORT DbgEnabledKERNEL32[DBG_MAXFILES]; 127 extern USHORT DbgEnabledLvl2KERNEL32[DBG_MAXFILES]; 128 128 129 129 #ifdef dprintf … … 131 131 #endif 132 132 133 #define dprintf(a) if(DbgEnabled [DBG_LOCALLOG] == 1) WriteLog a133 #define dprintf(a) if(DbgEnabledKERNEL32[DBG_LOCALLOG] == 1) WriteLog a 134 134 135 135 #ifdef dprintf2 … … 137 137 #endif 138 138 139 #define dprintf2(a) if(DbgEnabledLvl2 [DBG_LOCALLOG] == 1) WriteLog a139 #define dprintf2(a) if(DbgEnabledLvl2KERNEL32[DBG_LOCALLOG] == 1) WriteLog a 140 140 141 141 #else 142 142 143 #define ParseLogStatus ()143 #define ParseLogStatusKERNEL32() 144 144 145 145 #endif //DEBUG -
trunk/src/kernel32/exceptstackdump.cpp
r4555 r6375 1 /* $Id: exceptstackdump.cpp,v 1. 3 2000-11-05 13:40:45sandervl Exp $ */1 /* $Id: exceptstackdump.cpp,v 1.4 2001-07-20 15:33:29 sandervl Exp $ */ 2 2 /* 3 3 * Stack dump code … … 30 30 31 31 #undef dprintf 32 #define dprintf(a) if(DbgEnabled [DBG_LOCALLOG] == 1) WriteLogNoEOL a32 #define dprintf(a) if(DbgEnabledKERNEL32[DBG_LOCALLOG] == 1) WriteLogNoEOL a 33 33 34 34 /* ****************************************************************** -
trunk/src/kernel32/exceptutil.asm
r6133 r6375 1 ; $Id: exceptutil.asm,v 1.1 7 2001-06-27 19:09:35sandervl Exp $1 ; $Id: exceptutil.asm,v 1.18 2001-07-20 15:33:29 sandervl Exp $ 2 2 3 3 ;/* … … 160 160 getEAX endp 161 161 162 public getEDX 163 getEDX proc near 164 mov EAX, EDX 165 ret 166 endp 167 162 168 getEBX proc near 163 169 mov eax, ebx … … 292 298 EXTRN _GetThreadTEB@0:PROC 293 299 IFDEF DEBUG 294 EXTRN DbgEnabled :DWORD300 EXTRN DbgEnabledKERNEL32:DWORD 295 301 ENDIF 296 302 … … 375 381 ; 299 dprintf(("KERNEL32: Calling handler at %p code=%lx flags=%lx\n", 376 382 IFDEF DEBUG 377 cmp word ptr DbgEnabled +020h,01h383 cmp word ptr DbgEnabledKERNEL32+020h,01h 378 384 jne @BLBL20 379 385 mov eax,[ebp+08h]; record … … 400 406 IFDEF DEBUG 401 407 ; 302 dprintf(("KERNEL32: Handler returned %lx\n", ret)); 402 cmp word ptr DbgEnabled +020h,01h408 cmp word ptr DbgEnabledKERNEL32+020h,01h 403 409 jne @BLBL21 404 410 push dword ptr [ebp-010h]; ret -
trunk/src/kernel32/initterm.cpp
r6340 r6375 58 58 #include "dbglocal.h" 59 59 60 PVOID SYSTEM _O32_GetEnvironmentStrings( VOID );61 60 BOOL fVersionWarp3 = FALSE; 62 61 … … 68 67 /*-------------------------------------------------------------------*/ 69 68 static void APIENTRY cleanup(ULONG reason); 70 71 extern "C" {72 //Win32 resource table (produced by wrc)73 extern DWORD _Resource_PEResTab;74 }75 76 //Global DLL Data77 #pragma data_seg(_GLOBALDATA)78 int globLoadNr = 0;79 #pragma data_seg()80 81 /* Tue 03.03.1998: knut */82 ULONG flAllocMem = 0; /* flag to optimize DosAllocMem to use all the memory on SMP machines */83 ULONG ulMaxAddr = 0x20000000; /* end of user address space. */84 int loadNr = 0;85 char kernel32Path[CCHMAXPATH] = "";86 static HMODULE dllHandle = 0;87 69 88 70 /****************************************************************************/ … … 110 92 case 0 : 111 93 { 112 ParseLogStatus();113 114 /*115 * Init the win32k library.116 * We will also need to tell win32k where the Odin32 environment is117 * located. Currently that is within Open32. I'm quite sure that it's118 * not relocated during run, so we're pretty well off.119 */120 if (!libWin32kInit())121 {122 rc = libWin32kSetEnvironment((PSZ)_O32_GetEnvironmentStrings(), 0, 0);123 if (rc)124 {125 dprintf(("KERNEL32: initterm: libWin32kSetEnvironment failed with rc=%d\n", rc));126 }127 }128 129 loadNr = globLoadNr++;130 131 strcpy(kernel32Path, OSLibGetDllName(hModule));132 char *endofpath = strrchr(kernel32Path, '\\');133 *(endofpath+1) = 0;134 dprintf(("kernel32 init %s %s (%x) Win32k - %s", __DATE__, __TIME__, DLLENTRYPOINT_NAME,135 libWin32kInstalled() ? "Installed" : "Not Installed"));136 94 ctordtorInit(); 137 95 138 96 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/ 139 140 OpenPrivateLogFiles();141 142 if (InitializeSharedHeap() == FALSE)143 return 0UL;144 145 if (InitializeCodeHeap() == FALSE)146 return 0UL;147 148 PROFILE_LoadOdinIni();149 dllHandle = RegisterLxDll(hModule, 0, (PVOID)&_Resource_PEResTab);150 if (dllHandle == 0)151 return 0UL;152 153 //SvL: Kernel32 is a special case; pe.exe loads it, so increase154 // the reference count here155 Win32DllBase *module = Win32DllBase::findModule(dllHandle);156 if (module)157 {158 module->AddRef();159 module->DisableUnload();160 }161 97 162 98 /*******************************************************************/ … … 169 105 return 0UL; 170 106 171 /* knut: check for high memory support */172 rc = DosQuerySysInfo(QSV_VIRTUALADDRESSLIMIT, QSV_VIRTUALADDRESSLIMIT, &ulSysinfo, sizeof(ulSysinfo));173 if (rc == 0 && ulSysinfo > 512) //VirtualAddresslimit is in MB174 {175 flAllocMem = PAG_ANY; // high memory support. Let's use it!176 ulMaxAddr = ulSysinfo * (1024*1024);177 OSLibInitWSeBFileIO();178 if (PROFILE_GetOdinIniInt(ODINSYSTEM_SECTION, HIGHMEM_KEY, 1) == 0) {179 dprintf(("WARNING: OS/2 kernel supports high memory, but support is DISABLED because of HIGHMEM odin.ini key"));180 flAllocMem = 0;181 }182 }183 else184 flAllocMem = 0; // no high memory support185 186 OSLibDosSetInitialMaxFileHandles(ODIN_DEFAULT_MAX_FILEHANDLES);187 188 //SvL: Do it here instead of during the exe object creation189 //(std handles can be used in win32 dll initialization routines190 HMInitialize(); /* store standard handles within HandleManager */191 InitDirectories(); //Must be done before InitializeTIB (which loads NTDLL -> USER32)192 InitializeTIB(TRUE); //Must be done after HMInitialize!193 RegisterDevices();194 Win32DllBase::setDefaultRenaming();195 rc = DosQuerySysInfo(QSV_NUMPROCESSORS, QSV_NUMPROCESSORS, &ulSysinfo, sizeof(ulSysinfo));196 if (rc != 0)197 ulSysinfo = 1;198 199 107 rc = DosQuerySysInfo(QSV_VERSION_MAJOR, QSV_VERSION_MINOR, version, sizeof(version)); 200 108 if(rc == 0){ … … 203 111 } 204 112 } 205 206 /* Setup codepage info */ 207 CODEPAGE_Init(); 208 209 InitSystemInfo(ulSysinfo); 210 //Set up environment as found in NT 211 InitEnvironment(ulSysinfo); 212 213 //InitDynamicRegistry creates/changes keys that may change (i.e. odin.ini 214 //keys that affect windows version) 215 InitDynamicRegistry(); 113 114 rc = inittermKernel32(hModule, ulFlag); 216 115 break; 217 116 } 218 117 219 118 case 1 : 220 if (dllHandle) 221 { 222 UnregisterLxDll(dllHandle); 223 } 119 rc = inittermKernel32(hModule, ulFlag); 224 120 break; 225 121 … … 237 133 static void APIENTRY cleanup(ULONG ulReason) 238 134 { 239 dprintf(("kernel32 exit %d\n", ulReason)); 240 //Flush and delete all open memory mapped files 241 Win32MemMap::deleteAll(); 242 WinExe = NULL; 135 cleanupKernel32(ulReason); 243 136 244 WriteOutProfiles();245 DestroyTIB();246 DestroySharedHeap();247 DestroyCodeHeap();248 137 ctordtorTerm(); 249 250 //NOTE: Must be done after DestroyTIB251 ClosePrivateLogFiles();252 CloseLogFile();253 254 /*255 * Terminate win32k library.256 */257 libWin32kSetEnvironment(NULL, 0, 0);258 libWin32kTerm();259 138 260 139 DosExitList(EXLST_EXIT, cleanup); -
trunk/src/kernel32/kernel32.mak
r6060 r6375 1 # $Id: kernel32.mak,v 1. 7 2001-06-21 21:07:54sandervl Exp $1 # $Id: kernel32.mak,v 1.8 2001-07-20 15:33:30 sandervl Exp $ 2 2 3 3 # … … 20 20 # Overrides. 21 21 # 22 ##CDEFINES = $(CDEFINES) -D USE_OS2SEMAPHORES22 ##CDEFINES = $(CDEFINES) -DTEST_BUILTIN 23 23 24 24 … … 66 66 $(OBJDIR)\vsemaphore.obj \ 67 67 $(OBJDIR)\initterm.obj \ 68 $(OBJDIR)\initkernel32.obj \ 68 69 $(OBJDIR)\handlemanager.obj \ 69 70 $(OBJDIR)\environ.obj \ … … 138 139 LIBS = \ 139 140 $(ODIN32_LIB)/$(ODINCRT).lib \ 141 ##$(ODIN32_LIB)\wgss.lib \ 140 142 $(ODIN32_LIB)\PMWINX.LIB \ 141 143 $(ODIN32_LIB)\LIBULS.LIB \ -
trunk/src/kernel32/time.cpp
r5818 r6375 1 /* $Id: time.cpp,v 1.1 5 2001-05-28 14:47:49 phallerExp $ */1 /* $Id: time.cpp,v 1.16 2001-07-20 15:33:30 sandervl Exp $ */ 2 2 3 3 /* … … 191 191 return O32_SetSystemTime(arg1); 192 192 } 193 194 /***********************************************************************195 * WPRINTF_ParseFormatA196 *197 * Parse a format specification. A format specification has the form:198 *199 * [-][#][0][width][.precision]type200 *201 * Return value is the length of the format specification in characters.202 */203 static INT WPRINTF_ParseFormatA( LPCSTR format, WPRINTF_FORMAT *res )204 {205 LPCSTR p = format;206 207 res->flags = 0;208 res->width = 0;209 res->precision = 0;210 if (*p == '-') { res->flags |= WPRINTF_LEFTALIGN; p++; }211 if (*p == '#') { res->flags |= WPRINTF_PREFIX_HEX; p++; }212 if (*p == '0') { res->flags |= WPRINTF_ZEROPAD; p++; }213 while ((*p >= '0') && (*p <= '9')) /* width field */214 {215 res->width = res->width * 10 + *p - '0';216 p++;217 }218 if (*p == '.') /* precision field */219 {220 p++;221 while ((*p >= '0') && (*p <= '9'))222 {223 res->precision = res->precision * 10 + *p - '0';224 p++;225 }226 }227 if (*p == 'l') { res->flags |= WPRINTF_LONG; p++; }228 else if (*p == 'h') { res->flags |= WPRINTF_SHORT; p++; }229 else if (*p == 'w') { res->flags |= WPRINTF_WIDE; p++; }230 switch(*p)231 {232 case 'c':233 res->type = (res->flags & WPRINTF_LONG) ? WPR_WCHAR : WPR_CHAR;234 break;235 case 'C':236 res->type = (res->flags & WPRINTF_SHORT) ? WPR_CHAR : WPR_WCHAR;237 break;238 case 'd':239 case 'i':240 res->type = WPR_SIGNED;241 break;242 case 's':243 res->type = (res->flags & (WPRINTF_LONG |WPRINTF_WIDE))244 ? WPR_WSTRING : WPR_STRING;245 break;246 case 'S':247 res->type = (res->flags & (WPRINTF_SHORT|WPRINTF_WIDE))248 ? WPR_STRING : WPR_WSTRING;249 break;250 case 'u':251 res->type = WPR_UNSIGNED;252 break;253 case 'X':254 res->flags |= WPRINTF_UPPER_HEX;255 /* fall through */256 case 'x':257 res->type = WPR_HEXA;258 break;259 default: /* unknown format char */260 res->type = WPR_UNKNOWN;261 p--; /* print format as normal char */262 break;263 }264 return (INT)(p - format) + 1;265 }266 267 268 /***********************************************************************269 * WPRINTF_ParseFormatW270 *271 * Parse a format specification. A format specification has the form:272 *273 * [-][#][0][width][.precision]type274 *275 * Return value is the length of the format specification in characters.276 */277 static INT WPRINTF_ParseFormatW( LPCWSTR format, WPRINTF_FORMAT *res )278 {279 LPCWSTR p = format;280 281 res->flags = 0;282 res->width = 0;283 res->precision = 0;284 if (*p == '-') { res->flags |= WPRINTF_LEFTALIGN; p++; }285 if (*p == '#') { res->flags |= WPRINTF_PREFIX_HEX; p++; }286 if (*p == '0') { res->flags |= WPRINTF_ZEROPAD; p++; }287 while ((*p >= '0') && (*p <= '9')) /* width field */288 {289 res->width = res->width * 10 + *p - '0';290 p++;291 }292 if (*p == '.') /* precision field */293 {294 p++;295 while ((*p >= '0') && (*p <= '9'))296 {297 res->precision = res->precision * 10 + *p - '0';298 p++;299 }300 }301 if (*p == 'l') { res->flags |= WPRINTF_LONG; p++; }302 else if (*p == 'h') { res->flags |= WPRINTF_SHORT; p++; }303 else if (*p == 'w') { res->flags |= WPRINTF_WIDE; p++; }304 switch((CHAR)*p)305 {306 case 'c':307 res->type = (res->flags & WPRINTF_SHORT) ? WPR_CHAR : WPR_WCHAR;308 break;309 case 'C':310 res->type = (res->flags & WPRINTF_LONG) ? WPR_WCHAR : WPR_CHAR;311 break;312 case 'd':313 case 'i':314 res->type = WPR_SIGNED;315 break;316 case 's':317 res->type = ((res->flags & WPRINTF_SHORT) && !(res->flags & WPRINTF_WIDE)) ? WPR_STRING : WPR_WSTRING;318 break;319 case 'S':320 res->type = (res->flags & (WPRINTF_LONG|WPRINTF_WIDE)) ? WPR_WSTRING : WPR_STRING;321 break;322 case 'u':323 res->type = WPR_UNSIGNED;324 break;325 case 'X':326 res->flags |= WPRINTF_UPPER_HEX;327 /* fall through */328 case 'x':329 res->type = WPR_HEXA;330 break;331 default:332 res->type = WPR_UNKNOWN;333 p--; /* print format as normal char */334 break;335 }336 return (INT)(p - format) + 1;337 }338 339 340 /***********************************************************************341 * WPRINTF_GetLen342 */343 static UINT WPRINTF_GetLen( WPRINTF_FORMAT *format, WPRINTF_DATA *arg,344 LPSTR number, UINT maxlen )345 {346 UINT len;347 348 if (format->flags & WPRINTF_LEFTALIGN) format->flags &= ~WPRINTF_ZEROPAD;349 if (format->width > maxlen) format->width = maxlen;350 switch(format->type)351 {352 case WPR_CHAR:353 case WPR_WCHAR:354 return (format->precision = 1);355 case WPR_STRING:356 if (!arg->lpcstr_view) arg->lpcstr_view = null_stringA;357 for (len = 0; !format->precision || (len < format->precision); len++)358 if (!*(arg->lpcstr_view + len)) break;359 if (len > maxlen) len = maxlen;360 return (format->precision = len);361 case WPR_WSTRING:362 if (!arg->lpcwstr_view) arg->lpcwstr_view = null_stringW;363 for (len = 0; !format->precision || (len < format->precision); len++)364 if (!*(arg->lpcwstr_view + len)) break;365 if (len > maxlen) len = maxlen;366 return (format->precision = len);367 case WPR_SIGNED:368 len = sprintf( number, "%d", arg->int_view );369 break;370 case WPR_UNSIGNED:371 len = sprintf( number, "%u", (UINT)arg->int_view );372 break;373 case WPR_HEXA:374 len = sprintf( number,375 (format->flags & WPRINTF_UPPER_HEX) ? "%X" : "%x",376 (UINT)arg->int_view);377 if (format->flags & WPRINTF_PREFIX_HEX) len += 2;378 break;379 default:380 return 0;381 }382 if (len > maxlen) len = maxlen;383 if (format->precision < len) format->precision = len;384 if (format->precision > maxlen) format->precision = maxlen;385 if ((format->flags & WPRINTF_ZEROPAD) && (format->width > format->precision))386 format->precision = format->width;387 return len;388 }389 390 /***********************************************************************391 * WPRINTF_ExtractVAPtr (Not a Windows API)392 */393 static WPRINTF_DATA WPRINTF_ExtractVAPtr( WPRINTF_FORMAT *format, va_list* args )394 {395 WPRINTF_DATA result;396 switch(format->type)397 {398 case WPR_WCHAR:399 result.wchar_view = va_arg( *args, WCHAR ); break;400 case WPR_CHAR:401 result.char_view = va_arg( *args, CHAR ); break;402 case WPR_STRING:403 result.lpcstr_view = va_arg( *args, LPCSTR); break;404 case WPR_WSTRING:405 result.lpcwstr_view = va_arg( *args, LPCWSTR); break;406 case WPR_HEXA:407 case WPR_SIGNED:408 case WPR_UNSIGNED:409 result.int_view = va_arg( *args, INT ); break;410 default:411 result.wchar_view = 0; break;412 }413 return result;414 }415 416 /***********************************************************************417 * wvsnprintfA (Not a Windows API)418 */419 INT WINAPI wvsnprintfA( LPSTR buffer, UINT maxlen, LPCSTR spec,420 va_list args )421 {422 WPRINTF_FORMAT format;423 LPSTR p = buffer;424 UINT i, len;425 CHAR number[20];426 WPRINTF_DATA argData;427 428 while (*spec && (maxlen > 1))429 {430 if (*spec != '%') { *p++ = *spec++; maxlen--; continue; }431 spec++;432 if (*spec == '%') { *p++ = *spec++; maxlen--; continue; }433 spec += WPRINTF_ParseFormatA( spec, &format );434 argData = WPRINTF_ExtractVAPtr( &format, &args );435 len = WPRINTF_GetLen( &format, &argData, number, maxlen - 1 );436 if (!(format.flags & WPRINTF_LEFTALIGN))437 for (i = format.precision; i < format.width; i++, maxlen--)438 *p++ = ' ';439 switch(format.type)440 {441 case WPR_WCHAR:442 *p = argData.wchar_view;443 if (*p != '\0') p++;444 else if (format.width > 1) *p++ = ' ';445 else len = 0;446 break;447 case WPR_CHAR:448 *p = argData.char_view;449 if (*p != '\0') p++;450 else if (format.width > 1) *p++ = ' ';451 else len = 0;452 break;453 case WPR_STRING:454 memcpy( p, argData.lpcstr_view, len );455 p += len;456 break;457 case WPR_WSTRING:458 {459 LPCWSTR ptr = argData.lpcwstr_view;460 for (i = 0; i < len; i++) *p++ = (CHAR)*ptr++;461 }462 break;463 case WPR_HEXA:464 if ((format.flags & WPRINTF_PREFIX_HEX) && (maxlen > 3))465 {466 *p++ = '0';467 *p++ = (format.flags & WPRINTF_UPPER_HEX) ? 'X' : 'x';468 maxlen -= 2;469 len -= 2;470 format.precision -= 2;471 format.width -= 2;472 }473 /* fall through */474 case WPR_SIGNED:475 case WPR_UNSIGNED:476 for (i = len; i < format.precision; i++, maxlen--) *p++ = '0';477 memcpy( p, number, len );478 p += len;479 /* Go to the next arg */480 break;481 case WPR_UNKNOWN:482 continue;483 }484 if (format.flags & WPRINTF_LEFTALIGN)485 for (i = format.precision; i < format.width; i++, maxlen--)486 *p++ = ' ';487 maxlen -= len;488 }489 *p = 0;490 //TRACE("%s\n",buffer);491 return (maxlen > 1) ? (INT)(p - buffer) : -1;492 }493 494 495 /***********************************************************************496 * wvsnprintfW (Not a Windows API)497 */498 INT WINAPI wvsnprintfW( LPWSTR buffer, UINT maxlen, LPCWSTR spec,499 va_list args )500 {501 WPRINTF_FORMAT format;502 LPWSTR p = buffer;503 UINT i, len;504 CHAR number[20];505 506 while (*spec && (maxlen > 1))507 {508 if (*spec != '%') { *p++ = *spec++; maxlen--; continue; }509 spec++;510 if (*spec == '%') { *p++ = *spec++; maxlen--; continue; }511 spec += WPRINTF_ParseFormatW( spec, &format );512 len = WPRINTF_GetLen( &format, (WPRINTF_DATA*)args, number, maxlen - 1 );513 if (!(format.flags & WPRINTF_LEFTALIGN))514 for (i = format.precision; i < format.width; i++, maxlen--)515 *p++ = ' ';516 switch(format.type)517 {518 case WPR_WCHAR:519 *p = va_arg( args, WCHAR );520 if (*p != '\0') p++;521 else if (format.width > 1) *p++ = ' ';522 else len = 0;523 break;524 case WPR_CHAR:525 *p = (WCHAR)va_arg( args, CHAR );526 if (*p != '\0') p++;527 else if (format.width > 1) *p++ = ' ';528 else len = 0;529 break;530 case WPR_STRING:531 {532 LPCSTR ptr = va_arg( args, LPCSTR );533 for (i = 0; i < len; i++) *p++ = (WCHAR)*ptr++;534 }535 break;536 case WPR_WSTRING:537 if (len) memcpy( p, va_arg( args, LPCWSTR ), len * sizeof(WCHAR) );538 p += len;539 break;540 case WPR_HEXA:541 if ((format.flags & WPRINTF_PREFIX_HEX) && (maxlen > 3))542 {543 *p++ = '0';544 *p++ = (format.flags & WPRINTF_UPPER_HEX) ? 'X' : 'x';545 maxlen -= 2;546 len -= 2;547 format.precision -= 2;548 format.width -= 2;549 }550 /* fall through */551 case WPR_SIGNED:552 case WPR_UNSIGNED:553 for (i = len; i < format.precision; i++, maxlen--) *p++ = '0';554 for (i = 0; i < len; i++) *p++ = (WCHAR)number[i];555 (void)va_arg( args, INT ); /* Go to the next arg */556 break;557 case WPR_UNKNOWN:558 continue;559 }560 if (format.flags & WPRINTF_LEFTALIGN)561 for (i = format.precision; i < format.width; i++, maxlen--)562 *p++ = ' ';563 maxlen -= len;564 }565 *p = 0;566 return (maxlen > 1) ? (INT)(p - buffer) : -1;567 }568 569 /***********************************************************************570 * wsnprintfA (Not a Windows API)571 */572 INT WINAPIV wsnprintfA( LPSTR buffer, UINT maxlen, LPCSTR spec, ... )573 {574 va_list valist;575 INT res;576 577 va_start( valist, spec );578 res = wvsnprintfA( buffer, maxlen, spec, valist );579 va_end( valist );580 return res;581 }582 583 /***********************************************************************584 * wsnprintfW (Not a Windows API)585 */586 INT WINAPIV wsnprintfW( LPWSTR buffer, UINT maxlen, LPCWSTR spec, ... )587 {588 va_list valist;589 INT res;590 591 va_start( valist, spec );592 res = wvsnprintfW( buffer, maxlen, spec, valist );593 va_end( valist );594 return res;595 }596 597 598 193 /***************************************************************************** 599 194 * Name : DWORD GetSystemTimeAsFileTime -
trunk/src/ole32/initterm.cpp
r5602 r6375 36 36 #include <initdll.h> 37 37 38 extern "C" {39 //Win32 resource table (produced by wrc)40 extern DWORD _Resource_PEResTab;41 }42 static HMODULE dllHandle = 0;43 44 BOOL WINAPI OLE32_DllEntryPoint(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad);45 //******************************************************************************46 //******************************************************************************47 BOOL WINAPI LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)48 {49 switch (fdwReason)50 {51 case DLL_PROCESS_ATTACH:52 case DLL_THREAD_ATTACH:53 case DLL_THREAD_DETACH:54 return OLE32_DllEntryPoint(hinstDLL, fdwReason, fImpLoad);55 56 case DLL_PROCESS_DETACH:57 OLE32_DllEntryPoint(hinstDLL, fdwReason, fImpLoad);58 ctordtorTerm();59 return TRUE;60 }61 return FALSE;62 }63 38 /****************************************************************************/ 64 39 /* _DLL_InitTerm is the function that gets called by the operating system */ … … 88 63 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/ 89 64 90 dllHandle = RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab); 91 if(dllHandle == 0) 92 return 0UL; 93 94 break; 65 return inittermOle32(hModule, ulFlag); 95 66 } 96 67 case 1 : 97 if(dllHandle) { 98 UnregisterLxDll(dllHandle); 99 } 68 inittermOle32(hModule, ulFlag); 69 ctordtorTerm(); 100 70 break; 101 71 -
trunk/src/ole32/ole32.mak
r5929 r6375 1 # $Id: ole32.mak,v 1.1 1 2001-06-08 06:50:52sandervl Exp $1 # $Id: ole32.mak,v 1.12 2001-07-20 15:38:24 sandervl Exp $ 2 2 3 3 # … … 49 49 $(OBJDIR)\ole32_main.obj \ 50 50 $(OBJDIR)\initterm.obj \ 51 $(OBJDIR)\initole32.obj \ 51 52 $(OBJDIR)\stg_bigblockfile.obj \ 52 53 $(OBJDIR)\stg_stream.obj \ -
trunk/src/rpcrt4/initterm.cpp
r5135 r6375 37 37 #include <initdll.h> 38 38 39 extern "C" {40 //Win32 resource table (produced by wrc)41 extern DWORD _Resource_PEResTab;42 }43 static HMODULE dllHandle = 0;44 45 //******************************************************************************46 //******************************************************************************47 BOOL WINAPI LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)48 {49 switch (fdwReason)50 {51 case DLL_PROCESS_ATTACH:52 return TRUE;53 54 case DLL_THREAD_ATTACH:55 case DLL_THREAD_DETACH:56 return TRUE;57 58 case DLL_PROCESS_DETACH:59 ctordtorTerm();60 return TRUE;61 }62 return FALSE;63 }64 39 /****************************************************************************/ 65 40 /* _DLL_InitTerm is the function that gets called by the operating system */ … … 88 63 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/ 89 64 90 dllHandle = RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab); 91 if(dllHandle == 0) 92 return 0UL; 65 return inittermRpcrt4(hModule, ulFlag); 93 66 94 //SvL: Must be done here as the socket calls trash FS! 95 /* Init the Uuid subsystem */ 96 UuidInit(); 97 67 case 1 : 68 inittermRpcrt4(hModule, ulFlag); 69 ctordtorTerm(); 98 70 break; 99 71 100 case 1 :101 if(dllHandle) {102 UnregisterLxDll(dllHandle);103 }104 break;105 72 default : 106 73 return 0UL; -
trunk/src/rpcrt4/makefile
r4719 r6375 1 # $Id: makefile,v 1. 5 2000-12-02 23:57:29 birdExp $1 # $Id: makefile,v 1.6 2001-07-20 15:38:52 sandervl Exp $ 2 2 3 3 # … … 20 20 $(OBJDIR)\binding.obj \ 21 21 $(OBJDIR)\initterm.obj \ 22 $(OBJDIR)\initrpcrt4.obj \ 22 23 $(OBJDIR)\mgmt.obj \ 23 24 $(OBJDIR)\rpcrt4rsrc.obj \ -
trunk/src/shell32/initterm.cpp
r5309 r6375 36 36 #include <initdll.h> 37 37 38 extern "C" {39 //Win32 resource table (produced by wrc)40 extern DWORD _Resource_PEResTab;41 }42 static HMODULE dllHandle = 0;43 44 BOOL WINAPI Shell32LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad);45 46 //******************************************************************************47 //******************************************************************************48 BOOL WINAPI OdinLibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)49 {50 BOOL ret;51 52 switch (fdwReason)53 {54 case DLL_PROCESS_ATTACH:55 case DLL_THREAD_ATTACH:56 case DLL_THREAD_DETACH:57 return Shell32LibMain(hinstDLL, fdwReason, fImpLoad);58 59 case DLL_PROCESS_DETACH:60 ret = Shell32LibMain(hinstDLL, fdwReason, fImpLoad);61 ctordtorTerm();62 return ret;63 }64 return FALSE;65 }66 38 /****************************************************************************/ 67 39 /* _DLL_InitTerm is the function that gets called by the operating system */ … … 88 60 89 61 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/ 62 return inittermShell32(hModule, ulFlag); 90 63 91 dllHandle = RegisterLxDll(hModule, OdinLibMain, (PVOID)&_Resource_PEResTab,92 SHELL32_MAJORIMAGE_VERSION, SHELL32_MINORIMAGE_VERSION,93 IMAGE_SUBSYSTEM_WINDOWS_GUI);94 if(dllHandle == 0)95 return 0UL;96 97 break;98 64 case 1 : 99 if(dllHandle) { 100 UnregisterLxDll(dllHandle); 101 } 65 inittermShell32(hModule, ulFlag); 66 ctordtorTerm(); 102 67 break; 103 68 default : -
trunk/src/shell32/makefile
r5618 r6375 1 # $Id: makefile,v 1.3 3 2001-04-28 13:33:44sandervl Exp $1 # $Id: makefile,v 1.34 2001-07-20 15:37:22 sandervl Exp $ 2 2 3 3 # … … 25 25 OBJS = \ 26 26 $(OBJDIR)\initterm.obj \ 27 $(OBJDIR)\initshell32.obj \ 27 28 $(OBJDIR)\brsfolder.obj \ 28 29 $(OBJDIR)\changenotify.obj \ -
trunk/src/shlwapi/makefile
r6251 r6375 1 # $Id: makefile,v 1.2 2 2001-07-08 11:12:49sandervl Exp $1 # $Id: makefile,v 1.23 2001-07-20 15:37:52 sandervl Exp $ 2 2 3 3 # … … 25 25 $(OBJDIR)\reg.obj \ 26 26 $(OBJDIR)\regstream.obj \ 27 $(OBJDIR)\shlwapiguid.obj \ 27 28 $(OBJDIR)\pathcpp.obj \ 28 29 $(OBJDIR)\path.obj \ -
trunk/src/shlwapi/regstream.c
r4081 r6375 14 14 #define ICOM_CINTERFACE 1 15 15 #define CINTERFACE 1 16 #define INITGUID17 16 18 17 #endif -
trunk/src/shlwapi/shlwapi.cpp
r5472 r6375 1 /* $Id: shlwapi.cpp,v 1.1 0 2001-04-04 09:05:50sandervl Exp $ */1 /* $Id: shlwapi.cpp,v 1.11 2001-07-20 15:37:52 sandervl Exp $ */ 2 2 3 3 /* … … 70 70 } 71 71 72 72 #if 0 73 73 // ---------------------------------------------------------------------- 74 74 // WINE_StringFromCLSID … … 124 124 return strLen; // Num CHARACTERS including 0 terminator 125 125 } 126 126 #endif 127 127 128 128 /***************************************************************************** -
trunk/src/shlwapi/string_odin.cpp
r5618 r6375 1 /* $Id: string_odin.cpp,v 1. 2 2001-04-28 13:32:21sandervl Exp $ */1 /* $Id: string_odin.cpp,v 1.3 2001-07-20 15:37:53 sandervl Exp $ */ 2 2 3 3 /* … … 95 95 96 96 97 #if 0 97 98 /************************************************************************* 98 99 * OleStrToStrN [SHELL32.78] … … 180 181 return StrToOleStrA (lpWideCharStr, (LPCSTR)lpString); 181 182 } 182 183 #endif 183 184 184 185 -
trunk/src/user32/Makefile
r6254 r6375 1 # $Id: Makefile,v 1.8 7 2001-07-08 15:51:41sandervl Exp $1 # $Id: Makefile,v 1.88 2001-07-20 15:34:15 sandervl Exp $ 2 2 3 3 # … … 40 40 $(OBJDIR)\char.obj \ 41 41 $(OBJDIR)\initterm.obj \ 42 $(OBJDIR)\inituser32.obj \ 42 43 $(OBJDIR)\uitools.obj \ 43 44 $(OBJDIR)\unknown.obj \ -
trunk/src/user32/USER32.DEF
r6149 r6375 1 ; $Id: USER32.DEF,v 1.6 0 2001-07-03 13:23:31sandervl Exp $1 ; $Id: USER32.DEF,v 1.61 2001-07-20 15:34:15 sandervl Exp $ 2 2 3 3 LIBRARY USER32 INITINSTANCE TERMINSTANCE … … 671 671 672 672 _wvsnprintfA@16 @2010 NONAME 673 ;Export for MSACM32 674 _wsnprintfA @2100 NONAME 673 675 674 676 _KEYBOARD_Enable@4 @2011 NONAME -
trunk/src/user32/dbglocal.cpp
r3679 r6375 1 /* $Id: dbglocal.cpp,v 1. 6 2000-06-08 18:10:09sandervl Exp $ */1 /* $Id: dbglocal.cpp,v 1.7 2001-07-20 15:34:15 sandervl Exp $ */ 2 2 3 3 /* … … 16 16 #ifdef DEBUG 17 17 18 USHORT DbgEnabled [DBG_MAXFILES] = {0};19 USHORT DbgEnabledLvl2 [DBG_MAXFILES] = {0};18 USHORT DbgEnabledUSER32[DBG_MAXFILES] = {0}; 19 USHORT DbgEnabledLvl2USER32[DBG_MAXFILES] = {0}; 20 20 21 char *DbgFileNames[DBG_MAXFILES] =21 static char *DbgFileNames[DBG_MAXFILES] = 22 22 { 23 23 "user32", … … 92 92 //****************************************************************************** 93 93 //****************************************************************************** 94 void ParseLogStatus ()94 void ParseLogStatusUSER32() 95 95 { 96 96 char *envvar = getenv(DBG_ENVNAME); … … 100 100 101 101 for(i=0;i<DBG_MAXFILES;i++) { 102 DbgEnabled [i] = 1;102 DbgEnabledUSER32[i] = 1; 103 103 } 104 104 … … 108 108 if(*(dbgvar-1) == '-') { 109 109 for(i=0;i<DBG_MAXFILES;i++) { 110 DbgEnabled [i] = 0;110 DbgEnabledUSER32[i] = 0; 111 111 } 112 112 } … … 116 116 if(dbgvar) { 117 117 if(*(dbgvar-1) == '-') { 118 DbgEnabled [i] = 0;118 DbgEnabledUSER32[i] = 0; 119 119 } 120 120 else 121 121 if(*(dbgvar-1) == '+') { 122 DbgEnabled [i] = 1;122 DbgEnabledUSER32[i] = 1; 123 123 } 124 124 } … … 130 130 if(*(dbgvar-1) == '+') { 131 131 for(i=0;i<DBG_MAXFILES;i++) { 132 DbgEnabledLvl2 [i] = 1;132 DbgEnabledLvl2USER32[i] = 1; 133 133 } 134 134 } … … 138 138 if(dbgvar) { 139 139 if(*(dbgvar-1) == '-') { 140 DbgEnabledLvl2 [i] = 0;140 DbgEnabledLvl2USER32[i] = 0; 141 141 } 142 142 else 143 143 if(*(dbgvar-1) == '+') { 144 DbgEnabledLvl2 [i] = 1;144 DbgEnabledLvl2USER32[i] = 1; 145 145 } 146 146 } -
trunk/src/user32/dbglocal.h
r3679 r6375 1 /* $Id: dbglocal.h,v 1. 5 2000-06-08 18:10:09sandervl Exp $ */1 /* $Id: dbglocal.h,v 1.6 2001-07-20 15:34:15 sandervl Exp $ */ 2 2 3 3 /* … … 15 15 #ifdef DEBUG 16 16 //Parses environment variable for selective enabling/disabling of logging 17 void ParseLogStatus ();17 void ParseLogStatusUSER32(); 18 18 19 19 #define DBG_ENVNAME "dbg_user32" … … 90 90 #define DBG_MAXFILES 68 91 91 92 extern USHORT DbgEnabled [DBG_MAXFILES];93 extern USHORT DbgEnabledLvl2 [DBG_MAXFILES];92 extern USHORT DbgEnabledUSER32[DBG_MAXFILES]; 93 extern USHORT DbgEnabledLvl2USER32[DBG_MAXFILES]; 94 94 95 95 #ifdef dprintf … … 97 97 #endif 98 98 99 #define dprintf(a) if(DbgEnabled [DBG_LOCALLOG] == 1) WriteLog a99 #define dprintf(a) if(DbgEnabledUSER32[DBG_LOCALLOG] == 1) WriteLog a 100 100 101 101 #ifdef dprintf2 … … 103 103 #endif 104 104 105 #define dprintf2(a) if(DbgEnabledLvl2 [DBG_LOCALLOG] == 1) WriteLog a105 #define dprintf2(a) if(DbgEnabledLvl2USER32[DBG_LOCALLOG] == 1) WriteLog a 106 106 107 107 #else 108 108 109 #define ParseLogStatus ()109 #define ParseLogStatusUSER32() 110 110 111 111 #endif //DEBUG -
trunk/src/user32/dc.cpp
r5935 r6375 1 /* $Id: dc.cpp,v 1.1 09 2001-06-09 14:50:16 sandervl Exp $ */1 /* $Id: dc.cpp,v 1.110 2001-07-20 15:34:16 sandervl Exp $ */ 2 2 3 3 /* … … 76 76 77 77 #ifdef DEBUG 78 #define dprintfRegion(a,b,c) if(DbgEnabledLvl2 [DBG_LOCALLOG] == 1) dprintfRegion1(a,b,c)78 #define dprintfRegion(a,b,c) if(DbgEnabledLvl2USER32[DBG_LOCALLOG] == 1) dprintfRegion1(a,b,c) 79 79 80 80 void dprintfRegion1(HPS hps, HWND hWnd, HRGN hrgnClip) -
trunk/src/user32/gen_object.cpp
r5964 r6375 1 /* $Id: gen_object.cpp,v 1.1 1 2001-06-11 14:37:46 sandervl Exp $ */1 /* $Id: gen_object.cpp,v 1.12 2001-07-20 15:34:16 sandervl Exp $ */ 2 2 /* 3 3 * Generic Object Class for OS/2 … … 91 91 LONG GenericObject::addRef() 92 92 { 93 dprintf2(("addRef %x -> refcount %x", this, refCount+1));93 //// dprintf2(("addRef %x -> refcount %x", this, refCount+1)); 94 94 return InterlockedIncrement(&refCount); 95 95 } … … 99 99 LONG GenericObject::release() 100 100 { 101 dprintf2(("release %x -> refcount %x", this, refCount-1));101 //// dprintf2(("release %x -> refcount %x", this, refCount-1)); 102 102 #ifdef DEBUG 103 103 if(refCount-1 < 0) { -
trunk/src/user32/initterm.cpp
r6339 r6375 37 37 #include <winconst.h> 38 38 #include <odinlx.h> 39 #include <spy.h>40 #include <monitor.h>41 #include "pmwindow.h"42 #include "win32wdesktop.h"43 #include "syscolor.h"44 39 #include "initterm.h" 45 40 #include <exitlist.h> … … 57 52 static void APIENTRY cleanup(ULONG reason); 58 53 59 extern "C" {60 //Win32 resource table (produced by wrc)61 extern DWORD _Resource_PEResTab;62 }63 DWORD hInstanceUser32 = 0;64 54 BOOL fVersionWarp3 = FALSE; 65 55 … … 87 77 case 0 : 88 78 ctordtorInit(); 89 ParseLogStatus();90 91 79 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/ 92 93 hInstanceUser32 = RegisterLxDll(hModule, 0, (PVOID)&_Resource_PEResTab,94 USER32_MAJORIMAGE_VERSION, USER32_MINORIMAGE_VERSION,95 IMAGE_SUBSYSTEM_WINDOWS_GUI);96 if(hInstanceUser32 == 0)97 return 0UL;98 99 dprintf(("user32 init %s %s (%x)", __DATE__, __TIME__, DLLENTRYPOINT_NAME));100 80 101 81 rc = DosQuerySysInfo(QSV_VERSION_MAJOR, QSV_VERSION_MINOR, version, sizeof(version)); … … 115 95 return 0UL; 116 96 117 //SvL: Try to start communication with our message spy queue server 118 InitSpyQueue(); 119 120 //SvL: Init win32 PM classes 121 if(InitPM() == FALSE) { 122 return 0UL; 123 } 124 125 //SvL: 18-7-'98, Register system window classes (button, listbox etc etc) 126 //CB: register internal classes 127 RegisterSystemClasses(hModule); 128 129 //CB: initialize PM monitor driver 130 MONITOR_Initialize(&MONITOR_PrimaryMonitor); 131 97 rc = inittermUser32(hModule, ulFlag); 132 98 break; 133 99 case 1 : 134 if(hInstanceUser32) { 135 UnregisterLxDll(hInstanceUser32); 136 } 100 rc = inittermUser32(hModule, ulFlag); 137 101 break; 138 102 default : … … 148 112 static void APIENTRY cleanup(ULONG ulReason) 149 113 { 150 dprintf(("user32 exit\n")); 151 //SvL: Causes PM hangs on some (a lot?) machines. Reason unknown. 152 //// RestoreCursor(); 153 DestroyDesktopWindow(); 154 Win32BaseWindow::DestroyAll(); 155 UnregisterSystemClasses(); 156 Win32WndClass::DestroyAll(); 157 MONITOR_Finalize(&MONITOR_PrimaryMonitor); 158 SYSCOLOR_Save(); 159 CloseSpyQueue(); 114 cleanupUser32(ulReason); 160 115 ctordtorTerm(); 161 dprintf(("user32 exit done\n"));162 116 163 117 DosExitList(EXLST_EXIT, cleanup); -
trunk/src/user32/msgbox.c
r3153 r6375 1 /* $Id: msgbox.c,v 1. 3 2000-03-18 16:13:37 cbratschiExp $ */1 /* $Id: msgbox.c,v 1.4 2001-07-20 15:34:16 sandervl Exp $ */ 2 2 /* 3 3 * Message boxes (based on Wine code) … … 366 366 } 367 367 368 #ifndef __WIN32OS2__ 368 369 /************************************************************************** 369 370 * FatalAppExit32A (KERNEL32.108) … … 386 387 ExitProcess(0); 387 388 } 389 #endif 388 390 389 391 /***************************************************************************** -
trunk/src/user32/win32wbase.cpp
r6317 r6375 1 /* $Id: win32wbase.cpp,v 1.27 6 2001-07-13 14:31:15sandervl Exp $ */1 /* $Id: win32wbase.cpp,v 1.277 2001-07-20 15:34:17 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 3837 3837 // else return hwnd; //OS/2 window handle 3838 3838 } 3839 #ifdef DEBUG 3840 LONG Win32BaseWindow::addRef() 3841 { 3842 dprintf2(("addRef %x %d", getWindowHandle(), getRefCount()+1)); 3843 return GenericObject::addRef(); 3844 } 3845 //****************************************************************************** 3846 //****************************************************************************** 3847 LONG Win32BaseWindow::release(char *function, int line) 3848 { 3849 dprintf2(("release %s %d %x %d", function, line, getWindowHandle(), getRefCount()-1)); 3850 return GenericObject::release(); 3851 } 3852 #endif 3839 3853 //****************************************************************************** 3840 3854 //****************************************************************************** -
trunk/src/user32/win32wbase.h
r6169 r6375 1 /* $Id: win32wbase.h,v 1.12 3 2001-07-04 17:46:05sandervl Exp $ */1 /* $Id: win32wbase.h,v 1.124 2001-07-20 15:34:18 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 36 36 #define CheckMagicDword(a) (a==WIN32PM_MAGIC) 37 37 38 #ifdef DEBUG 39 #define RELEASE_WNDOBJ(a) { a->release(__FUNCTION__, __LINE__); a = NULL; } 40 #else 38 41 #define RELEASE_WNDOBJ(a) { a->release(); a = NULL; } 42 #endif 39 43 40 44 typedef struct { … … 328 332 INT enumPropsExW(PROPENUMPROCEXW func, LPARAM lParam); 329 333 334 #ifdef DEBUG 335 LONG addRef(); 336 LONG release(char *function = __FUNCTION__, int line = __LINE__ ); 337 #endif 338 330 339 //Locates window in linked list and increases reference count (if found) 331 340 //Window object must be unreferenced after usage -
trunk/src/user32/wsprintf.cpp
r5271 r6375 645 645 return ( res == -1 ) ? 1024 : res; 646 646 } 647 648 /*********************************************************************** 649 * wsnprintfA (Not a Windows API) 650 */ 651 INT WINAPIV wsnprintfA( LPSTR buffer, UINT maxlen, LPCSTR spec, ... ) 652 { 653 va_list valist; 654 INT res; 655 656 va_start( valist, spec ); 657 res = wvsnprintfA( buffer, maxlen, spec, valist ); 658 va_end( valist ); 659 return res; 660 } 661 662 /*********************************************************************** 663 * wsnprintfW (Not a Windows API) 664 */ 665 INT WINAPIV wsnprintfW( LPWSTR buffer, UINT maxlen, LPCWSTR spec, ... ) 666 { 667 va_list valist; 668 INT res; 669 670 va_start( valist, spec ); 671 res = wvsnprintfW( buffer, maxlen, spec, valist ); 672 va_end( valist ); 673 return res; 674 } -
trunk/src/winmm/dbglocal.cpp
r5358 r6375 1 /* $Id: dbglocal.cpp,v 1. 5 2001-03-23 16:23:42sandervl Exp $ */1 /* $Id: dbglocal.cpp,v 1.6 2001-07-20 15:35:00 sandervl Exp $ */ 2 2 3 3 /* … … 16 16 #include "dbglocal.h" 17 17 18 USHORT DbgEnabled [DBG_MAXFILES] = {0};19 USHORT DbgEnabledLvl2 [DBG_MAXFILES] = {0};18 USHORT DbgEnabledWINMM[DBG_MAXFILES] = {0}; 19 USHORT DbgEnabledLvl2WINMM[DBG_MAXFILES] = {0}; 20 20 21 char *DbgFileNames[DBG_MAXFILES] =21 static char *DbgFileNames[DBG_MAXFILES] = 22 22 { 23 23 "os2timer", … … 47 47 //****************************************************************************** 48 48 //****************************************************************************** 49 void ParseLogStatus ()49 void ParseLogStatusWINMM() 50 50 { 51 51 char *envvar = getenv(DBG_ENVNAME); … … 55 55 56 56 for(i=0;i<DBG_MAXFILES;i++) { 57 DbgEnabled [i] = 1;57 DbgEnabledWINMM[i] = 1; 58 58 } 59 59 … … 65 65 if(*(dbgvar-1) == '-') { 66 66 for(i=0;i<DBG_MAXFILES;i++) { 67 DbgEnabled [i] = 0;67 DbgEnabledWINMM[i] = 0; 68 68 } 69 69 } … … 73 73 if(dbgvar) { 74 74 if(*(dbgvar-1) == '-') { 75 DbgEnabled [i] = 0;75 DbgEnabledWINMM[i] = 0; 76 76 } 77 77 else 78 78 if(*(dbgvar-1) == '+') { 79 DbgEnabled [i] = 1;79 DbgEnabledWINMM[i] = 1; 80 80 } 81 81 } … … 86 86 if(*(dbgvar-1) == '+') { 87 87 for(i=0;i<DBG_MAXFILES;i++) { 88 DbgEnabledLvl2 [i] = 1;88 DbgEnabledLvl2WINMM[i] = 1; 89 89 } 90 90 } … … 94 94 if(dbgvar) { 95 95 if(*(dbgvar-1) == '-') { 96 DbgEnabledLvl2 [i] = 0;96 DbgEnabledLvl2WINMM[i] = 0; 97 97 } 98 98 else 99 99 if(*(dbgvar-1) == '+') { 100 DbgEnabledLvl2 [i] = 1;100 DbgEnabledLvl2WINMM[i] = 1; 101 101 } 102 102 } -
trunk/src/winmm/dbglocal.h
r5358 r6375 1 /* $Id: dbglocal.h,v 1. 5 2001-03-23 16:23:42sandervl Exp $ */1 /* $Id: dbglocal.h,v 1.6 2001-07-20 15:35:00 sandervl Exp $ */ 2 2 3 3 /* … … 15 15 #ifdef DEBUG 16 16 //Parses environment variable for selective enabling/disabling of logging 17 void ParseLogStatus ();17 void ParseLogStatusWINMM(); 18 18 19 19 #define DBG_ENVNAME "dbg_winmm" … … 45 45 #define DBG_MAXFILES 23 46 46 47 extern USHORT DbgEnabled [DBG_MAXFILES];48 extern USHORT DbgEnabledLvl2 [DBG_MAXFILES];47 extern USHORT DbgEnabledWINMM[DBG_MAXFILES]; 48 extern USHORT DbgEnabledLvl2WINMM[DBG_MAXFILES]; 49 49 50 50 #ifdef dprintf … … 52 52 #endif 53 53 54 #define dprintf(a) if(DbgEnabled [DBG_LOCALLOG] == 1) WriteLog a54 #define dprintf(a) if(DbgEnabledWINMM[DBG_LOCALLOG] == 1) WriteLog a 55 55 56 56 #ifdef dprintf2 … … 58 58 #endif 59 59 60 #define dprintf2(a) if(DbgEnabledLvl2 [DBG_LOCALLOG] == 1) WriteLog a60 #define dprintf2(a) if(DbgEnabledLvl2WINMM[DBG_LOCALLOG] == 1) WriteLog a 61 61 62 62 #else 63 63 64 #define ParseLogStatus ()64 #define ParseLogStatusWINMM() 65 65 66 66 #endif //DEBUG -
trunk/src/winmm/initterm.cpp
r5873 r6375 46 46 #include "dbglocal.h" 47 47 48 BOOL MULTIMEDIA_MciInit(void);49 BOOL MULTIMEDIA_CreateIData(HINSTANCE hinstDLL);50 void MULTIMEDIA_DeleteIData(void);51 52 extern "C" {53 void IRTMidiShutdown(); // IRTMidi shutdown routine54 55 //Win32 resource table (produced by wrc)56 extern DWORD _Resource_PEResTab;57 }58 static HMODULE dllHandle = 0;59 60 //******************************************************************************61 //******************************************************************************62 BOOL WINAPI OdinLibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)63 {64 static BOOL bInitDone = FALSE;65 66 switch (fdwReason)67 {68 case DLL_PROCESS_ATTACH:69 {70 if (!MULTIMEDIA_CreateIData(hinstDLL))71 return FALSE;72 73 if (!bInitDone) { /* to be done only once */74 if (!MULTIMEDIA_MciInit() /*|| !MMDRV_Init() */ ) {75 MULTIMEDIA_DeleteIData();76 return FALSE;77 }78 bInitDone = TRUE;79 }80 DWORD dwVolume;81 82 dwVolume = PROFILE_GetOdinIniInt(WINMM_SECTION, DEFVOL_KEY, 100);83 dwVolume = (dwVolume*0xFFFF)/100;84 dwVolume = (dwVolume << 16) | dwVolume;85 WaveOut::setDefaultVolume(dwVolume);86 return TRUE;87 }88 89 case DLL_THREAD_ATTACH:90 case DLL_THREAD_DETACH:91 return TRUE;92 93 case DLL_PROCESS_DETACH:94 MULTIMEDIA_DeleteIData();95 auxOS2Close(); /* SvL: Close aux device if necessary */96 IRTMidiShutdown; /* JT: Shutdown RT Midi subsystem, if running. */97 ctordtorTerm();98 return TRUE;99 }100 return FALSE;101 }102 48 /****************************************************************************/ 103 49 /* _DLL_InitTerm is the function that gets called by the operating system */ … … 121 67 ctordtorInit(); 122 68 123 ParseLogStatus();124 125 69 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/ 126 dllHandle = RegisterLxDll(hModule, OdinLibMain, (PVOID)&_Resource_PEResTab); 127 if(dllHandle == 0) 128 return 0UL;/* Error */ 129 130 dprintf(("winmm init %s %s (%x)", __DATE__, __TIME__, DLLENTRYPOINT_NAME)); 131 break; 70 return inittermWinmm(hModule, ulFlag); 132 71 case 1 : 133 auxOS2Close(); /* SvL: Close aux device if necessary */ 134 if(dllHandle) { 135 UnregisterLxDll(dllHandle); 136 } 72 inittermWinmm(hModule, ulFlag); 73 ctordtorTerm(); 137 74 break; 138 75 default : -
trunk/src/winmm/mmio.cpp
r3932 r6375 1 /* $Id: mmio.cpp,v 1. 7 2000-08-02 17:18:33 birdExp $ */1 /* $Id: mmio.cpp,v 1.8 2001-07-20 15:35:00 sandervl Exp $ */ 2 2 /* 3 3 * MMIO functions … … 115 115 LONG count; 116 116 117 #ifdef __WIN32OS2__ 118 count = _lwrite((HFILE)lpmmioinfo->adwInfo[0], pch, cch); 119 #else 117 120 count = _hwrite((HFILE)lpmmioinfo->adwInfo[0], pch, cch); 121 #endif 118 122 if (count != -1) 119 123 lpmmioinfo->lDiskOffset += count; -
trunk/src/winmm/winmm.mak
r5359 r6375 1 # $Id: winmm.mak,v 1. 3 2001-03-23 16:23:47sandervl Exp $1 # $Id: winmm.mak,v 1.4 2001-07-20 15:35:01 sandervl Exp $ 2 2 3 3 # … … 40 40 $(OBJDIR)\midistrm.obj \ 41 41 $(OBJDIR)\initterm.obj \ 42 $(OBJDIR)\initwinmm.obj \ 42 43 $(OBJDIR)\mci.obj \ 43 44 $(OBJDIR)\joy.obj \ -
trunk/src/wsock32/dbglocal.cpp
r3229 r6375 1 /* $Id: dbglocal.cpp,v 1. 4 2000-03-24 19:28:05sandervl Exp $ */1 /* $Id: dbglocal.cpp,v 1.5 2001-07-20 15:41:04 sandervl Exp $ */ 2 2 3 3 /* … … 16 16 #ifdef DEBUG 17 17 18 USHORT DbgEnabled[DBG_MAXFILES]; 19 char *DbgFileNames[DBG_MAXFILES] = 18 USHORT DbgEnabledWSOCK32[DBG_MAXFILES] = {0}; 19 USHORT DbgEnabledLvl2WSOCK32[DBG_MAXFILES] = {0}; 20 21 static char *DbgFileNames[DBG_MAXFILES] = 20 22 { 21 23 "initterm", … … 29 31 //****************************************************************************** 30 32 //****************************************************************************** 31 void ParseLogStatus ()33 void ParseLogStatusWSOCK32() 32 34 { 33 35 char *envvar = getenv(DBG_ENVNAME); 36 char *envvar2= getenv(DBG_ENVNAME_LVL2); 34 37 char *dbgvar; 35 38 int i; 36 39 37 40 for(i=0;i<DBG_MAXFILES;i++) { 38 DbgEnabled [i] = 1;41 DbgEnabledWSOCK32[i] = 1; 39 42 } 40 43 … … 46 49 if(*(dbgvar-1) == '-') { 47 50 for(i=0;i<DBG_MAXFILES;i++) { 48 DbgEnabled [i] = 0;51 DbgEnabledWSOCK32[i] = 0; 49 52 } 50 53 } … … 54 57 if(dbgvar) { 55 58 if(*(dbgvar-1) == '-') { 56 DbgEnabled [i] = 0;59 DbgEnabledWSOCK32[i] = 0; 57 60 } 58 61 else 59 62 if(*(dbgvar-1) == '+') { 60 DbgEnabled [i] = 1;63 DbgEnabledWSOCK32[i] = 1; 61 64 } 65 } 66 } 67 if(envvar2) { 68 dbgvar = strstr(envvar2, "dll"); 69 if(dbgvar) { 70 if(*(dbgvar-1) == '+') { 71 for(i=0;i<DBG_MAXFILES;i++) { 72 DbgEnabledLvl2WSOCK32[i] = 1; 73 } 74 } 75 } 76 for(i=0;i<DBG_MAXFILES;i++) { 77 dbgvar = strstr(envvar2, DbgFileNames[i]); 78 if(dbgvar) { 79 if(*(dbgvar-1) == '-') { 80 DbgEnabledLvl2WSOCK32[i] = 0; 81 } 82 else 83 if(*(dbgvar-1) == '+') { 84 DbgEnabledLvl2WSOCK32[i] = 1; 85 } 86 } 62 87 } 63 88 } -
trunk/src/wsock32/dbglocal.h
r3229 r6375 1 /* $Id: dbglocal.h,v 1. 4 2000-03-24 19:28:05sandervl Exp $ */1 /* $Id: dbglocal.h,v 1.5 2001-07-20 15:41:04 sandervl Exp $ */ 2 2 3 3 /* … … 15 15 #ifdef DEBUG 16 16 //Parses environment variable for selective enabling/disabling of logging 17 void ParseLogStatus ();17 void ParseLogStatusWSOCK32(); 18 18 19 19 #define DBG_ENVNAME "dbg_wsock32" 20 #define DBG_ENVNAME_LVL2 "dbg_wsock32_lvl2" 20 21 21 22 #define DBG_initterm 0 … … 28 29 #define DBG_MAXFILES 7 29 30 30 extern USHORT DbgEnabled[DBG_MAXFILES]; 31 extern USHORT DbgEnabledWSOCK32[DBG_MAXFILES]; 32 extern USHORT DbgEnabledLvl2WSOCK32[DBG_MAXFILES]; 31 33 32 34 #ifdef dprintf … … 34 36 #endif 35 37 36 #define dprintf(a) if(DbgEnabled[DBG_LOCALLOG] == 1) WriteLog a 38 #define dprintf(a) if(DbgEnabledWSOCK32[DBG_LOCALLOG] == 1) WriteLog a 39 40 #ifdef dprintf2 41 #undef dprintf2 42 #endif 43 44 #define dprintf2(a) if(DbgEnabledLvl2WSOCK32[DBG_LOCALLOG] == 1) WriteLog a 37 45 38 46 #else 39 47 40 #define ParseLogStatus ()48 #define ParseLogStatusWSOCK32() 41 49 42 50 #endif //DEBUG -
trunk/src/wsock32/initterm.cpp
r5309 r6375 39 39 #include "dbglocal.h" 40 40 41 extern "C" {42 //Win32 resource table (produced by wrc)43 extern DWORD _Resource_PEResTab;44 }45 static HMODULE dllHandle = 0;46 47 //******************************************************************************48 //******************************************************************************49 BOOL WINAPI OdinLibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)50 {51 switch (fdwReason)52 {53 case DLL_PROCESS_ATTACH:54 return TRUE;55 56 case DLL_THREAD_ATTACH:57 case DLL_THREAD_DETACH:58 return TRUE;59 60 case DLL_PROCESS_DETACH:61 ctordtorTerm();62 return TRUE;63 }64 return FALSE;65 }66 41 /****************************************************************************/ 67 42 /* _DLL_InitTerm is the function that gets called by the operating system */ … … 87 62 ctordtorInit(); 88 63 89 ParseLogStatus();90 91 64 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/ 92 65 93 dllHandle = RegisterLxDll(hModule, OdinLibMain, (PVOID)&_Resource_PEResTab); 94 if(dllHandle == 0) 95 return 0UL; 66 return inittermWsock32(hModule, ulFlag); 96 67 68 case 1 : 69 inittermWsock32(hModule, ulFlag); 70 ctordtorTerm(); 97 71 break; 98 case 1 : 99 if(dllHandle) { 100 UnregisterLxDll(dllHandle); 101 } 102 break; 72 103 73 default : 104 74 return 0UL; -
trunk/src/wsock32/makefile
r6196 r6375 1 # $Id: makefile,v 1.3 0 2001-07-07 10:44:09 achimhaExp $1 # $Id: makefile,v 1.31 2001-07-20 15:41:05 sandervl Exp $ 2 2 3 3 # … … 30 30 $(OBJDIR)\wsock32rsrc.obj \ 31 31 $(OBJDIR)\initterm.obj \ 32 $(OBJDIR)\initwsock32.obj \ 32 33 $(OBJDIR)\asyncapi.obj \ 33 34 $(OBJDIR)\asyncthread.obj \
Note:
See TracChangeset
for help on using the changeset viewer.