Avoid using the MapHModule functions.

This commit is contained in:
Alexandre Julliard 2003-05-16 20:17:52 +00:00
parent 1ed73fae13
commit 54100873d3
4 changed files with 18 additions and 19 deletions

View File

@ -221,7 +221,7 @@ static LRESULT CALLBACK call_WH_CBT( INT code, WPARAM wp, LPARAM lp )
CREATESTRUCT16 cs16;
cs16.lpCreateParams = cbtcw32->lpcs->lpCreateParams;
cs16.hInstance = MapHModuleLS(cbtcw32->lpcs->hInstance);
cs16.hInstance = HINSTANCE_16(cbtcw32->lpcs->hInstance);
cs16.hMenu = HMENU_16(cbtcw32->lpcs->hMenu);
cs16.hwndParent = HWND_16(cbtcw32->lpcs->hwndParent);
cs16.cy = cbtcw32->lpcs->cy;
@ -524,7 +524,7 @@ LRESULT WINAPI CallNextHookEx16( HHOOK hhook, INT16 code, WPARAM16 wparam, LPARA
cbtcw32.hwndInsertAfter = WIN_Handle32( cbtcw16->hwndInsertAfter );
cs32.lpCreateParams = cs16->lpCreateParams;
cs32.hInstance = MapHModuleSL(cs16->hInstance);
cs32.hInstance = HINSTANCE_32(cs16->hInstance);
cs32.hMenu = HMENU_32(cs16->hMenu);
cs32.hwndParent = WIN_Handle32(cs16->hwndParent);
cs32.cy = cs16->cy;

View File

@ -1473,7 +1473,7 @@ INT16 WINAPI MessageBoxIndirect16( LPMSGBOXPARAMS16 msgbox )
msgbox32.cbSize = msgbox->cbSize;
msgbox32.hwndOwner = WIN_Handle32( msgbox->hwndOwner );
msgbox32.hInstance = MapHModuleSL(msgbox->hInstance);
msgbox32.hInstance = HINSTANCE_32(msgbox->hInstance);
msgbox32.lpszText = MapSL(msgbox->lpszText);
msgbox32.lpszCaption = MapSL(msgbox->lpszCaption);
msgbox32.dwStyle = msgbox->dwStyle;

View File

@ -260,13 +260,14 @@ static TDB *TASK_Create( NE_MODULE *pModule, UINT16 cmdShow, TEB *teb, LPCSTR cm
TDB *pTask;
char name[10];
FARPROC16 proc;
HMODULE16 hModule = pModule ? pModule->self : 0;
/* Allocate the task structure */
hTask = GlobalAlloc16( GMEM_FIXED | GMEM_ZEROINIT, sizeof(TDB) );
if (!hTask) return NULL;
pTask = TASK_GetPtr( hTask );
FarSetOwner16( hTask, pModule->self );
FarSetOwner16( hTask, hModule );
/* Fill the task structure */
@ -275,14 +276,14 @@ static TDB *TASK_Create( NE_MODULE *pModule, UINT16 cmdShow, TEB *teb, LPCSTR cm
if (teb && teb->tibflags & TEBF_WIN32)
{
pTask->flags |= TDBF_WIN32;
pTask->hInstance = pModule->self;
pTask->hInstance = hModule;
pTask->hPrevInstance = 0;
/* NOTE: for 16-bit tasks, the instance handles are updated later on
in NE_InitProcess */
}
pTask->version = pModule->expected_version;
pTask->hModule = pModule->self;
pTask->version = pModule ? pModule->expected_version : 0x0400;
pTask->hModule = hModule;
pTask->hParent = GetCurrentTask();
pTask->magic = TDB_MAGIC;
pTask->nCmdShow = cmdShow;
@ -299,13 +300,16 @@ static TDB *TASK_Create( NE_MODULE *pModule, UINT16 cmdShow, TEB *teb, LPCSTR cm
/* Copy the module name */
GetModuleName16( pModule->self, name, sizeof(name) );
strncpy( pTask->module_name, name, sizeof(pTask->module_name) );
if (hModule)
{
GetModuleName16( hModule, name, sizeof(name) );
strncpy( pTask->module_name, name, sizeof(pTask->module_name) );
}
/* Allocate a selector for the PDB */
pTask->hPDB = GLOBAL_CreateBlock( GMEM_FIXED, &pTask->pdb, sizeof(PDB16),
pModule->self, WINE_LDT_FLAGS_DATA );
hModule, WINE_LDT_FLAGS_DATA );
/* Fill the PDB */
@ -416,8 +420,7 @@ void TASK_CreateMainTask(void)
GetStartupInfoA( &startup_info );
if (startup_info.dwFlags & STARTF_USESHOWWINDOW) cmdShow = startup_info.wShowWindow;
pTask = TASK_Create( (NE_MODULE *)GlobalLock16( MapHModuleLS(GetModuleHandleA(0)) ),
cmdShow, NtCurrentTeb(), NULL, 0 );
pTask = TASK_Create( NULL, cmdShow, NtCurrentTeb(), NULL, 0 );
if (!pTask)
{
ERR("could not create task for main process\n");

View File

@ -754,9 +754,7 @@ static HICON CURSORICON_Load(HINSTANCE hInstance, LPCWSTR name,
/* Normalize hInstance (must be uniquely represented for icon cache) */
if ( HIWORD( hInstance ) )
hInstance = HINSTANCE_32(MapHModuleLS( hInstance ));
else
if (!HIWORD( hInstance ))
hInstance = HINSTANCE_32(GetExePtr( HINSTANCE_16(hInstance) ));
/* Get directory resource ID */
@ -993,8 +991,7 @@ HCURSOR WINAPI CreateCursor( HINSTANCE hInstance,
info.bPlanes = 1;
info.bBitsPerPixel = 1;
return HICON_32(CreateCursorIconIndirect16(MapHModuleLS(hInstance), &info,
lpANDbits, lpXORbits));
return HICON_32(CreateCursorIconIndirect16(0, &info, lpANDbits, lpXORbits));
}
@ -1084,8 +1081,7 @@ HICON WINAPI CreateIcon(
info.bPlanes = bPlanes;
info.bBitsPerPixel = bBitsPixel;
hIcon=HICON_32(CreateCursorIconIndirect16(MapHModuleLS(hInstance), &info,
lpANDbits, lpXORbits));
hIcon=HICON_32(CreateCursorIconIndirect16(0, &info, lpANDbits, lpXORbits));
} else {
ICONINFO iinfo;
BITMAPINFO bmi;