Changed GetProcAddress16 and 16-bit resource functions to take normal

pointers instead of SEGPTRs.
Removed WIN16_GetTempDrive.
This commit is contained in:
Alexandre Julliard 2000-11-27 21:54:01 +00:00
parent cb45438be2
commit ac7efef3b5
24 changed files with 118 additions and 198 deletions

View file

@ -4229,29 +4229,26 @@ HMENU16 WINAPI LookupMenuHandle16( HMENU16 hmenu, INT16 id )
/********************************************************************** /**********************************************************************
* LoadMenu16 (USER.150) * LoadMenu16 (USER.150)
*/ */
HMENU16 WINAPI LoadMenu16( HINSTANCE16 instance, SEGPTR name ) HMENU16 WINAPI LoadMenu16( HINSTANCE16 instance, LPCSTR name )
{ {
HRSRC16 hRsrc; HRSRC16 hRsrc;
HGLOBAL16 handle; HGLOBAL16 handle;
HMENU16 hMenu; HMENU16 hMenu;
TRACE("(%04x,%s)\n", instance, debugres_a(name) );
if (HIWORD(name)) if (HIWORD(name))
{ {
char *str = (char *)PTR_SEG_TO_LIN( name ); if (name[0] == '#') name = (LPCSTR)atoi( name + 1 );
TRACE("(%04x,'%s')\n", instance, str );
if (str[0] == '#') name = (SEGPTR)atoi( str + 1 );
} }
else
TRACE("(%04x,%04x)\n",instance,LOWORD(name));
if (!name) return 0; if (!name) return 0;
/* check for Win32 module */ /* check for Win32 module */
if (HIWORD(instance)) if (HIWORD(instance)) return LoadMenuA( instance, name );
return LoadMenuA(instance,PTR_SEG_TO_LIN(name));
instance = GetExePtr( instance ); instance = GetExePtr( instance );
if (!(hRsrc = FindResource16( instance, name, RT_MENU16 ))) return 0; if (!(hRsrc = FindResource16( instance, name, RT_MENUA ))) return 0;
if (!(handle = LoadResource16( instance, hRsrc ))) return 0; if (!(handle = LoadResource16( instance, hRsrc ))) return 0;
hMenu = LoadMenuIndirect16(LockResource16(handle)); hMenu = LoadMenuIndirect16(LockResource16(handle));
FreeResource16( handle ); FreeResource16( handle );

View file

@ -1372,8 +1372,8 @@ BOOL16 WINAPI ChooseColor16( LPCHOOSECOLOR16 lpChCol )
{ {
HANDLE16 hResInfo; HANDLE16 hResInfo;
if (!(hResInfo = FindResource16(lpChCol->hInstance, if (!(hResInfo = FindResource16(lpChCol->hInstance,
lpChCol->lpTemplateName, PTR_SEG_TO_LIN(lpChCol->lpTemplateName),
RT_DIALOG16))) RT_DIALOGA)))
{ {
COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE); COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE);
return FALSE; return FALSE;
@ -1421,7 +1421,7 @@ BOOL16 WINAPI ChooseColor16( LPCHOOSECOLOR16 lpChCol )
hDlgTmpl16 = hGlobal16; hDlgTmpl16 = hGlobal16;
} }
ptr = GetProcAddress16(GetModuleHandle16("COMMDLG"), (SEGPTR) 8); ptr = GetProcAddress16(GetModuleHandle16("COMMDLG"), (LPCSTR) 8);
hInst = GetWindowLongA(lpChCol->hwndOwner, GWL_HINSTANCE); hInst = GetWindowLongA(lpChCol->hwndOwner, GWL_HINSTANCE);
bRet = DialogBoxIndirectParam16(hInst, hDlgTmpl16, lpChCol->hwndOwner, bRet = DialogBoxIndirectParam16(hInst, hDlgTmpl16, lpChCol->hwndOwner,
(DLGPROC16) ptr, (DWORD)lpChCol); (DLGPROC16) ptr, (DWORD)lpChCol);

View file

@ -97,12 +97,12 @@ static BOOL FileDlg_Init(void)
CURSORICONINFO *fldrInfo; CURSORICONINFO *fldrInfo;
if (!initialized) { if (!initialized) {
if (!hFolder) hFolder = LoadIcon16(0, MAKEINTRESOURCE16(OIC_FOLDER)); if (!hFolder) hFolder = LoadIconA(0, MAKEINTRESOURCEA(OIC_FOLDER));
if (!hFolder2) hFolder2 = LoadIcon16(0, MAKEINTRESOURCE16(OIC_FOLDER2)); if (!hFolder2) hFolder2 = LoadIconA(0, MAKEINTRESOURCEA(OIC_FOLDER2));
if (!hFloppy) hFloppy = LoadIcon16(0, MAKEINTRESOURCE16(OIC_FLOPPY)); if (!hFloppy) hFloppy = LoadIconA(0, MAKEINTRESOURCEA(OIC_FLOPPY));
if (!hHDisk) hHDisk = LoadIcon16(0, MAKEINTRESOURCE16(OIC_HDISK)); if (!hHDisk) hHDisk = LoadIconA(0, MAKEINTRESOURCEA(OIC_HDISK));
if (!hCDRom) hCDRom = LoadIcon16(0, MAKEINTRESOURCE16(OIC_CDROM)); if (!hCDRom) hCDRom = LoadIconA(0, MAKEINTRESOURCEA(OIC_CDROM));
if (!hNet) hNet = LoadIcon16(0, MAKEINTRESOURCE16(OIC_NETWORK)); if (!hNet) hNet = LoadIconA(0, MAKEINTRESOURCEA(OIC_NETWORK));
if (hFolder == 0 || hFolder2 == 0 || hFloppy == 0 || if (hFolder == 0 || hFolder2 == 0 || hFloppy == 0 ||
hHDisk == 0 || hCDRom == 0 || hNet == 0) hHDisk == 0 || hCDRom == 0 || hNet == 0)
{ {
@ -205,8 +205,8 @@ BOOL Get16BitsTemplate(LFSPRIVATE lfs)
{ {
HANDLE16 hResInfo; HANDLE16 hResInfo;
if (!(hResInfo = FindResource16(ofn16->hInstance, if (!(hResInfo = FindResource16(ofn16->hInstance,
ofn16->lpTemplateName, PTR_SEG_TO_LIN(ofn16->lpTemplateName),
RT_DIALOG16))) RT_DIALOGA)))
{ {
COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE); COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE);
return FALSE; return FALSE;
@ -329,7 +329,7 @@ static BOOL FILEDLG_ScanDir(HWND hWnd, LPWSTR newPath)
/* get the list of spec files */ /* get the list of spec files */
GetDlgItemTextW(hWnd, edt1, buffer, sizeof(buffer)); GetDlgItemTextW(hWnd, edt1, buffer, sizeof(buffer));
hCursorWait = LoadCursorA(NULL, IDC_WAITA); hCursorWait = LoadCursorA(0, IDC_WAITA);
oldCursor = SetCursor(hCursorWait); oldCursor = SetCursor(hCursorWait);
/* list of files */ /* list of files */
@ -459,16 +459,18 @@ static LONG FILEDLG_WMDrawItem(HWND hWnd, WPARAM wParam, LPARAM lParam,
} }
if (lpdis->CtlType == ODT_COMBOBOX && lpdis->CtlID == cmb2) if (lpdis->CtlType == ODT_COMBOBOX && lpdis->CtlID == cmb2)
{ {
char root[] = "a:";
if (!(str = HeapAlloc(GetProcessHeap(), 0, BUFFILEALLOC))) if (!(str = HeapAlloc(GetProcessHeap(), 0, BUFFILEALLOC)))
return FALSE; return FALSE;
SendMessageW(lpdis->hwndItem, CB_GETLBTEXT, lpdis->itemID, SendMessageW(lpdis->hwndItem, CB_GETLBTEXT, lpdis->itemID,
(LPARAM)str); (LPARAM)str);
switch(DRIVE_GetType( str[2] - 'a' )) root[0] += str[2] - 'a';
switch(GetDriveTypeA(root))
{ {
case TYPE_FLOPPY: hIcon = hFloppy; break; case DRIVE_REMOVABLE: hIcon = hFloppy; break;
case TYPE_CDROM: hIcon = hCDRom; break; case DRIVE_CDROM: hIcon = hCDRom; break;
case TYPE_NETWORK: hIcon = hNet; break; case DRIVE_REMOTE: hIcon = hNet; break;
case TYPE_HD: case DRIVE_FIXED:
default: hIcon = hHDisk; break; default: hIcon = hHDisk; break;
} }
if (lpdis->itemState & ODS_SELECTED) if (lpdis->itemState & ODS_SELECTED)
@ -1482,7 +1484,7 @@ BOOL16 WINAPI GetOpenFileName16(
if (lfs) if (lfs)
{ {
hInst = GetWindowLongA( lpofn->hwndOwner, GWL_HINSTANCE ); hInst = GetWindowLongA( lpofn->hwndOwner, GWL_HINSTANCE );
ptr = GetProcAddress16(GetModuleHandle16("COMMDLG"), (SEGPTR) 6); ptr = GetProcAddress16(GetModuleHandle16("COMMDLG"), (LPCSTR) 6);
bRet = DialogBoxIndirectParam16( hInst, lfs->hDlgTmpl16, lpofn->hwndOwner, bRet = DialogBoxIndirectParam16( hInst, lfs->hDlgTmpl16, lpofn->hwndOwner,
(DLGPROC16) ptr, (DWORD) lfs); (DLGPROC16) ptr, (DWORD) lfs);
FILEDLG_DestroyPrivate(lfs); FILEDLG_DestroyPrivate(lfs);
@ -1521,7 +1523,7 @@ BOOL16 WINAPI GetSaveFileName16(
if (lfs) if (lfs)
{ {
hInst = GetWindowLongA( lpofn->hwndOwner, GWL_HINSTANCE ); hInst = GetWindowLongA( lpofn->hwndOwner, GWL_HINSTANCE );
ptr = GetProcAddress16(GetModuleHandle16("COMMDLG"), (SEGPTR) 7); ptr = GetProcAddress16(GetModuleHandle16("COMMDLG"), (LPCSTR) 7);
bRet = DialogBoxIndirectParam16( hInst, lfs->hDlgTmpl16, lpofn->hwndOwner, bRet = DialogBoxIndirectParam16( hInst, lfs->hDlgTmpl16, lpofn->hwndOwner,
(DLGPROC16) ptr, (DWORD) lfs); (DLGPROC16) ptr, (DWORD) lfs);
FILEDLG_DestroyPrivate(lfs); FILEDLG_DestroyPrivate(lfs);

View file

@ -62,8 +62,8 @@ BOOL FINDDLG_Get16BitsTemplate(LFRPRIVATE lfr)
{ {
HANDLE16 hResInfo; HANDLE16 hResInfo;
if (!(hResInfo = FindResource16(fr16->hInstance, if (!(hResInfo = FindResource16(fr16->hInstance,
fr16->lpTemplateName, PTR_SEG_TO_LIN(fr16->lpTemplateName),
RT_DIALOG16))) RT_DIALOGA)))
{ {
COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE); COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE);
return FALSE; return FALSE;
@ -165,7 +165,7 @@ HWND16 WINAPI FindText16( SEGPTR find )
if (FINDDLG_Get16BitsTemplate(lfr)) if (FINDDLG_Get16BitsTemplate(lfr))
{ {
hInst = GetWindowLongA( lfr->fr16->hwndOwner , GWL_HINSTANCE); hInst = GetWindowLongA( lfr->fr16->hwndOwner , GWL_HINSTANCE);
ptr = GetProcAddress16(GetModuleHandle16("COMMDLG"), (SEGPTR) 13); ptr = GetProcAddress16(GetModuleHandle16("COMMDLG"), (LPCSTR) 13);
ret = CreateDialogIndirectParam16( hInst, lfr->template, ret = CreateDialogIndirectParam16( hInst, lfr->template,
lfr->fr16->hwndOwner, (DLGPROC16) ptr, find); lfr->fr16->hwndOwner, (DLGPROC16) ptr, find);
FINDDLG_FreeResources(lfr); FINDDLG_FreeResources(lfr);
@ -195,7 +195,7 @@ HWND16 WINAPI ReplaceText16( SEGPTR find )
if (FINDDLG_Get16BitsTemplate(lfr)) if (FINDDLG_Get16BitsTemplate(lfr))
{ {
hInst = GetWindowLongA( lfr->fr16->hwndOwner , GWL_HINSTANCE); hInst = GetWindowLongA( lfr->fr16->hwndOwner , GWL_HINSTANCE);
ptr = GetProcAddress16(GetModuleHandle16("COMMDLG"), (SEGPTR) 14); ptr = GetProcAddress16(GetModuleHandle16("COMMDLG"), (LPCSTR) 14);
ret = CreateDialogIndirectParam16( hInst, lfr->template, ret = CreateDialogIndirectParam16( hInst, lfr->template,
lfr->fr16->hwndOwner, (DLGPROC16) ptr, find); lfr->fr16->hwndOwner, (DLGPROC16) ptr, find);

View file

@ -92,8 +92,8 @@ BOOL16 WINAPI ChooseFont16(LPCHOOSEFONT16 lpChFont)
{ {
HANDLE16 hResInfo; HANDLE16 hResInfo;
if (!(hResInfo = FindResource16( lpChFont->hInstance, if (!(hResInfo = FindResource16( lpChFont->hInstance,
lpChFont->lpTemplateName, PTR_SEG_TO_LIN(lpChFont->lpTemplateName),
RT_DIALOG16))) RT_DIALOGA)))
{ {
COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE); COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE);
return FALSE; return FALSE;
@ -146,7 +146,7 @@ BOOL16 WINAPI ChooseFont16(LPCHOOSEFONT16 lpChFont)
lpTemplateName=lpChFont->lpTemplateName; lpTemplateName=lpChFont->lpTemplateName;
lpChFont->lpTemplateName=(SEGPTR)&cf32a; lpChFont->lpTemplateName=(SEGPTR)&cf32a;
ptr = GetProcAddress16(GetModuleHandle16("COMMDLG"), (SEGPTR) 16); ptr = GetProcAddress16(GetModuleHandle16("COMMDLG"), (LPCSTR) 16);
hInst = GetWindowLongA(lpChFont->hwndOwner, GWL_HINSTANCE); hInst = GetWindowLongA(lpChFont->hwndOwner, GWL_HINSTANCE);
bRet = DialogBoxIndirectParam16(hInst, hDlgTmpl16, lpChFont->hwndOwner, bRet = DialogBoxIndirectParam16(hInst, hDlgTmpl16, lpChFont->hwndOwner,
(DLGPROC16) ptr, (DWORD)lpChFont); (DLGPROC16) ptr, (DWORD)lpChFont);
@ -367,9 +367,7 @@ static int SetFontStylesToCombo2(HWND hwnd, HDC hdc, const LOGFONTA *lplf)
if (tm.tmWeight==fontstyles[i].weight && if (tm.tmWeight==fontstyles[i].weight &&
tm.tmItalic==fontstyles[i].italic) /* font successful created ? */ tm.tmItalic==fontstyles[i].italic) /* font successful created ? */
{ {
char *str = SEGPTR_STRDUP(fontstyles[i].stname); j=SendMessageA(hwnd,CB_ADDSTRING,0,(LPARAM)fontstyles[i].stname );
j=SendMessage16(hwnd,CB_ADDSTRING16,0,(LPARAM)SEGPTR_GET(str) );
SEGPTR_FREE(str);
if (j==CB_ERR) return 1; if (j==CB_ERR) return 1;
j=SendMessage16(hwnd, CB_SETITEMDATA16, j, j=SendMessage16(hwnd, CB_SETITEMDATA16, j,
MAKELONG(fontstyles[i].weight,fontstyles[i].italic)); MAKELONG(fontstyles[i].weight,fontstyles[i].italic));

View file

@ -55,7 +55,7 @@ owner kernel32
47 pascal GetModuleHandle(segstr) WIN16_GetModuleHandle 47 pascal GetModuleHandle(segstr) WIN16_GetModuleHandle
48 pascal16 GetModuleUsage(word) GetModuleUsage16 48 pascal16 GetModuleUsage(word) GetModuleUsage16
49 pascal16 GetModuleFileName(word ptr s_word) GetModuleFileName16 49 pascal16 GetModuleFileName(word ptr s_word) GetModuleFileName16
50 pascal GetProcAddress(word segstr) GetProcAddress16 50 pascal GetProcAddress(word str) GetProcAddress16
51 pascal MakeProcInstance(segptr word) MakeProcInstance16 51 pascal MakeProcInstance(segptr word) MakeProcInstance16
52 pascal16 FreeProcInstance(segptr) FreeProcInstance16 52 pascal16 FreeProcInstance(segptr) FreeProcInstance16
53 stub CallProcInstance 53 stub CallProcInstance
@ -98,7 +98,7 @@ owner kernel32
89 pascal lstrcat(segstr str) lstrcat16 89 pascal lstrcat(segstr str) lstrcat16
90 pascal16 lstrlen(str) lstrlen16 90 pascal16 lstrlen(str) lstrlen16
91 register InitTask() InitTask16 91 register InitTask() InitTask16
92 pascal GetTempDrive(word) WIN16_GetTempDrive 92 pascal GetTempDrive(word) GetTempDrive
93 pascal16 GetCodeHandle(segptr) GetCodeHandle16 93 pascal16 GetCodeHandle(segptr) GetCodeHandle16
94 pascal16 DefineHandleTable(word) DefineHandleTable16 94 pascal16 DefineHandleTable(word) DefineHandleTable16
95 pascal16 LoadLibrary(str) LoadLibrary16 95 pascal16 LoadLibrary(str) LoadLibrary16

View file

@ -207,7 +207,7 @@ IMalloc16_Constructor() {
if (!msegvt16) { if (!msegvt16) {
msegvt16 = SEGPTR_NEW(ICOM_VTABLE(IMalloc16)); msegvt16 = SEGPTR_NEW(ICOM_VTABLE(IMalloc16));
#define VTENT(x) msegvt16->fn##x = (void*)WIN32_GetProcAddress16(hcomp,"IMalloc16_"#x);assert(msegvt16->fn##x) #define VTENT(x) msegvt16->fn##x = (void*)GetProcAddress16(hcomp,"IMalloc16_"#x);assert(msegvt16->fn##x)
VTENT(QueryInterface); VTENT(QueryInterface);
VTENT(AddRef); VTENT(AddRef);
VTENT(Release); VTENT(Release);

View file

@ -1102,8 +1102,8 @@ static void _create_istream16(LPSTREAM16 *str) {
if (!strvt16.fnQueryInterface) { if (!strvt16.fnQueryInterface) {
HMODULE16 wp = GetModuleHandle16("STORAGE"); HMODULE16 wp = GetModuleHandle16("STORAGE");
if (wp>=32) { if (wp>=32) {
/* FIXME: what is This WIN32_GetProcAddress16. Should the name be IStream16_QueryInterface of IStream16_fnQueryInterface */ /* FIXME: what is This GetProcAddress16. Should the name be IStream16_QueryInterface of IStream16_fnQueryInterface */
#define VTENT(xfn) strvt16.fn##xfn = (void*)WIN32_GetProcAddress16(wp,"IStream16_"#xfn);assert(strvt16.fn##xfn) #define VTENT(xfn) strvt16.fn##xfn = (void*)GetProcAddress16(wp,"IStream16_"#xfn);assert(strvt16.fn##xfn)
VTENT(QueryInterface); VTENT(QueryInterface);
VTENT(AddRef); VTENT(AddRef);
VTENT(Release); VTENT(Release);
@ -1500,7 +1500,7 @@ static void _create_istorage16(LPSTORAGE16 *stg) {
if (!stvt16.fnQueryInterface) { if (!stvt16.fnQueryInterface) {
HMODULE16 wp = GetModuleHandle16("STORAGE"); HMODULE16 wp = GetModuleHandle16("STORAGE");
if (wp>=32) { if (wp>=32) {
#define VTENT(xfn) stvt16.fn##xfn = (void*)WIN32_GetProcAddress16(wp,"IStorage16_"#xfn); #define VTENT(xfn) stvt16.fn##xfn = (void*)GetProcAddress16(wp,"IStorage16_"#xfn);
VTENT(QueryInterface) VTENT(QueryInterface)
VTENT(AddRef) VTENT(AddRef)
VTENT(Release) VTENT(Release)

View file

@ -641,7 +641,7 @@ HICON16 WINAPI ExtractAssociatedIcon16(HINSTANCE16 hInst, LPSTR lpIconPath, LPWO
*lpiIcon = 6; /* generic icon - found nothing */ *lpiIcon = 6; /* generic icon - found nothing */
GetModuleFileName16(hInst, lpIconPath, 0x80); GetModuleFileName16(hInst, lpIconPath, 0x80);
hIcon = LoadIcon16( hInst, MAKEINTRESOURCE16(*lpiIcon)); hIcon = LoadIconA( hInst, MAKEINTRESOURCEA(*lpiIcon));
} }
return hIcon; return hIcon;
} }
@ -803,7 +803,7 @@ BOOL WINAPI RegisterShellHook16(HWND16 hWnd, UINT16 uAction)
if( !SHELL_hHook ) if( !SHELL_hHook )
{ {
HMODULE16 hShell = GetModuleHandle16( "SHELL" ); HMODULE16 hShell = GetModuleHandle16( "SHELL" );
HOOKPROC16 hookProc = (HOOKPROC16)GetProcAddress16( hShell, (SEGPTR)103 ); HOOKPROC16 hookProc = (HOOKPROC16)GetProcAddress16( hShell, (LPCSTR)103 );
SHELL_hHook = SetWindowsHookEx16( WH_SHELL, hookProc, hShell, 0 ); SHELL_hHook = SetWindowsHookEx16( WH_SHELL, hookProc, hShell, 0 );
if ( SHELL_hHook ) if ( SHELL_hHook )
{ {

View file

@ -32,18 +32,13 @@ typedef struct
/********************************************************************** /**********************************************************************
* LoadAccelerators16 [USER.177] * LoadAccelerators16 [USER.177]
*/ */
HACCEL16 WINAPI LoadAccelerators16(HINSTANCE16 instance, SEGPTR lpTableName) HACCEL16 WINAPI LoadAccelerators16(HINSTANCE16 instance, LPCSTR lpTableName)
{ {
HRSRC16 hRsrc; HRSRC16 hRsrc;
if (HIWORD(lpTableName)) TRACE_(accel)("%04x %s\n", instance, debugres_a(lpTableName) );
TRACE_(accel)("%04x '%s'\n",
instance, (char *)PTR_SEG_TO_LIN( lpTableName ) );
else
TRACE_(accel)("%04x %04x\n",
instance, LOWORD(lpTableName) );
if (!(hRsrc = FindResource16( instance, lpTableName, RT_ACCELERATOR16 ))) { if (!(hRsrc = FindResource16( instance, lpTableName, RT_ACCELERATORA ))) {
WARN_(accel)("couldn't find accelerator table resource\n"); WARN_(accel)("couldn't find accelerator table resource\n");
return 0; return 0;
} }
@ -310,7 +305,7 @@ INT16 WINAPI LoadString16( HINSTANCE16 instance, UINT16 resource_id,
TRACE("inst=%04x id=%04x buff=%08x len=%d\n", TRACE("inst=%04x id=%04x buff=%08x len=%d\n",
instance, resource_id, (int) buffer, buflen); instance, resource_id, (int) buffer, buflen);
hrsrc = FindResource16( instance, (SEGPTR)((resource_id>>4)+1), RT_STRING16 ); hrsrc = FindResource16( instance, (LPCSTR)((resource_id>>4)+1), RT_STRINGA );
if (!hrsrc) return 0; if (!hrsrc) return 0;
hmem = LoadResource16( instance, hrsrc ); hmem = LoadResource16( instance, hrsrc );
if (!hmem) return 0; if (!hmem) return 0;

View file

@ -89,10 +89,10 @@ owner user32
84 pascal16 DrawIcon(word s_word s_word word) DrawIcon16 84 pascal16 DrawIcon(word s_word s_word word) DrawIcon16
85 pascal16 DrawText(word str s_word ptr word) DrawText16 85 pascal16 DrawText(word str s_word ptr word) DrawText16
86 pascal IconSize() IconSize16 # later versions: BEAR86 86 pascal IconSize() IconSize16 # later versions: BEAR86
87 pascal16 DialogBox(word segstr word segptr) DialogBox16 87 pascal16 DialogBox(word str word segptr) DialogBox16
88 pascal16 EndDialog(word s_word) EndDialog16 88 pascal16 EndDialog(word s_word) EndDialog16
89 pascal16 CreateDialog(word segstr word segptr) CreateDialog16 89 pascal16 CreateDialog(word str word segptr) CreateDialog16
90 pascal16 IsDialogMessage(word segptr) WIN16_IsDialogMessage16 90 pascal16 IsDialogMessage(word segptr) IsDialogMessage16
91 pascal16 GetDlgItem(word word) GetDlgItem16 91 pascal16 GetDlgItem(word word) GetDlgItem16
92 pascal16 SetDlgItemText(word word segstr) SetDlgItemText16 92 pascal16 SetDlgItemText(word word segstr) SetDlgItemText16
93 pascal16 GetDlgItemText(word word segptr word) GetDlgItemText16 93 pascal16 GetDlgItemText(word word segptr word) GetDlgItemText16
@ -152,7 +152,7 @@ owner user32
147 pascal16 SetClipboardViewer(word) SetClipboardViewer16 147 pascal16 SetClipboardViewer(word) SetClipboardViewer16
148 pascal16 GetClipboardViewer() GetClipboardViewer16 148 pascal16 GetClipboardViewer() GetClipboardViewer16
149 pascal16 ChangeClipboardChain(word word) ChangeClipboardChain16 149 pascal16 ChangeClipboardChain(word word) ChangeClipboardChain16
150 pascal16 LoadMenu(word segstr) LoadMenu16 150 pascal16 LoadMenu(word str) LoadMenu16
151 pascal16 CreateMenu() CreateMenu16 151 pascal16 CreateMenu() CreateMenu16
152 pascal16 DestroyMenu(word) DestroyMenu16 152 pascal16 DestroyMenu(word) DestroyMenu16
153 pascal16 ChangeMenu(word word segstr word word) ChangeMenu16 153 pascal16 ChangeMenu(word word segstr word word) ChangeMenu16
@ -175,11 +175,11 @@ owner user32
170 pascal16 ArrangeIconicWindows(word) ArrangeIconicWindows16 # W1.1: CREATECONVERTWINDOW, W2.0: nothing ! 170 pascal16 ArrangeIconicWindows(word) ArrangeIconicWindows16 # W1.1: CREATECONVERTWINDOW, W2.0: nothing !
171 pascal16 WinHelp(word str word long) WinHelp16 # W1.1: SHOWCONVERTWINDOW, W2.0: nothing ! 171 pascal16 WinHelp(word str word long) WinHelp16 # W1.1: SHOWCONVERTWINDOW, W2.0: nothing !
172 pascal16 SwitchToThisWindow(word word) SwitchToThisWindow16 # W1.1: SETCONVERTWINDOWHEIGHT, W2.0: nothing ! 172 pascal16 SwitchToThisWindow(word word) SwitchToThisWindow16 # W1.1: SETCONVERTWINDOWHEIGHT, W2.0: nothing !
173 pascal16 LoadCursor(word segstr) LoadCursor16 173 pascal16 LoadCursor(word str) LoadCursor16
174 pascal16 LoadIcon(word segstr) LoadIcon16 174 pascal16 LoadIcon(word str) LoadIcon16
175 pascal16 LoadBitmap(word segstr) LoadBitmap16 175 pascal16 LoadBitmap(word str) LoadBitmap16
176 pascal16 LoadString(word word ptr s_word) LoadString16 176 pascal16 LoadString(word word ptr s_word) LoadString16
177 pascal16 LoadAccelerators(word segstr) LoadAccelerators16 177 pascal16 LoadAccelerators(word str) LoadAccelerators16
178 pascal16 TranslateAccelerator(word word ptr) TranslateAccelerator16 178 pascal16 TranslateAccelerator(word word ptr) TranslateAccelerator16
179 pascal16 GetSystemMetrics(s_word) GetSystemMetrics16 179 pascal16 GetSystemMetrics(s_word) GetSystemMetrics16
180 pascal GetSysColor(word) GetSysColor16 180 pascal GetSysColor(word) GetSysColor16
@ -243,10 +243,10 @@ owner user32
236 pascal16 GetCapture() GetCapture16 236 pascal16 GetCapture() GetCapture16
237 pascal16 GetUpdateRgn(word word word) GetUpdateRgn16 237 pascal16 GetUpdateRgn(word word word) GetUpdateRgn16
238 pascal16 ExcludeUpdateRgn(word word) ExcludeUpdateRgn16 238 pascal16 ExcludeUpdateRgn(word word) ExcludeUpdateRgn16
239 pascal16 DialogBoxParam(word segstr word segptr long) DialogBoxParam16 239 pascal16 DialogBoxParam(word str word segptr long) DialogBoxParam16
240 pascal16 DialogBoxIndirectParam(word word word segptr long) 240 pascal16 DialogBoxIndirectParam(word word word segptr long)
DialogBoxIndirectParam16 DialogBoxIndirectParam16
241 pascal16 CreateDialogParam(word segstr word segptr long) CreateDialogParam16 241 pascal16 CreateDialogParam(word str word segptr long) CreateDialogParam16
242 pascal16 CreateDialogIndirectParam(word ptr word segptr long) 242 pascal16 CreateDialogIndirectParam(word ptr word segptr long)
CreateDialogIndirectParam16 CreateDialogIndirectParam16
243 pascal GetDialogBaseUnits() GetDialogBaseUnits 243 pascal GetDialogBaseUnits() GetDialogBaseUnits

View file

@ -8,6 +8,7 @@
#include <string.h> #include <string.h>
#include <assert.h> #include <assert.h>
#include "wine/winbase16.h"
#include "heap.h" #include "heap.h"
#include "user.h" /* should be removed asap; used in MMDRV_(Get|Alloc|Free) */ #include "user.h" /* should be removed asap; used in MMDRV_(Get|Alloc|Free) */
#include "selectors.h" #include "selectors.h"
@ -2299,7 +2300,7 @@ static BOOL MMDRV_Install(LPCSTR name, int num, BOOL bIsMapper)
lpDrv->bIs32 = FALSE; lpDrv->bIs32 = FALSE;
if ((hModule = GetDriverModuleHandle16(lpDrv->hDrvr))) { if ((hModule = GetDriverModuleHandle16(lpDrv->hDrvr))) {
#define A(_x,_y) AA(_x,_y,16,WIN32_GetProcAddress16) #define A(_x,_y) AA(_x,_y,16,GetProcAddress16)
A(MMDRV_AUX, auxMessage); A(MMDRV_AUX, auxMessage);
A(MMDRV_MIXER, mixMessage); A(MMDRV_MIXER, mixMessage);
A(MMDRV_MIDIIN, midMessage); A(MMDRV_MIDIIN, midMessage);

View file

@ -5118,7 +5118,7 @@ LRESULT WINAPI mmThreadCreate16(FARPROC16 fpThreadAddr, LPHANDLE lpHndl, DWORD d
/* get WINE_mmThreadEntryPoint() /* get WINE_mmThreadEntryPoint()
* 2047 is its ordinal in mmsystem.spec * 2047 is its ordinal in mmsystem.spec
*/ */
FARPROC16 fp = GetProcAddress16(GetModuleHandle16("MMSYSTEM"), (SEGPTR)2047); FARPROC16 fp = GetProcAddress16(GetModuleHandle16("MMSYSTEM"), (LPCSTR)2047);
TRACE("farproc seg=0x%08lx lin=%p\n", (DWORD)fp, PTR_SEG_TO_LIN(fp)); TRACE("farproc seg=0x%08lx lin=%p\n", (DWORD)fp, PTR_SEG_TO_LIN(fp));

View file

@ -221,27 +221,7 @@ UINT DIR_GetSystemUnixDir( LPSTR path, UINT count )
/*********************************************************************** /***********************************************************************
* GetTempDrive (KERNEL.92) * GetTempDrive (KERNEL.92)
*/ * A closer look at krnl386.exe shows what the SDK doesn't mention:
BYTE WINAPI GetTempDrive( BYTE ignored )
{
char *buffer;
BYTE ret;
UINT len = GetTempPathA( 0, NULL );
if (!(buffer = HeapAlloc( GetProcessHeap(), 0, len + 1 )) )
return DRIVE_GetCurrentDrive() + 'A';
/* FIXME: apparently Windows does something with the ignored byte */
if (!GetTempPathA( len, buffer )) buffer[0] = 'C';
ret = buffer[0];
HeapFree( GetProcessHeap(), 0, buffer );
return toupper(ret);
}
UINT WINAPI WIN16_GetTempDrive( BYTE ignored )
{
/* A closer look at krnl386.exe shows what the SDK doesn't mention:
* *
* returns: * returns:
* AL: driveletter * AL: driveletter
@ -249,7 +229,22 @@ UINT WINAPI WIN16_GetTempDrive( BYTE ignored )
* the returned AX. * the returned AX.
* DX: 1 for success * DX: 1 for success
*/ */
return MAKELONG( GetTempDrive(ignored) | (':' << 8), 1 ); UINT WINAPI GetTempDrive( BYTE ignored )
{
char *buffer;
BYTE ret;
UINT len = GetTempPathA( 0, NULL );
if (!(buffer = HeapAlloc( GetProcessHeap(), 0, len + 1 )) )
ret = DRIVE_GetCurrentDrive() + 'A';
else
{
/* FIXME: apparently Windows does something with the ignored byte */
if (!GetTempPathA( len, buffer )) buffer[0] = 'C';
ret = toupper(buffer[0]);
HeapFree( GetProcessHeap(), 0, buffer );
}
return MAKELONG( ret | (':' << 8), 1 );
} }

View file

@ -55,7 +55,7 @@ static LOADED_PRINTER_DRIVER *gapLoadedPrinterDrivers[MAX_PRINTER_DRIVERS];
static void GetPrinterDriverFunctions(HINSTANCE16 hInst, LOADED_PRINTER_DRIVER *pLPD) static void GetPrinterDriverFunctions(HINSTANCE16 hInst, LOADED_PRINTER_DRIVER *pLPD)
{ {
#define LoadPrinterDrvFunc(A) pLPD->fn[FUNC_##A] = \ #define LoadPrinterDrvFunc(A) pLPD->fn[FUNC_##A] = \
GetProcAddress16(hInst, MAKEINTRESOURCE16(ORD_##A)) GetProcAddress16(hInst, MAKEINTRESOURCEA(ORD_##A))
LoadPrinterDrvFunc(BITBLT); LoadPrinterDrvFunc(BITBLT);
LoadPrinterDrvFunc(COLORINFO); LoadPrinterDrvFunc(COLORINFO);

View file

@ -150,7 +150,7 @@ void THUNK_Free( FARPROC thunk )
*/ */
static FARPROC THUNK_GetCalloutThunk( NE_MODULE *pModule, LPSTR name, RELAY relay ) static FARPROC THUNK_GetCalloutThunk( NE_MODULE *pModule, LPSTR name, RELAY relay )
{ {
FARPROC16 proc = WIN32_GetProcAddress16( pModule->self, name ); FARPROC16 proc = GetProcAddress16( pModule->self, name );
if ( !proc ) return 0; if ( !proc ) return 0;
if ( pModule->flags & NE_FFLAGS_BUILTIN ) if ( pModule->flags & NE_FFLAGS_BUILTIN )

View file

@ -137,7 +137,7 @@ BOOL16 WINAPI FindClose16(HANDLE16);
VOID WINAPI FreeLibrary16(HINSTANCE16); VOID WINAPI FreeLibrary16(HINSTANCE16);
HANDLE16 WINAPI FindFirstFile16(LPCSTR,LPWIN32_FIND_DATAA); HANDLE16 WINAPI FindFirstFile16(LPCSTR,LPWIN32_FIND_DATAA);
BOOL16 WINAPI FindNextFile16(HANDLE16,LPWIN32_FIND_DATAA); BOOL16 WINAPI FindNextFile16(HANDLE16,LPWIN32_FIND_DATAA);
HRSRC16 WINAPI FindResource16(HINSTANCE16,SEGPTR,SEGPTR); HRSRC16 WINAPI FindResource16(HINSTANCE16,LPCSTR,LPCSTR);
BOOL16 WINAPI FreeModule16(HMODULE16); BOOL16 WINAPI FreeModule16(HMODULE16);
void WINAPI FreeProcInstance16(FARPROC16); void WINAPI FreeProcInstance16(FARPROC16);
BOOL16 WINAPI FreeResource16(HGLOBAL16); BOOL16 WINAPI FreeResource16(HGLOBAL16);
@ -155,7 +155,7 @@ INT16 WINAPI GetPrivateProfileSection16(LPCSTR,LPSTR,UINT16,LPCSTR);
WORD WINAPI GetPrivateProfileSectionNames16(LPSTR,UINT16,LPCSTR); WORD WINAPI GetPrivateProfileSectionNames16(LPSTR,UINT16,LPCSTR);
INT16 WINAPI GetPrivateProfileString16(LPCSTR,LPCSTR,LPCSTR,LPSTR,UINT16,LPCSTR); INT16 WINAPI GetPrivateProfileString16(LPCSTR,LPCSTR,LPCSTR,LPSTR,UINT16,LPCSTR);
BOOL16 WINAPI GetPrivateProfileStruct16(LPCSTR,LPCSTR,LPVOID,UINT16,LPCSTR); BOOL16 WINAPI GetPrivateProfileStruct16(LPCSTR,LPCSTR,LPVOID,UINT16,LPCSTR);
FARPROC16 WINAPI GetProcAddress16(HMODULE16,SEGPTR); FARPROC16 WINAPI GetProcAddress16(HMODULE16,LPCSTR);
UINT16 WINAPI GetProfileInt16(LPCSTR,LPCSTR,INT16); UINT16 WINAPI GetProfileInt16(LPCSTR,LPCSTR,INT16);
INT16 WINAPI GetProfileSection16(LPCSTR,LPSTR,UINT16); INT16 WINAPI GetProfileSection16(LPCSTR,LPSTR,UINT16);
WORD WINAPI GetProfileSectionNames16(LPSTR,WORD); WORD WINAPI GetProfileSectionNames16(LPSTR,WORD);
@ -250,8 +250,6 @@ BOOL16 WINAPI WriteProfileSection16(LPCSTR,LPCSTR);
/* Extra functions that don't exist in the Windows API */ /* Extra functions that don't exist in the Windows API */
HPEN16 WINAPI GetSysColorPen16(INT16);
UINT WINAPI WIN16_GetTempDrive(BYTE);
SEGPTR WINAPI WIN16_GlobalLock16(HGLOBAL16); SEGPTR WINAPI WIN16_GlobalLock16(HGLOBAL16);
SEGPTR WINAPI WIN16_LockResource16(HGLOBAL16); SEGPTR WINAPI WIN16_LockResource16(HGLOBAL16);
LONG WINAPI WIN16_hread(HFILE16,SEGPTR,LONG); LONG WINAPI WIN16_hread(HFILE16,SEGPTR,LONG);

View file

@ -437,29 +437,6 @@ typedef struct
#define RT_MESSAGELIST16 MAKEINTRESOURCE16(11) #define RT_MESSAGELIST16 MAKEINTRESOURCE16(11)
#define RT_GROUP_CURSOR16 MAKEINTRESOURCE16(12) #define RT_GROUP_CURSOR16 MAKEINTRESOURCE16(12)
#define RT_GROUP_ICON16 MAKEINTRESOURCE16(14) #define RT_GROUP_ICON16 MAKEINTRESOURCE16(14)
/* Predefined resources */
#define IDI_APPLICATION16 MAKEINTRESOURCE16(32512)
#define IDI_HAND16 MAKEINTRESOURCE16(32513)
#define IDI_QUESTION16 MAKEINTRESOURCE16(32514)
#define IDI_EXCLAMATION16 MAKEINTRESOURCE16(32515)
#define IDI_ASTERISK16 MAKEINTRESOURCE16(32516)
#define IDC_BUMMER16 MAKEINTRESOURCE16(100)
#define IDC_ARROW16 MAKEINTRESOURCE16(32512)
#define IDC_IBEAM16 MAKEINTRESOURCE16(32513)
#define IDC_WAIT16 MAKEINTRESOURCE16(32514)
#define IDC_CROSS16 MAKEINTRESOURCE16(32515)
#define IDC_UPARROW16 MAKEINTRESOURCE16(32516)
#define IDC_SIZE16 MAKEINTRESOURCE16(32640)
#define IDC_ICON16 MAKEINTRESOURCE16(32641)
#define IDC_SIZENWSE16 MAKEINTRESOURCE16(32642)
#define IDC_SIZENESW16 MAKEINTRESOURCE16(32643)
#define IDC_SIZEWE16 MAKEINTRESOURCE16(32644)
#define IDC_SIZENS16 MAKEINTRESOURCE16(32645)
#define IDC_SIZEALL16 MAKEINTRESOURCE16(32646)
#define IDC_NO16 MAKEINTRESOURCE16(32648)
#define IDC_APPSTARTING16 MAKEINTRESOURCE16(32650)
#define IDC_HELP16 MAKEINTRESOURCE16(32651)
/* CreateWindow() coordinates */ /* CreateWindow() coordinates */
#define CW_USEDEFAULT16 ((INT16)0x8000) #define CW_USEDEFAULT16 ((INT16)0x8000)
@ -662,11 +639,11 @@ BOOL16 WINAPI CopyRect16(RECT16*,const RECT16*);
INT16 WINAPI CountClipboardFormats16(void); INT16 WINAPI CountClipboardFormats16(void);
VOID WINAPI CreateCaret16(HWND16,HBITMAP16,INT16,INT16); VOID WINAPI CreateCaret16(HWND16,HBITMAP16,INT16,INT16);
HCURSOR16 WINAPI CreateCursor16(HINSTANCE16,INT16,INT16,INT16,INT16,LPCVOID,LPCVOID); HCURSOR16 WINAPI CreateCursor16(HINSTANCE16,INT16,INT16,INT16,INT16,LPCVOID,LPCVOID);
HWND16 WINAPI CreateDialog16(HINSTANCE16,SEGPTR,HWND16,DLGPROC16); HWND16 WINAPI CreateDialog16(HINSTANCE16,LPCSTR,HWND16,DLGPROC16);
HWND16 WINAPI CreateDialogIndirect16(HINSTANCE16,LPCVOID,HWND16,DLGPROC16); HWND16 WINAPI CreateDialogIndirect16(HINSTANCE16,LPCVOID,HWND16,DLGPROC16);
HWND16 WINAPI CreateDialogIndirectParam16(HINSTANCE16,LPCVOID,HWND16, HWND16 WINAPI CreateDialogIndirectParam16(HINSTANCE16,LPCVOID,HWND16,
DLGPROC16,LPARAM); DLGPROC16,LPARAM);
HWND16 WINAPI CreateDialogParam16(HINSTANCE16,SEGPTR,HWND16,DLGPROC16,LPARAM); HWND16 WINAPI CreateDialogParam16(HINSTANCE16,LPCSTR,HWND16,DLGPROC16,LPARAM);
HICON16 WINAPI CreateIcon16(HINSTANCE16,INT16,INT16,BYTE,BYTE,LPCVOID,LPCVOID); HICON16 WINAPI CreateIcon16(HINSTANCE16,INT16,INT16,BYTE,BYTE,LPCVOID,LPCVOID);
HICON16 WINAPI CreateIconFromResourceEx16(LPBYTE,UINT16,BOOL16,DWORD,INT16,INT16,UINT16); HICON16 WINAPI CreateIconFromResourceEx16(LPBYTE,UINT16,BOOL16,DWORD,INT16,INT16,UINT16);
HMENU16 WINAPI CreateMenu16(void); HMENU16 WINAPI CreateMenu16(void);
@ -687,10 +664,10 @@ BOOL16 WINAPI DestroyCursor16(HCURSOR16);
BOOL16 WINAPI DestroyIcon16(HICON16); BOOL16 WINAPI DestroyIcon16(HICON16);
BOOL16 WINAPI DestroyMenu16(HMENU16); BOOL16 WINAPI DestroyMenu16(HMENU16);
BOOL16 WINAPI DestroyWindow16(HWND16); BOOL16 WINAPI DestroyWindow16(HWND16);
INT16 WINAPI DialogBox16(HINSTANCE16,SEGPTR,HWND16,DLGPROC16); INT16 WINAPI DialogBox16(HINSTANCE16,LPCSTR,HWND16,DLGPROC16);
INT16 WINAPI DialogBoxIndirect16(HINSTANCE16,HANDLE16,HWND16,DLGPROC16); INT16 WINAPI DialogBoxIndirect16(HINSTANCE16,HANDLE16,HWND16,DLGPROC16);
INT16 WINAPI DialogBoxIndirectParam16(HINSTANCE16,HANDLE16,HWND16,DLGPROC16,LPARAM); INT16 WINAPI DialogBoxIndirectParam16(HINSTANCE16,HANDLE16,HWND16,DLGPROC16,LPARAM);
INT16 WINAPI DialogBoxParam16(HINSTANCE16,SEGPTR,HWND16,DLGPROC16,LPARAM); INT16 WINAPI DialogBoxParam16(HINSTANCE16,LPCSTR,HWND16,DLGPROC16,LPARAM);
LONG WINAPI DispatchMessage16(const MSG16*); LONG WINAPI DispatchMessage16(const MSG16*);
LONG WINAPI DispatchMessage32_16(const MSG32_16*,BOOL16); LONG WINAPI DispatchMessage32_16(const MSG32_16*,BOOL16);
INT16 WINAPI DlgDirList16(HWND16,LPSTR,INT16,INT16,UINT16); INT16 WINAPI DlgDirList16(HWND16,LPSTR,INT16,INT16,UINT16);
@ -829,11 +806,11 @@ BOOL16 WINAPI IsWindowVisible16(HWND16);
BOOL16 WINAPI IsZoomed16(HWND16); BOOL16 WINAPI IsZoomed16(HWND16);
BOOL16 WINAPI KillSystemTimer16(HWND16,UINT16); BOOL16 WINAPI KillSystemTimer16(HWND16,UINT16);
BOOL16 WINAPI KillTimer16(HWND16,UINT16); BOOL16 WINAPI KillTimer16(HWND16,UINT16);
HBITMAP16 WINAPI LoadBitmap16(HANDLE16,SEGPTR); HBITMAP16 WINAPI LoadBitmap16(HANDLE16,LPCSTR);
HCURSOR16 WINAPI LoadCursor16(HINSTANCE16,SEGPTR); HCURSOR16 WINAPI LoadCursor16(HINSTANCE16,LPCSTR);
HICON16 WINAPI LoadIcon16(HINSTANCE16,SEGPTR); HICON16 WINAPI LoadIcon16(HINSTANCE16,LPCSTR);
HANDLE16 WINAPI LoadImage16(HINSTANCE16,LPCSTR,UINT16,INT16,INT16,UINT16); HANDLE16 WINAPI LoadImage16(HINSTANCE16,LPCSTR,UINT16,INT16,INT16,UINT16);
HMENU16 WINAPI LoadMenu16(HINSTANCE16,SEGPTR); HMENU16 WINAPI LoadMenu16(HINSTANCE16,LPCSTR);
HMENU16 WINAPI LoadMenuIndirect16(LPCVOID); HMENU16 WINAPI LoadMenuIndirect16(LPCVOID);
INT16 WINAPI LoadString16(HINSTANCE16,UINT16,LPSTR,INT16); INT16 WINAPI LoadString16(HINSTANCE16,UINT16,LPSTR,INT16);
BOOL16 WINAPI LockWindowUpdate16(HWND16); BOOL16 WINAPI LockWindowUpdate16(HWND16);
@ -939,7 +916,7 @@ BOOL16 WINAPI WinHelp16(HWND16,LPCSTR,UINT16,DWORD);
UINT16 WINAPI WNetAddConnection16(LPCSTR,LPCSTR,LPCSTR); UINT16 WINAPI WNetAddConnection16(LPCSTR,LPCSTR,LPCSTR);
INT16 WINAPI wvsprintf16(LPSTR,LPCSTR,LPCVOID); INT16 WINAPI wvsprintf16(LPSTR,LPCSTR,LPCVOID);
BOOL16 WINAPI DrawState16A(HDC16,HBRUSH16,DRAWSTATEPROC16,LPARAM,WPARAM16,INT16,INT16,INT16,INT16,UINT16); BOOL16 WINAPI DrawState16A(HDC16,HBRUSH16,DRAWSTATEPROC16,LPARAM,WPARAM16,INT16,INT16,INT16,INT16,UINT16);
BOOL16 WINAPI IsDialogMessage16(HWND16,LPMSG16); BOOL16 WINAPI IsDialogMessage16(HWND16,SEGPTR);
INT16 WINAPI GetCommError16(INT16,LPCOMSTAT16); INT16 WINAPI GetCommError16(INT16,LPCOMSTAT16);
BOOL16 WINAPI BuildCommDCB16(LPCSTR,LPDCB16); BOOL16 WINAPI BuildCommDCB16(LPCSTR,LPDCB16);
INT16 WINAPI GetCommState16(INT16,LPDCB16); INT16 WINAPI GetCommState16(INT16,LPDCB16);
@ -960,7 +937,6 @@ BOOL16 WINAPI GrayString16(HDC16,HBRUSH16,GRAYSTRINGPROC16,LPARAM,
INT16,INT16,INT16,INT16,INT16); INT16,INT16,INT16,INT16,INT16);
DWORD WINAPI GetFileResourceSize16(LPCSTR,LPCSTR,LPCSTR,LPDWORD); DWORD WINAPI GetFileResourceSize16(LPCSTR,LPCSTR,LPCSTR,LPDWORD);
DWORD WINAPI GetFileResource16(LPCSTR,LPCSTR,LPCSTR,DWORD,DWORD,LPVOID); DWORD WINAPI GetFileResource16(LPCSTR,LPCSTR,LPCSTR,DWORD,DWORD,LPVOID);
BYTE WINAPI GetTempDrive(BYTE);
FARPROC16 WINAPI SetTaskSignalProc(HTASK16,FARPROC16); FARPROC16 WINAPI SetTaskSignalProc(HTASK16,FARPROC16);

View file

@ -1633,9 +1633,6 @@ void WINAPI PrivateFreeLibrary(HINSTANCE handle)
*/ */
FARPROC16 WINAPI WIN32_GetProcAddress16( HMODULE hModule, LPCSTR name ) FARPROC16 WINAPI WIN32_GetProcAddress16( HMODULE hModule, LPCSTR name )
{ {
WORD ordinal;
FARPROC16 ret;
if (!hModule) { if (!hModule) {
WARN("hModule may not be 0!\n"); WARN("hModule may not be 0!\n");
return (FARPROC16)0; return (FARPROC16)0;
@ -1645,24 +1642,13 @@ FARPROC16 WINAPI WIN32_GetProcAddress16( HMODULE hModule, LPCSTR name )
WARN("hModule is Win32 handle (%08x)\n", hModule ); WARN("hModule is Win32 handle (%08x)\n", hModule );
return (FARPROC16)0; return (FARPROC16)0;
} }
hModule = GetExePtr( hModule ); return GetProcAddress16( hModule, name );
if (HIWORD(name)) {
ordinal = NE_GetOrdinal( hModule, name );
TRACE("%04x '%s'\n", hModule, name );
} else {
ordinal = LOWORD(name);
TRACE("%04x %04x\n", hModule, ordinal );
}
if (!ordinal) return (FARPROC16)0;
ret = NE_GetEntryPoint( hModule, ordinal );
TRACE("returning %08x\n",(UINT)ret);
return ret;
} }
/*********************************************************************** /***********************************************************************
* GetProcAddress16 (KERNEL.50) * GetProcAddress16 (KERNEL.50)
*/ */
FARPROC16 WINAPI GetProcAddress16( HMODULE16 hModule, SEGPTR name ) FARPROC16 WINAPI GetProcAddress16( HMODULE16 hModule, LPCSTR name )
{ {
WORD ordinal; WORD ordinal;
FARPROC16 ret; FARPROC16 ret;
@ -1672,8 +1658,8 @@ FARPROC16 WINAPI GetProcAddress16( HMODULE16 hModule, SEGPTR name )
if (HIWORD(name) != 0) if (HIWORD(name) != 0)
{ {
ordinal = NE_GetOrdinal( hModule, (LPSTR)PTR_SEG_TO_LIN(name) ); ordinal = NE_GetOrdinal( hModule, name );
TRACE("%04x '%s'\n", hModule, (LPSTR)PTR_SEG_TO_LIN(name) ); TRACE("%04x '%s'\n", hModule, name );
} }
else else
{ {

View file

@ -320,12 +320,9 @@ static HGLOBAL RES_LoadResource( HMODULE hModule, HRSRC hRsrc, BOOL bRet16 )
/********************************************************************** /**********************************************************************
* FindResource16 (KERNEL.60) * FindResource16 (KERNEL.60)
*/ */
HRSRC16 WINAPI FindResource16( HMODULE16 hModule, SEGPTR name, SEGPTR type ) HRSRC16 WINAPI FindResource16( HMODULE16 hModule, LPCSTR name, LPCSTR type )
{ {
LPCSTR nameStr = HIWORD(name)? PTR_SEG_TO_LIN(name) : (LPCSTR)name; return RES_FindResource( hModule, type, name,
LPCSTR typeStr = HIWORD(type)? PTR_SEG_TO_LIN(type) : (LPCSTR)type;
return RES_FindResource( hModule, typeStr, nameStr,
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), FALSE, TRUE ); MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), FALSE, TRUE );
} }

View file

@ -1040,20 +1040,18 @@ HCURSOR16 CURSORICON_IconToCursor(HICON16 hIcon, BOOL bSemiTransparent)
/*********************************************************************** /***********************************************************************
* LoadCursor16 (USER.173) * LoadCursor16 (USER.173)
*/ */
HCURSOR16 WINAPI LoadCursor16( HINSTANCE16 hInstance, SEGPTR name ) HCURSOR16 WINAPI LoadCursor16( HINSTANCE16 hInstance, LPCSTR name )
{ {
LPCSTR nameStr = HIWORD(name)? PTR_SEG_TO_LIN(name) : (LPCSTR)name; return LoadCursorA( hInstance, name );
return LoadCursorA( hInstance, nameStr );
} }
/*********************************************************************** /***********************************************************************
* LoadIcon16 (USER.174) * LoadIcon16 (USER.174)
*/ */
HICON16 WINAPI LoadIcon16( HINSTANCE16 hInstance, SEGPTR name ) HICON16 WINAPI LoadIcon16( HINSTANCE16 hInstance, LPCSTR name )
{ {
LPCSTR nameStr = HIWORD(name)? PTR_SEG_TO_LIN(name) : (LPCSTR)name; return LoadIconA( hInstance, name );
return LoadIconA( hInstance, nameStr );
} }
@ -2304,8 +2302,7 @@ HBITMAP WINAPI LoadBitmapA( HINSTANCE instance, LPCSTR name )
/********************************************************************** /**********************************************************************
* LoadBitmap16 (USER.175) * LoadBitmap16 (USER.175)
*/ */
HBITMAP16 WINAPI LoadBitmap16( HINSTANCE16 instance, SEGPTR name ) HBITMAP16 WINAPI LoadBitmap16( HINSTANCE16 instance, LPCSTR name )
{ {
LPCSTR nameStr = HIWORD(name)? PTR_SEG_TO_LIN(name) : (LPCSTR)name; return LoadBitmapA( instance, name );
return LoadBitmapA( instance, nameStr );
} }

View file

@ -710,12 +710,7 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCSTR dlgTemplate,
if (template.menuName) if (template.menuName)
{ {
if (!win32Template) if (!win32Template) hMenu = LoadMenu16( hInst, template.menuName );
{
LPSTR str = SEGPTR_STRDUP( template.menuName );
hMenu = LoadMenu16( hInst, SEGPTR_GET(str) );
SEGPTR_FREE( str );
}
else hMenu = LoadMenuW( hInst, (LPCWSTR)template.menuName ); else hMenu = LoadMenuW( hInst, (LPCWSTR)template.menuName );
} }
@ -891,7 +886,7 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCSTR dlgTemplate,
/*********************************************************************** /***********************************************************************
* CreateDialog16 (USER.89) * CreateDialog16 (USER.89)
*/ */
HWND16 WINAPI CreateDialog16( HINSTANCE16 hInst, SEGPTR dlgTemplate, HWND16 WINAPI CreateDialog16( HINSTANCE16 hInst, LPCSTR dlgTemplate,
HWND16 owner, DLGPROC16 dlgProc ) HWND16 owner, DLGPROC16 dlgProc )
{ {
return CreateDialogParam16( hInst, dlgTemplate, owner, dlgProc, 0 ); return CreateDialogParam16( hInst, dlgTemplate, owner, dlgProc, 0 );
@ -901,7 +896,7 @@ HWND16 WINAPI CreateDialog16( HINSTANCE16 hInst, SEGPTR dlgTemplate,
/*********************************************************************** /***********************************************************************
* CreateDialogParam16 (USER.241) * CreateDialogParam16 (USER.241)
*/ */
HWND16 WINAPI CreateDialogParam16( HINSTANCE16 hInst, SEGPTR dlgTemplate, HWND16 WINAPI CreateDialogParam16( HINSTANCE16 hInst, LPCSTR dlgTemplate,
HWND16 owner, DLGPROC16 dlgProc, HWND16 owner, DLGPROC16 dlgProc,
LPARAM param ) LPARAM param )
{ {
@ -910,10 +905,10 @@ HWND16 WINAPI CreateDialogParam16( HINSTANCE16 hInst, SEGPTR dlgTemplate,
HGLOBAL16 hmem; HGLOBAL16 hmem;
LPCVOID data; LPCVOID data;
TRACE("%04x,%08lx,%04x,%08lx,%ld\n", TRACE("%04x,%s,%04x,%08lx,%ld\n",
hInst, (DWORD)dlgTemplate, owner, (DWORD)dlgProc, param ); hInst, debugres_a(dlgTemplate), owner, (DWORD)dlgProc, param );
if (!(hRsrc = FindResource16( hInst, dlgTemplate, RT_DIALOG16 ))) return 0; if (!(hRsrc = FindResource16( hInst, dlgTemplate, RT_DIALOGA ))) return 0;
if (!(hmem = LoadResource16( hInst, hRsrc ))) return 0; if (!(hmem = LoadResource16( hInst, hRsrc ))) return 0;
if (!(data = LockResource16( hmem ))) hwnd = 0; if (!(data = LockResource16( hmem ))) hwnd = 0;
else hwnd = CreateDialogIndirectParam16( hInst, data, owner, else hwnd = CreateDialogIndirectParam16( hInst, data, owner,
@ -1051,7 +1046,7 @@ static INT DIALOG_DoDialogBox( HWND hwnd, HWND owner )
/*********************************************************************** /***********************************************************************
* DialogBox16 (USER.87) * DialogBox16 (USER.87)
*/ */
INT16 WINAPI DialogBox16( HINSTANCE16 hInst, SEGPTR dlgTemplate, INT16 WINAPI DialogBox16( HINSTANCE16 hInst, LPCSTR dlgTemplate,
HWND16 owner, DLGPROC16 dlgProc ) HWND16 owner, DLGPROC16 dlgProc )
{ {
return DialogBoxParam16( hInst, dlgTemplate, owner, dlgProc, 0 ); return DialogBoxParam16( hInst, dlgTemplate, owner, dlgProc, 0 );
@ -1061,7 +1056,7 @@ INT16 WINAPI DialogBox16( HINSTANCE16 hInst, SEGPTR dlgTemplate,
/*********************************************************************** /***********************************************************************
* DialogBoxParam16 (USER.239) * DialogBoxParam16 (USER.239)
*/ */
INT16 WINAPI DialogBoxParam16( HINSTANCE16 hInst, SEGPTR template, INT16 WINAPI DialogBoxParam16( HINSTANCE16 hInst, LPCSTR template,
HWND16 owner, DLGPROC16 dlgProc, LPARAM param ) HWND16 owner, DLGPROC16 dlgProc, LPARAM param )
{ {
HWND16 hwnd = 0; HWND16 hwnd = 0;
@ -1070,7 +1065,7 @@ INT16 WINAPI DialogBoxParam16( HINSTANCE16 hInst, SEGPTR template,
LPCVOID data; LPCVOID data;
int ret = -1; int ret = -1;
if (!(hRsrc = FindResource16( hInst, template, RT_DIALOG16 ))) return 0; if (!(hRsrc = FindResource16( hInst, template, RT_DIALOGA ))) return 0;
if (!(hmem = LoadResource16( hInst, hRsrc ))) return 0; if (!(hmem = LoadResource16( hInst, hRsrc ))) return 0;
if (!(data = LockResource16( hmem ))) hwnd = 0; if (!(data = LockResource16( hmem ))) hwnd = 0;
else hwnd = DIALOG_CreateIndirect( hInst, data, FALSE, owner, else hwnd = DIALOG_CreateIndirect( hInst, data, FALSE, owner,
@ -1480,7 +1475,7 @@ static BOOL DIALOG_IsDialogMessage( HWND hwnd, HWND hwndDlg,
/*********************************************************************** /***********************************************************************
* IsDialogMessage16 (USER.90) * IsDialogMessage16 (USER.90)
*/ */
BOOL16 WINAPI WIN16_IsDialogMessage16( HWND16 hwndDlg, SEGPTR msg16 ) BOOL16 WINAPI IsDialogMessage16( HWND16 hwndDlg, SEGPTR msg16 )
{ {
LPMSG16 msg = PTR_SEG_TO_LIN(msg16); LPMSG16 msg = PTR_SEG_TO_LIN(msg16);
BOOL ret, translate, dispatch; BOOL ret, translate, dispatch;
@ -1503,17 +1498,6 @@ BOOL16 WINAPI WIN16_IsDialogMessage16( HWND16 hwndDlg, SEGPTR msg16 )
} }
BOOL16 WINAPI IsDialogMessage16( HWND16 hwndDlg, LPMSG16 msg )
{
LPMSG16 msg16 = SEGPTR_NEW(MSG16);
BOOL ret;
*msg16 = *msg;
ret = WIN16_IsDialogMessage16( hwndDlg, SEGPTR_GET(msg16) );
SEGPTR_FREE(msg16);
return ret;
}
/*********************************************************************** /***********************************************************************
* IsDialogMessageA (USER32.342) * IsDialogMessageA (USER32.342)
*/ */

View file

@ -739,7 +739,7 @@ static HDRVR16 DRIVER_TryOpenDriver16(LPCSTR lpFileName, LPARAM lParam, BOOL bCa
lpSFN = (lpSFN) ? (lpSFN + 1) : lpFileName; lpSFN = (lpSFN) ? (lpSFN + 1) : lpFileName;
if ((hModule = LoadModule16(lpFileName, (LPVOID)-1)) >= 32) { if ((hModule = LoadModule16(lpFileName, (LPVOID)-1)) >= 32) {
if ((lpProc = (DRIVERPROC16)WIN32_GetProcAddress16(hModule, "DRIVERPROC")) != NULL) { if ((lpProc = (DRIVERPROC16)GetProcAddress16(hModule, "DRIVERPROC")) != NULL) {
lpDrv = DRIVER_RegisterDriver16(lpSFN, hModule, lpProc, lParam, bCallFrom32); lpDrv = DRIVER_RegisterDriver16(lpSFN, hModule, lpProc, lParam, bCallFrom32);
} else { } else {
FreeLibrary16(hModule); FreeLibrary16(hModule);

View file

@ -904,23 +904,17 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom,
if (cs->hMenu) SetMenu(hwnd, cs->hMenu); if (cs->hMenu) SetMenu(hwnd, cs->hMenu);
else else
{ {
#if 0 /* FIXME: should check if classPtr->menuNameW can be used as is */ /* FIXME: should check if classPtr->menuNameW can be used as is */
if (classPtr->menuNameA) LPCSTR menuName = (LPCSTR)GetClassLongA( hwnd, GCL_MENUNAME );
cs->hMenu = HIWORD(classPtr->menuNameA) ?
LoadMenu(cs->hInstance,SEGPTR_GET(classPtr->menuNameA)):
LoadMenu(cs->hInstance,(SEGPTR)classPtr->menuNameA);
#else
SEGPTR menuName = (SEGPTR)GetClassLong16( hwnd, GCL_MENUNAME );
if (menuName) if (menuName)
{ {
if (HIWORD(cs->hInstance)) if (HIWORD(cs->hInstance))
cs->hMenu = LoadMenuA(cs->hInstance,PTR_SEG_TO_LIN(menuName)); cs->hMenu = LoadMenuA(cs->hInstance,menuName);
else else
cs->hMenu = LoadMenu16(cs->hInstance,menuName); cs->hMenu = LoadMenu16(cs->hInstance,menuName);
if (cs->hMenu) SetMenu( hwnd, cs->hMenu ); if (cs->hMenu) SetMenu( hwnd, cs->hMenu );
} }
#endif
} }
} }
else wndPtr->wIDmenu = (UINT)cs->hMenu; else wndPtr->wIDmenu = (UINT)cs->hMenu;
@ -3286,7 +3280,7 @@ DWORD WINAPI DragObject16( HWND16 hwndScope, HWND16 hWnd, UINT16 wObj,
return 0L; return 0L;
} }
hBummer = LoadCursor16(0, IDC_BUMMER16); hBummer = LoadCursorA(0, IDC_BUMMERA);
if( !hBummer || !wndPtr ) if( !hBummer || !wndPtr )
{ {