Moved standard syslevel APIs declaration to winbase.h. Use exported syslevel function wherever possible. Moved SEGPTR declaration to windef16.h.
diff --git a/loader/module.c b/loader/module.c index ae2d298..d2c0fb8 100644 --- a/loader/module.c +++ b/loader/module.c
@@ -17,7 +17,6 @@ #include "heap.h" #include "neexe.h" #include "process.h" -#include "syslevel.h" #include "selectors.h" #include "debugtools.h" #include "callback.h" @@ -798,9 +797,10 @@ if (ret == 21) /* 32-bit module */ { - SYSLEVEL_ReleaseWin16Lock(); + DWORD count; + ReleaseThunkLock( &count ); ret = WinExec( lpCmdLine, nCmdShow ); - SYSLEVEL_RestoreWin16Lock(); + RestoreThunkLock( count ); } return ret; } @@ -1452,11 +1452,11 @@ HMODULE WINAPI LoadLibrary32_16( LPCSTR libname ) { HMODULE hModule; + DWORD count; - SYSLEVEL_ReleaseWin16Lock(); + ReleaseThunkLock( &count ); hModule = LoadLibraryA( libname ); - SYSLEVEL_RestoreWin16Lock(); - + RestoreThunkLock( count ); return hModule; }
diff --git a/loader/ne/module.c b/loader/ne/module.c index fa2cd39..4111aa8 100644 --- a/loader/ne/module.c +++ b/loader/ne/module.c
@@ -22,7 +22,6 @@ #include "global.h" #include "process.h" #include "snoop.h" -#include "syslevel.h" #include "builtin16.h" #include "stackframe.h" #include "debugtools.h" @@ -1120,7 +1119,7 @@ SEGTABLEENTRY *pSegTable = NE_SEG_TABLE( pModule ); WORD sp; - SYSLEVEL_EnterWin16Lock(); + _EnterWin16Lock(); if ( pModule->count > 0 ) { @@ -1197,7 +1196,7 @@ ExitThread( LOWORD(context.Eax) ); } - SYSLEVEL_LeaveWin16Lock(); + _LeaveWin16Lock(); ExitThread( hInstance ); }
diff --git a/loader/task.c b/loader/task.c index 4d3bf8d..7491088 100644 --- a/loader/task.c +++ b/loader/task.c
@@ -27,8 +27,8 @@ #include "thread.h" #include "toolhelp.h" #include "winnt.h" -#include "winsock.h" #include "syslevel.h" +#include "winsock.h" #include "debugtools.h" #include "services.h" #include "server.h" @@ -336,9 +336,9 @@ /* Add the task to the linked list */ - SYSLEVEL_EnterWin16Lock(); + _EnterWin16Lock(); TASK_LinkTask( hTask ); - SYSLEVEL_LeaveWin16Lock(); + _LeaveWin16Lock(); return TRUE; } @@ -384,12 +384,12 @@ DWORD lockCount; /* Enter the Win16Lock to protect global data structures */ - SYSLEVEL_EnterWin16Lock(); + _EnterWin16Lock(); pTask = (TDB *)GlobalLock16( GetCurrentTask() ); if ( !pTask ) { - SYSLEVEL_LeaveWin16Lock(); + _LeaveWin16Lock(); return; } @@ -486,7 +486,7 @@ enum { MODE_YIELD, MODE_SLEEP, MODE_WAKEUP } mode; DWORD lockCount; - SYSLEVEL_EnterWin16Lock(); + _EnterWin16Lock(); /* Check what we need to do */ hOldTask = GetCurrentTask(); @@ -521,7 +521,7 @@ else { /* nothing to do */ - SYSLEVEL_LeaveWin16Lock(); + _LeaveWin16Lock(); return; } } @@ -555,7 +555,7 @@ if ( mode == MODE_YIELD && hNewTask && hNewTask == hCurrentTask ) { TRACE("returning to the current task (%04x)\n", hCurrentTask ); - SYSLEVEL_LeaveWin16Lock(); + _LeaveWin16Lock(); /* Allow Win32 threads to thunk down even while a Win16 task is in a tight PeekMessage() or Yield() loop ... */ @@ -600,7 +600,7 @@ RestoreThunkLock( lockCount ); } - SYSLEVEL_LeaveWin16Lock(); + _LeaveWin16Lock(); } /***********************************************************************