Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1404 lines
43 KiB

  1. /*++
  2. *
  3. * WOW v1.0
  4. *
  5. * Copyright (c) 1991, Microsoft Corporation
  6. *
  7. * WUDLG.C
  8. * WOW32 16-bit User API support
  9. *
  10. * History:
  11. * Created 07-Mar-1991 by Jeff Parsons (jeffpar)
  12. --*/
  13. #include "precomp.h"
  14. #pragma hdrstop
  15. MODNAME(wudlg.c);
  16. extern DOSWOWDATA DosWowData;
  17. // SendDlgItemMessage cache
  18. extern HWND hdlgSDIMCached ;
  19. /*++
  20. void CheckDlgButton(<hDlg>, <nIDButton>, <wCheck>)
  21. HWND <hDlg>;
  22. int <nIDButton>;
  23. WORD <wCheck>;
  24. The %CheckDlgButton% function places a checkmark next to or removes a
  25. checkmark from a button control, or changes the state of a three-state
  26. button. The %CheckDlgButton% function sends a BM_SETCHECK message to the
  27. button control that has the specified ID in the given dialog box.
  28. <hDlg>
  29. Identifies the dialog box that contains the button.
  30. <nIDButton>
  31. Specifies the button control to be modified.
  32. <wCheck>
  33. Specifies the action to take. If the <wCheck> parameter is
  34. nonzero, the %CheckDlgButton% function places a checkmark next to the
  35. button; if zero, the checkmark is removed. For three-state buttons, if
  36. <wCheck> is 2, the button is grayed; if <wCheck> is 1, it is checked; if
  37. <wCheck> is 0, the checkmark is removed.
  38. This function does not return a value.
  39. --*/
  40. ULONG FASTCALL WU32CheckDlgButton(PVDMFRAME pFrame)
  41. {
  42. register PCHECKDLGBUTTON16 parg16;
  43. GETARGPTR(pFrame, sizeof(CHECKDLGBUTTON16), parg16);
  44. CheckDlgButton(
  45. HWND32(parg16->f1),
  46. WORD32(parg16->f2),
  47. WORD32(parg16->f3)
  48. );
  49. FREEARGPTR(parg16);
  50. RETURN(0);
  51. }
  52. /*++
  53. void CheckRadioButton(<hDlg>, <nIDFirstButton>, <nIDLastButton>,
  54. <nIDCheckButton>)
  55. HWND <hDlg>;
  56. int <nIDFirstButton>;
  57. int <nIDLastButton>;
  58. int <nIDCheckButton>;
  59. The %CheckRadioButton% function checks the radio button specified by the
  60. <nIDCheckButton> parameter and removes the checkmark from all other radio
  61. buttons in the group of buttons specified by the <nIDFirstButton> and
  62. <nIDLastButton> parameters. The %CheckRadioButton% function sends a
  63. BM_SETCHECK message to the radio-button control that has the specified ID in
  64. the given dialog box.
  65. <hDlg>
  66. Identifies the dialog box.
  67. <nIDFirstButton>
  68. Specifies the integer identifier of the first radio button in the
  69. group.
  70. <nIDLastButton>
  71. Specifies the integer identifier of the last radio button in the
  72. group.
  73. <nIDCheckButton>
  74. Specifies the integer identifier of the radio button to be
  75. checked.
  76. This function does not return a value.
  77. --*/
  78. ULONG FASTCALL WU32CheckRadioButton(PVDMFRAME pFrame)
  79. {
  80. register PCHECKRADIOBUTTON16 parg16;
  81. GETARGPTR(pFrame, sizeof(CHECKRADIOBUTTON16), parg16);
  82. CheckRadioButton(
  83. HWND32(parg16->f1),
  84. WORD32(parg16->f2),
  85. WORD32(parg16->f3),
  86. WORD32(parg16->f4)
  87. );
  88. FREEARGPTR(parg16);
  89. RETURN(0);
  90. }
  91. //***************************************************************************
  92. // HWND WINAPI CreateDialog(HINSTANCE, LPCSTR, HWND, DLGPROC);
  93. // HWND WINAPI CreateDialogIndirect(HINSTANCE, const void FAR*, HWND, DLGPROC);
  94. // HWND WINAPI CreateDialogParam(HINSTANCE, LPCSTR, HWND, DLGPROC, LPARAM);
  95. // HWND WINAPI CreateDialogIndirectParam(HINSTANCE, const void FAR*, HWND, DLGPROC, LPARAM);
  96. //
  97. // int WINAPI DialogBox(HINSTANCE, LPCSTR, HWND, DLGPROC);
  98. // int WINAPI DialogBoxIndirect(HINSTANCE, HGLOBAL, HWND, DLGPROC);
  99. // int WINAPI DialogBoxParam(HINSTANCE, LPCSTR, HWND, DLGPROC, LPARAM);
  100. // int WINAPI DialogBoxIndirectParam(HINSTANCE, HGLOBAL, HWND, DLGPROC, LPARAM);
  101. //
  102. // This is a common entry point for all the apis above. We distinguish
  103. // between 'create' and 'dialogbox' apis by a bool flag (parg16->f7).
  104. // TRUE implies 'dialogbox' apis else 'create' apis.
  105. //
  106. // - nanduri
  107. //***************************************************************************
  108. ULONG FASTCALL WU32DialogBoxParam(PVDMFRAME pFrame)
  109. {
  110. ULONG ul=(ULONG)-1;
  111. PVOID pDlg;
  112. DWORD cb, cb16;
  113. register PDIALOGBOXPARAM16 parg16;
  114. BYTE abT[1024];
  115. WNDPROC vpDlgProc = NULL;
  116. GETARGPTR(pFrame, sizeof(DIALOGBOXPARAM16), parg16);
  117. if (DWORD32(parg16->f4)) {
  118. // mark the proc as WOW proc and save the high bits in the RPL
  119. MarkWOWProc (parg16->f4,vpDlgProc);
  120. }
  121. if (!(cb16 = parg16->f6)) {
  122. cb = ConvertDialog16(NULL, DWORD32(parg16->f2), 0, cb16);
  123. }
  124. else {
  125. // The idea is eliminate a call to ConverDialog16
  126. //
  127. // the maximum size that 32bit dlgtemplate would be is twice
  128. // the 16bit dlgtemplate.
  129. //
  130. // this assumption is true cause - we convert most words to dwords
  131. // and ansi strings to unicode strings - since we know that a
  132. // DWORD is twice the sizeof a WORD a unicode character is 2bytes
  133. // therefore maxsize of dlgtemplate cannot exceed cb * 2.
  134. //
  135. // - nanduri
  136. cb = cb16 * max(sizeof(DWORD) / sizeof(WORD), sizeof(WCHAR)/sizeof(BYTE));
  137. WOW32ASSERT(cb >= ConvertDialog16(NULL, DWORD32(parg16->f2), 0, cb16));
  138. }
  139. pDlg = (cb > sizeof(abT)) ? malloc_w(cb) : (PVOID)abT;
  140. if (cb && pDlg) {
  141. cb = ConvertDialog16(pDlg, DWORD32(parg16->f2), cb, cb16);
  142. if (parg16->f7) {
  143. ul = GETINT16(DialogBoxIndirectParamAorW(HMODINST32(parg16->f1),
  144. pDlg, HWND32(parg16->f3),
  145. vpDlgProc,
  146. (LPARAM) DWORD32(parg16->f5), SCDLG_ANSI));
  147. }
  148. else {
  149. ul = GETHWND16((pfnOut.pfnServerCreateDialog)(HMODINST32(parg16->f1), (LPDLGTEMPLATE)pDlg,
  150. cb, HWND32(parg16->f3),
  151. vpDlgProc,
  152. (LPARAM) DWORD32(parg16->f5), SCDLG_CLIENT | SCDLG_ANSI | SCDLG_NOREVALIDATE));
  153. }
  154. if (pDlg != (PVOID)abT) {
  155. free_w (pDlg);
  156. }
  157. }
  158. // Invalidate SendDlgItemMessage cache
  159. hdlgSDIMCached = NULL ;
  160. FREEARGPTR(parg16);
  161. RETURN(ul);
  162. }
  163. /*++
  164. int DlgDirList(<hDlg>, <lpPathSpec>, <nIDListBox>, <nIDStaticPath>,
  165. <wFiletype>)
  166. HWND <hDlg>;
  167. LPSTR <lpPathSpec>;
  168. int <nIDListBox>;
  169. int <nIDStaticPath>;
  170. WORD <wFiletype>;
  171. The %DlgDirList% function fills a list-box control with a file or directory
  172. listing. It fills the list box specified by the <nIDListBox> parameter with
  173. the names of all files matching the pathname given by the <lpPathSpec>
  174. parameter.
  175. The %DlgDirList% function shows subdirectories enclosed in square brackets
  176. ([ ]), and shows drives in the form [-<x>-], where <x> is the drive letter.
  177. The <lpPathSpec> parameter has the following form:
  178. [drive:] [ [\u]directory[\idirectory]...\u] [filename]
  179. In this example, <drive> is a drive letter, <directory> is a valid directory
  180. name, and <filename> is a valid filename that must contain at least one
  181. wildcard character. The wildcard characters are a question mark (?), meaning
  182. match any character, and an asterisk (*), meaning match any number of
  183. characters.
  184. If the <lpPathSpec> parameter includes a drive and/or directory name, the
  185. current drive and directory are changed to the designated drive and
  186. directory before the list box is filled. The text control identified by the
  187. <nIDStaticPath> parameter is also updated with the new drive and/or
  188. directory name.
  189. After the list box is filled, <lpPathSpec> is updated by removing the drive
  190. and/or directory portion of the pathname.
  191. %DlgDirList% sends LB_RESETCONTENT and LB_DIR messages to the list box.
  192. <hDlg>
  193. Identifies the dialog box that contains the list box.
  194. <lpPathSpec>
  195. Points to a pathname string. The string must be a
  196. null-terminated character string.
  197. <nIDListBox>
  198. Specifies the identifier of a list-box control. If <nIDListBox> is
  199. zero, %DlgDirList% assumes that no list box exists and does not attempt
  200. to fill it.
  201. <nIDStaticPath>
  202. Specifies the identifier of the static-text control used for
  203. displaying the current drive and directory. If <nIDStaticPath> is zero,
  204. %DlgDirList% assumes that no such text control is present.
  205. <wFiletype>
  206. Specifies the attributes of the files to be displayed. It can be any
  207. combination of the following values:
  208. 0x0000
  209. Read/write data files with no additional attributes
  210. 0x0001
  211. Read-only files
  212. 0x0002
  213. Hidden files
  214. 0x0004
  215. System files
  216. 0x0010
  217. Subdirectories
  218. 0x0020
  219. Archives
  220. 0x2000
  221. LB_DIR flag. If the LB_DIR flag is set, Windows places the messages
  222. generated by %DlgDirList% in the application's queue; otherwise they are
  223. sent directly to the dialog function.
  224. 0x4000
  225. Drives
  226. 0x8000
  227. Exclusive bit. If the exclusive bit is set, only files of the specified
  228. type are listed. Otherwise, files of the specified type are listed in
  229. addition to normal files.
  230. The return value specifies the outcome of the function. It is nonzero if a
  231. listing was made, even an empty listing. A zero return value implies that
  232. the input string did not contain a valid search path.
  233. The <wFiletype> parameter specifies the DOS attributes of the files to be
  234. listed. Table 4.6 describes these attributes.
  235. --*/
  236. ULONG FASTCALL WU32DlgDirList(PVDMFRAME pFrame)
  237. {
  238. ULONG ul;
  239. PSZ psz2;
  240. register PDLGDIRLIST16 parg16;
  241. UpdateDosCurrentDirectory(DIR_DOS_TO_NT);
  242. GETARGPTR(pFrame, sizeof(DLGDIRLIST16), parg16);
  243. GETPSZPTR(parg16->f2, psz2);
  244. //
  245. // KidPix passes an invalid filetype flag (0x1000) that Win3.1 doesn't
  246. // check for. Win32 does, and fails the API, so mask that flag off here.
  247. // John Vert (jvert) 11-Jun-1993
  248. //
  249. ul = GETINT16(DlgDirList(
  250. HWND32(parg16->f1),
  251. psz2,
  252. WORD32(parg16->f3),
  253. WORD32(parg16->f4),
  254. WORD32(parg16->f5) & DDL_VALID
  255. ));
  256. UpdateDosCurrentDirectory(DIR_NT_TO_DOS);
  257. FREEPSZPTR(psz2);
  258. FREEARGPTR(parg16);
  259. RETURN(ul);
  260. }
  261. /*++
  262. int DlgDirListComboBox(<hDlg>, <lpPathSpec>, <nIDComboBox>, <nIDStaticPath>,
  263. <wFiletype>)
  264. HWND <hDlg>;
  265. LPSTR <lpPathSpec>;
  266. int <nIDComboBox>;
  267. int <nIDStaticPath>;
  268. WORD <wFiletype>;
  269. The %DlgDirListComboBox% function fills the list box of a combo-box control
  270. with a file or directory listing. It fills the list box of the combo box
  271. specified by the <nIDComboBox> parameter with the names of all files
  272. matching the pathname given by the <lpPathSpec> parameter.
  273. The %DlgDirListComboBox% function shows subdirectories enclosed in square
  274. brackets ([ ]), and shows drives in the form [-<x>-], where <x> is the drive
  275. letter.
  276. The <lpPathSpec> parameter has the following form:
  277. [drive:] [ [\u]directory[\idirectory]...\u] [filename]
  278. In this example, <drive> is a drive letter, <directory> is a valid directory
  279. name, and <filename> is a valid filename that must contain at least one
  280. wildcard character. The wildcard characters are a question mark (?), meaning
  281. match any character, and an asterisk (*), meaning match any number of
  282. characters.
  283. If the <lpPathSpec> parameter includes a drive and/or directory name, the
  284. current drive and directory are changed to the designated drive and
  285. directory before the list box is filled. The text control identified by the
  286. <nIDStaticPath> parameter is also updated with the new drive and/or
  287. directory name.
  288. After the combo-box list box is filled, <lpPathSpec> is updated by removing
  289. the drive and/or directory portion of the pathname.
  290. %DlgDirListComboBox% sends CB_RESETCONTENT and CB_DIR messages to the combo
  291. box.
  292. <hDlg>
  293. Identifies the dialog box that contains the combo box.
  294. <lpPathSpec>
  295. Points to a pathname string. The string must be a
  296. null-terminated string.
  297. <nIDComboBox>
  298. Specifies the identifier of a combo-box control in a dialog box.
  299. If <nIDComboBox> is zero, %DlgDirListComboBox% assumes that no combo box
  300. exists and does not attempt to fill it.
  301. <nIDStaticPath>
  302. Specifies the identifier of the static-text control used for
  303. displaying the current drive and directory. If <nIDStaticPath> is zero,
  304. %DlgDirListComboBox% assumes that no such text control is present.
  305. <wFiletype>
  306. Specifies DOS file attributes of the files to be displayed. It
  307. can be any combination of the following values:
  308. The return value specifies the outcome of the function. It is nonzero if a
  309. listing was made, even an empty listing. A zero return value implies that
  310. the input string did not contain a valid search path.
  311. --*/
  312. ULONG FASTCALL WU32DlgDirListComboBox(PVDMFRAME pFrame)
  313. {
  314. ULONG ul;
  315. PSZ psz2;
  316. register PDLGDIRLISTCOMBOBOX16 parg16;
  317. UpdateDosCurrentDirectory(DIR_DOS_TO_NT);
  318. GETARGPTR(pFrame, sizeof(DLGDIRLISTCOMBOBOX16), parg16);
  319. GETPSZPTR(parg16->f2, psz2);
  320. ul = GETINT16(DlgDirListComboBox(
  321. HWND32(parg16->f1),
  322. psz2,
  323. WORD32(parg16->f3),
  324. WORD32(parg16->f4),
  325. WORD32(parg16->f5)
  326. ));
  327. UpdateDosCurrentDirectory(DIR_NT_TO_DOS);
  328. FREEPSZPTR(psz2);
  329. FREEARGPTR(parg16);
  330. RETURN(ul);
  331. }
  332. /*++
  333. BOOL DlgDirSelectEx(<hDlg>, <lpString>, <nIDListBox>)
  334. HWND <hDlg>;
  335. LPSTR <lpString>;
  336. int <nIDListBox>;
  337. The %DlgDirSelectEx% function retrieves the current selection from a list
  338. box. It assumes that the list box has been filled by the %DlgDirList%
  339. function and that the selection is a drive letter, a file, or a directory
  340. name.
  341. The %DlgDirSelectEx% function copies the selection to the buffer given by the
  342. <lpString> parameter. If the current selection is a directory name or drive
  343. letter, %DlgDirSelectEx% removes the enclosing square brackets (and hyphens,
  344. for drive letters) so that the name or letter is ready to be inserted into a
  345. new pathname. If there is no selection, <lpString> does not change.
  346. %DlgDirSelectEx% sends LB_GETCURSEL and LB_GETTEXT messages to the list box.
  347. <hDlg>
  348. Identifies the dialog box that contains the list box.
  349. <lpString>
  350. Points to a buffer that is to receive the selected pathname.
  351. <nIDListBox>
  352. Specifies the integer ID of a list-box control in the dialog box.
  353. The return value specifies the status of the current list-box selection. It
  354. is TRUE if the current selection is a directory name. Otherwise, it is
  355. FALSE.
  356. The %DlgDirSelectEx% function does not allow more than one filename to be
  357. returned from a list box.
  358. The list box must not be a multiple-selection list box. If it is, this
  359. function will not return a zero value and <lpString> will remain unchanged.
  360. --*/
  361. ULONG FASTCALL WU32DlgDirSelect(PVDMFRAME pFrame)
  362. {
  363. ULONG ul;
  364. PSZ psz2;
  365. VPVOID vp;
  366. register PDLGDIRSELECT16 parg16;
  367. GETARGPTR(pFrame, sizeof(DLGDIRSELECT16), parg16);
  368. ALLOCVDMPTR(parg16->f2, MAX_VDMFILENAME, psz2);
  369. vp = parg16->f2;
  370. ul = GETBOOL16(DlgDirSelectEx(
  371. HWND32(parg16->f1),
  372. psz2,
  373. SIZE_BOGUS,
  374. WORD32(parg16->f3)
  375. ));
  376. // special case to keep common dialog structs in sync (see wcommdlg.c)
  377. Check_ComDlg_pszptr(CURRENTPTD()->CommDlgTd, vp);
  378. FLUSHVDMPTR(parg16->f2, strlen(psz2)+1, psz2);
  379. FREEVDMPTR(psz2);
  380. FREEARGPTR(parg16);
  381. RETURN(ul);
  382. }
  383. /*++
  384. BOOL DlgDirSelectComboBoxEx(<hDlg>, <lpString>, <nIDComboBox>)
  385. HWND <hDlg>;
  386. LPSTR <lpString>;
  387. int <nIDComboBox>;
  388. The %DlgDirSelectComboBoxEx% function retrieves the current selection from the
  389. list box of a combo box created with the CBS_SIMPLE style. It cannot be used
  390. with combo boxes created with either the CBS_DROPDOWN or CBS_DROPDOWNLIST
  391. style. It assumes that the list box has been filled by the
  392. %DlgDirListComboBox% function and that the selection is a drive letter, a
  393. file, or a directory name.
  394. The %DlgDirSelectComboBoxEx% function copies the selection to the buffer given
  395. by the <lpString> parameter. If the current selection is a directory name or
  396. drive letter, %DlgDirSelectComboBoxEx% removes the enclosing square brackets
  397. (and hyphens, for drive letters) so that the name or letter is ready to be
  398. inserted into a new pathname. If there is no selection, <lpString> does not
  399. change.
  400. %DlgDirSelectComboBoxEx% sends CB_GETCURSEL and CB_GETLBTEXT messages to the
  401. combo box.
  402. <hDlg>
  403. Identifies the dialog box that contains the combo box.
  404. <lpString>
  405. Points to a buffer that is to receive the selected pathname.
  406. <nIDComboBox>
  407. Specifies the integer ID of the combo-box control in the dialog
  408. box.
  409. The return value specifies the status of the current combo-box selection. It
  410. is TRUE if the current selection is a directory name. Otherwise, it is
  411. FALSE.
  412. The %DlgDirSelectComboBoxEx% function does not allow more than one filename to
  413. be returned from a combo box.
  414. --*/
  415. ULONG FASTCALL WU32DlgDirSelectComboBox(PVDMFRAME pFrame)
  416. {
  417. ULONG ul;
  418. PSZ psz2;
  419. VPVOID vp;
  420. register PDLGDIRSELECTCOMBOBOX16 parg16;
  421. GETARGPTR(pFrame, sizeof(DLGDIRSELECTCOMBOBOX16), parg16);
  422. ALLOCVDMPTR(parg16->f2, MAX_VDMFILENAME, psz2);
  423. vp = parg16->f2;
  424. ul = GETBOOL16(DlgDirSelectComboBoxEx(
  425. HWND32(parg16->f1),
  426. psz2,
  427. SIZE_BOGUS,
  428. WORD32(parg16->f3)
  429. ));
  430. // special case to keep common dialog structs in sync (see wcommdlg.c)
  431. Check_ComDlg_pszptr(CURRENTPTD()->CommDlgTd, vp);
  432. FLUSHVDMPTR(parg16->f2, strlen(psz2)+1, psz2);
  433. FREEVDMPTR(psz2);
  434. FREEARGPTR(parg16);
  435. RETURN(ul);
  436. }
  437. /*++
  438. void EndDialog(<hDlg>, <nResult>)
  439. HWND <hDlg>;
  440. int <nResult>;
  441. The %EndDialog% function terminates a modal dialog box and returns the given
  442. result to the %DialogBox% function that created the dialog box. The
  443. %EndDialog% function is required to complete processing whenever the
  444. %DialogBox% function is used to create a modal dialog box. The function must
  445. be used in the dialog function of the modal dialog box and should not be
  446. used for any other purpose.
  447. The dialog function can call %EndDialog% at any time, even during the
  448. processing of the WM_INITDIALOG message. If called during the WM_INITDIALOG
  449. message, the dialog box is terminated before it is shown or before the input
  450. focus is set.
  451. %EndDialog% does not terminate the dialog box immediately. Instead, it sets
  452. a flag that directs the dialog box to terminate as soon as the dialog
  453. function ends. The %EndDialog% function returns to the dialog function, so
  454. the dialog function must return control to Windows.
  455. <hDlg>
  456. Identifies the dialog box to be destroyed.
  457. <nResult>
  458. Specifies the value to be returned from the dialog box to the
  459. %DialogBox% function that created it.
  460. This function does not return a value.
  461. --*/
  462. ULONG FASTCALL WU32EndDialog(PVDMFRAME pFrame)
  463. {
  464. HWND hwnd;
  465. register PENDDIALOG16 parg16;
  466. GETARGPTR(pFrame, sizeof(ENDDIALOG16), parg16);
  467. hwnd = HWND32(parg16->f1);
  468. if(!EndDialog(hwnd, INT32(parg16->f2)) && IsWindow(hwnd)){
  469. CHAR szType[8];
  470. if(GetLastError() == ERROR_WINDOW_NOT_DIALOG ||
  471. (RealGetWindowClass(hwnd,szType,8) && WOW32_strnicmp(szType,"#32770",6))) {
  472. // jarbats
  473. // App is trying to close window created by CreateWindow
  474. // via EndDialog! whistler bug #231059
  475. DestroyWindow(hwnd);
  476. }
  477. }
  478. FREEARGPTR(parg16);
  479. RETURN(0);
  480. }
  481. /*++
  482. LONG GetDialogBaseUnits(VOID)
  483. The %GetDialogBaseUnits% function returns the dialog base units used by
  484. Windows when creating dialog boxes. An application should use these values
  485. to calculate the average width of characters in the system font.
  486. This function has no parameters.
  487. The return value specifies the dialog base units. The high-order word
  488. contains the height in pixels of the current dialog base height unit derived
  489. from the height of the system font, and the low-order word contains the
  490. width in pixels of the current dialog base width unit derived from the width
  491. of the system font.
  492. The values returned represent dialog base units before being scaled to
  493. actual dialog units. The actual dialog unit in the <x> direction is
  494. 1/4th of the width returned by %GetDialogBaseUnits%. The actual dialog
  495. unit in the <y> direction is 1/8th of the height returned by the
  496. function.
  497. To determine the actual height and width in pixels of a control, given the
  498. height (x) and width (y) in dialog units and the return value
  499. (lDlgBaseUnits) from calling %GetDialogBaseUnits%, use the following
  500. formula:
  501. (x * LOWORD(lDlgBaseUnits))/4
  502. (y * HIWORD(lDlgBaseUnits))/8
  503. To avoid rounding problems, perform the multiplication before the division
  504. in case the dialog base units are not evenly divisible by four.
  505. --*/
  506. ULONG FASTCALL WU32GetDialogBaseUnits(PVDMFRAME pFrame)
  507. {
  508. ULONG ul;
  509. UNREFERENCED_PARAMETER(pFrame);
  510. ul = GETLONG16(GetDialogBaseUnits());
  511. RETURN(ul);
  512. }
  513. /*++
  514. int GetDlgCtrlID(<hwnd>)
  515. HWND <hwnd>;
  516. The %GetDlgCtrlID% function returns the ID value of the child window
  517. identified by the <hwnd> parameter.
  518. <hwnd>
  519. Identifies the child window.
  520. The return value is the numeric identifier of the child window if the
  521. function is successful. If the function fails, or if <hwnd> is not a valid
  522. window handle, the return value is NULL.
  523. Since top-level windows do not have an ID value, the return value of this
  524. function is invalid if the <hwnd> parameter identifies a top-level window.
  525. --*/
  526. ULONG FASTCALL WU32GetDlgCtrlID(PVDMFRAME pFrame)
  527. {
  528. ULONG ul;
  529. register PGETDLGCTRLID16 parg16;
  530. GETARGPTR(pFrame, sizeof(GETDLGCTRLID16), parg16);
  531. ul = GETINT16(GetDlgCtrlID(
  532. HWND32(parg16->f1)
  533. ));
  534. FREEARGPTR(parg16);
  535. RETURN(ul);
  536. }
  537. /*++
  538. WORD GetDlgItemInt(<hDlg>, <nIDDlgItem>, <lpTranslated>, <bSigned>)
  539. HWND <hDlg>;
  540. int <nIDDlgItem>;
  541. BOOL FAR *<lpTranslated>;
  542. BOOL <bSigned>;
  543. The %GetDlgItemInt% function translates the text of a control in the given
  544. dialog box into an integer value. The %GetDlgItemInt% function retrieves the
  545. text of the control identified by the <nIDDlgItem> parameter. It translates
  546. the text by stripping any extra spaces at the beginning of the text and
  547. converting decimal digits, stopping the translation when it reaches the end
  548. of the text or encounters any nonnumeric character. If the <bSigned>
  549. parameter is TRUE, %GetDlgItemInt% checks for a minus sign (-) at the
  550. beginning of the text and translates the text into a signed number.
  551. Otherwise, it creates an unsigned value.
  552. %GetDlgItemInt% returns zero if the translated number is greater than 32,767
  553. (for signed numbers) or 65,535 (for unsigned). When errors occur, such as
  554. encountering nonnumeric characters and exceeding the given maximum,
  555. %GetDlgItemInt% copies zero to the location pointed to by the <lpTranslated>
  556. parameter. If there are no errors, <lpTranslated> receives a nonzero value.
  557. If <lpTranslated> is NULL, %GetDlgItemInt% does not warn about errors.
  558. %GetDlgItemInt% sends a WM_GETTEXT message to the control.
  559. <hDlg>
  560. Identifies the dialog box.
  561. <nIDDlgItem>
  562. Specifies the integer identifier of the dialog-box item to be
  563. translated.
  564. <lpTranslated>
  565. Points to the Boolean variable that is to receive the
  566. translated flag.
  567. <bSigned>
  568. Specifies whether the value to be retrieved is signed.
  569. The return value specifies the translated value of the dialog-box item text.
  570. Since zero is a valid return value, the <lpTranslated> parameter must be
  571. used to detect errors. If a signed return value is desired, it should be
  572. cast as an %int% type.
  573. --*/
  574. ULONG FASTCALL WU32GetDlgItemInt(PVDMFRAME pFrame)
  575. {
  576. ULONG ul;
  577. BOOL t3;
  578. register PGETDLGITEMINT16 parg16;
  579. GETARGPTR(pFrame, sizeof(GETDLGITEMINT16), parg16);
  580. ul = GETWORD16(GetDlgItemInt(
  581. HWND32(parg16->f1),
  582. WORD32(parg16->f2), // see comment in wu32getdlgitem
  583. &t3,
  584. BOOL32(parg16->f4)
  585. ));
  586. PUTBOOL16(parg16->f3, t3);
  587. FREEARGPTR(parg16);
  588. RETURN(ul);
  589. }
  590. /*++
  591. int GetDlgItemText(<hDlg>, <nIDDlgItem>, <lpString>, <nMaxCount>)
  592. HWND <hDlg>;
  593. int <nIDDlgItem>;
  594. LPSTR <lpString>;
  595. int <nMaxCount>;
  596. The %GetDlgItemText% function retrieves the caption or text associated with
  597. a control in a dialog box. The %GetDlgItemText% function copies the text to
  598. the location pointed to by the <lpString> parameter and returns a count of
  599. the number of characters it copies.
  600. %GetDlgItemText% sends a WM_GETTEXT message to the control.
  601. <hDlg>
  602. Identifies the dialog box that contains the control.
  603. <nIDDlgItem>
  604. Specifies the integer identifier of the dialog-box item whose
  605. caption or text is to be retrieved.
  606. <lpString>
  607. Points to the buffer to receive the text.
  608. <nMaxCount>
  609. Specifies the maximum length (in bytes) of the string to be copied
  610. to <lpString>. If the string is longer than <nMaxCount>, it is
  611. truncated.
  612. The return value specifies the actual number of characters copied to the
  613. buffer. It is zero if no text is copied.
  614. --*/
  615. ULONG FASTCALL WU32GetDlgItemText(PVDMFRAME pFrame)
  616. {
  617. ULONG ul;
  618. PSZ psz3;
  619. VPVOID vp;
  620. register PGETDLGITEMTEXT16 parg16;
  621. GETARGPTR(pFrame, sizeof(GETDLGITEMTEXT16), parg16);
  622. ALLOCVDMPTR(parg16->f3, parg16->f4, psz3);
  623. vp = parg16->f3;
  624. ul = GETINT16(GetDlgItemText(
  625. HWND32(parg16->f1),
  626. WORD32(parg16->f2), // see comment in wu32getdlgitem
  627. psz3,
  628. WORD32(parg16->f4)
  629. ));
  630. // special case to keep common dialog structs in sync (see wcommdlg.c)
  631. Check_ComDlg_pszptr(CURRENTPTD()->CommDlgTd, vp);
  632. FLUSHVDMPTR(parg16->f3, strlen(psz3)+1, psz3);
  633. FREEVDMPTR(psz3);
  634. FREEARGPTR(parg16);
  635. RETURN(ul);
  636. }
  637. /*++
  638. HWND GetNextDlgGroupItem(<hDlg>, <hCtl>, <bPrevious>)
  639. HWND <hDlg>;
  640. HWND <hCtl>;
  641. BOOL <bPrevious>;
  642. The %GetNextDlgGroupItem% function searches for the next (or previous)
  643. control within a group of controls in the dialog box identified by the
  644. <hDlg> parameter. A group of controls consists of one or more controls with
  645. WS_GROUP style.
  646. <hDlg>
  647. Identifies the dialog box being searched.
  648. <hCtl>
  649. Identifies the control in the dialog box where the search starts.
  650. <bPrevious>
  651. Specifies how the function is to search the group of controls in the
  652. dialog box. If the <bPrevious> parameter is zero, the function searches
  653. for the previous control in the group. If -<bPrevious> is TRUE, the
  654. function searches for the next control in the group.
  655. The return value identifies the next or previous control in the group.
  656. If the current item is the last item in the group and <bPrevious> is FALSE,
  657. the %GetNextDlgGroupItem% function returns the window handle of the first
  658. item in the group. If the current item is the first item in the group and
  659. <bPrevious> is TRUE, %GetNextDlgGroupItem% returns the window handle of the
  660. last item in the group.
  661. --*/
  662. ULONG FASTCALL WU32GetNextDlgGroupItem(PVDMFRAME pFrame)
  663. {
  664. ULONG ul;
  665. register PGETNEXTDLGGROUPITEM16 parg16;
  666. GETARGPTR(pFrame, sizeof(GETNEXTDLGGROUPITEM16), parg16);
  667. ul = GETHWND16(GetNextDlgGroupItem(HWND32(parg16->f1),
  668. HWND32(parg16->f2),
  669. BOOL32(parg16->f3)));
  670. FREEARGPTR(parg16);
  671. RETURN(ul);
  672. }
  673. /*++
  674. HWND GetNextDlgTabItem(<hDlg>, <hCtl>, <bPrevious>)
  675. HWND <hDlg>;
  676. HWND <hCtl>;
  677. BOOL <bPrevious>;
  678. The %GetNextDlgTabItem% function obtains the handle of the first control
  679. that has the WS_TABSTOP style that precedes (or follows) the control
  680. identified by the <hCtl> parameter.
  681. <hDlg>
  682. Identifies the dialog box being searched.
  683. <hCtl>
  684. Identifies the control to be used as a starting point for the
  685. search.
  686. <bPrevious>
  687. Specifies how the function is to search the dialog box. If the
  688. <bPrevious> parameter is FALSE, the function searches for the previous
  689. control in the dialog box. If <bPrevious> is TRUE, the function searches
  690. for the next control in the dialog box. Identifies the control to be
  691. used as a starting point for the search.
  692. The return value identifies the previous (or next) control that has the
  693. WS_TABSTOP style set.
  694. --*/
  695. ULONG FASTCALL WU32GetNextDlgTabItem(PVDMFRAME pFrame)
  696. {
  697. ULONG ul;
  698. register PGETNEXTDLGTABITEM16 parg16;
  699. GETARGPTR(pFrame, sizeof(GETNEXTDLGTABITEM16), parg16);
  700. ul = GETHWND16(GetNextDlgTabItem(HWND32(parg16->f1),
  701. HWND32(parg16->f2),
  702. BOOL32(parg16->f3)));
  703. FREEARGPTR(parg16);
  704. RETURN(ul);
  705. }
  706. /*++
  707. BOOL IsDialogMessage(<hDlg>, <lpMsg>)
  708. HWND <hDlg>;
  709. LPMSG <lpMsg>;
  710. The %IsDialogMessage% function determines whether the given message is
  711. intended for the modeless dialog box specified by the <hDlg> parameter, and
  712. automatically processes the message if it is. When the %IsDialogMessage%
  713. function processes a message, it checks for keyboard messages and converts
  714. them into selection commands for the corresponding dialog box. For example,
  715. the ^TAB^ key selects the next control or group of controls, and the ^DOWN^
  716. key selects the next control in a group.
  717. If a message is processed by %IsDialogMessage%, it must not be passed to the
  718. %TranslateMessage% or %DispatchMessage% function. This is because
  719. %IsDialogMessage% performs all necessary translating and dispatching of
  720. messages.
  721. %IsDialogMessage% sends WM_GETDLGCODE messages to the dialog function to
  722. determine which keys should be processed.
  723. <hDlg>
  724. Identifies the dialog box.
  725. <lpMsg>
  726. Points to an %MSG% structure that contains the message to
  727. be checked.
  728. The return value specifies whether or not the given message has been
  729. processed. It is TRUE if the message has been processed. Otherwise, it is
  730. FALSE.
  731. Although %IsDialogMessage% is intended for modeless dialog boxes, it can be
  732. used with any window that contains controls to provide the same keyboard
  733. selection as in a dialog box.
  734. --*/
  735. ULONG FASTCALL WU32IsDialogMessage(PVDMFRAME pFrame)
  736. {
  737. ULONG ul;
  738. MSG t2;
  739. register PISDIALOGMESSAGE16 parg16;
  740. MSGPARAMEX mpex;
  741. PMSG16 pMsg16;
  742. GETARGPTR(pFrame, sizeof(ISDIALOGMESSAGE16), parg16);
  743. GETMISCPTR(parg16->f2, pMsg16);
  744. mpex.Parm16.WndProc.hwnd = pMsg16->hwnd;
  745. mpex.Parm16.WndProc.wMsg = pMsg16->message;
  746. mpex.Parm16.WndProc.wParam = pMsg16->wParam;
  747. mpex.Parm16.WndProc.lParam = pMsg16->lParam;
  748. mpex.iMsgThunkClass = WOWCLASS_WIN16;
  749. ThunkMsg16(&mpex);
  750. GETFRAMEPTR(((PTD)CURRENTPTD())->vpStack, pFrame);
  751. GETARGPTR(pFrame, sizeof(ISDIALOGMESSAGE16), parg16);
  752. t2.message = mpex.uMsg;
  753. t2.wParam = mpex.uParam;
  754. t2.lParam = mpex.lParam;
  755. t2.hwnd = HWND32(FETCHWORD(pMsg16->hwnd));
  756. t2.time = FETCHLONG(pMsg16->time);
  757. t2.pt.x = FETCHSHORT(pMsg16->pt.x);
  758. t2.pt.y = FETCHSHORT(pMsg16->pt.y);
  759. ul = GETBOOL16(IsDialogMessage(
  760. HWND32(parg16->f1),
  761. &t2
  762. ));
  763. if (MSG16NEEDSTHUNKING(&mpex)) {
  764. mpex.uMsg = t2.message;
  765. mpex.uParam = t2.wParam;
  766. mpex.lParam = t2.lParam;
  767. (mpex.lpfnUnThunk16)(&mpex);
  768. }
  769. FREEARGPTR(parg16);
  770. RETURN(ul);
  771. }
  772. /*++
  773. WORD IsDlgButtonChecked(<hDlg>, <nIDButton>)
  774. HWND <hDlg>;
  775. int <nIDButton>;
  776. The %IsDlgButtonChecked% function determines whether a button control has a
  777. checkmark next to it, and whether a three-state button control is grayed,
  778. checked, or neither. The %IsDlgButtonChecked% function sends a BM_GETCHECK
  779. message to the button control.
  780. <hDlg>
  781. Identifies the dialog box that contains the button control.
  782. <nIDButton>
  783. Specifies the integer identifier of the button control.
  784. The return value specifies the outcome of the function. It is nonzero if the
  785. given control has a checkmark next to it. Otherwise, it is zero. For
  786. three-state buttons, the return value is 2 if the button is grayed, 1 if the
  787. button has a checkmark next to it, and zero otherwise.
  788. --*/
  789. ULONG FASTCALL WU32IsDlgButtonChecked(PVDMFRAME pFrame)
  790. {
  791. ULONG ul;
  792. register PISDLGBUTTONCHECKED16 parg16;
  793. GETARGPTR(pFrame, sizeof(ISDLGBUTTONCHECKED16), parg16);
  794. ul = GETWORD16(IsDlgButtonChecked(
  795. HWND32(parg16->f1),
  796. WORD32(parg16->f2)
  797. ));
  798. FREEARGPTR(parg16);
  799. RETURN(ul);
  800. }
  801. /*++
  802. void MapDialogRect(<hDlg>, <lpRect>)
  803. HDLG <hDlg>;
  804. LPRECT <lpRect>;
  805. The %MapDialogRect% function converts the dialog-box units given in the
  806. <lpRect> parameter to screen units. Dialog-box units are stated in terms of
  807. the current dialog base unit derived from the average width and height of
  808. characters in the system font. One horizontal unit is one-fourth of the
  809. dialog base width unit, and one vertical unit is one-eighth of the dialog
  810. base height unit. The %GetDialogBaseUnits% function returns the dialog base
  811. units in pixels.
  812. The %MapDialogRect% function replaces the dialog-box units in <lpRect> with
  813. screen units (pixels), so that the rectangle can be used to create a dialog
  814. box or position a control within a box.
  815. <hDlg>
  816. Identifies a dialog box.
  817. <lpRect>
  818. Points to a %RECT% structure that contains the dialog-box
  819. coordinates to be converted.
  820. This function does not return a value.
  821. The <hDlg> parameter must be created by using the %CreateDialog% or
  822. %DialogBox% function.
  823. --*/
  824. ULONG FASTCALL WU32MapDialogRect(PVDMFRAME pFrame)
  825. {
  826. RECT t2;
  827. register PMAPDIALOGRECT16 parg16;
  828. GETARGPTR(pFrame, sizeof(MAPDIALOGRECT16), parg16);
  829. WOW32VERIFY(GETRECT16(parg16->f2, &t2));
  830. MapDialogRect(
  831. HWND32(parg16->f1),
  832. &t2
  833. );
  834. PUTRECT16(parg16->f2, &t2);
  835. FREEARGPTR(parg16);
  836. RETURN(0);
  837. }
  838. /*++
  839. int MessageBox(<hwndParent>, <lpText>, <lpCaption>, <wType>)
  840. HWND <hwndParent>;
  841. LPSTR <lpText>;
  842. LPSTR <lpCaption>;
  843. WORD <wType>;
  844. The %MessageBox% function creates and displays a window that contains an
  845. application-supplied message and caption, plus any combination of the
  846. predefined icons and push buttons described in the following list.
  847. <hwndParent>
  848. Identifies the window that owns the message box.
  849. <lpText>
  850. Points to a null-terminated string containing the message to be
  851. displayed.
  852. <lpCaption>
  853. Points to a null-terminated string to be used for the dialog-box
  854. caption. If the <lpCaption> parameter is NULL, the default caption Error
  855. is used.
  856. <wType>
  857. Specifies the contents of the dialog box. It can be any
  858. combination of the following values:
  859. MB_ABORTRETRYIGNORE
  860. Message box contains three push buttons: Abort, Retry, and Ignore.
  861. MB_APPLMODAL
  862. The user must respond to the message box before continuing work in the
  863. window identified by the <hwndParent> parameter. However, the user can
  864. move to the windows of other applications and work in those windows.
  865. MB_APPLMODAL is the default if neither MB_SYSTEMMODAL nor MB_TASKMODAL
  866. are specified.
  867. MB_DEFBUTTON1
  868. First button is the default. Note that the first button is always the
  869. default unless MB_DEFBUTTON2 or MB_DEFBUTTON3 is specified.
  870. MB_DEFBUTTON2
  871. Second button is the default.
  872. MB_DEFBUTTON3
  873. Third button is the default.
  874. MB_ICONASTERISK
  875. Same as MB_ICONINFORMATION.
  876. MB_ICONEXCLAMATION
  877. An exclamation-point icon appears in the message box.
  878. MB_ICONHAND
  879. Same as MB_ICONSTOP.
  880. MB_ICONINFORMATION
  881. An icon consisting of a lowercase i in a circle appears in the message
  882. box.
  883. MB_ICONQUESTION
  884. A question-mark icon appears in the message box.
  885. MB_ICONSTOP
  886. A stop sign icon appears in the message box.
  887. MB_OK
  888. Message box contains one push button: OK.
  889. MB_OKCANCEL
  890. Message box contains two push buttons: OK and Cancel.
  891. MB_RETRYCANCEL
  892. Message box contains two push buttons: Retry and Cancel.
  893. MB_SYSTEMMODAL
  894. All applications are suspended until the user responds to the message
  895. box. Unless the application specifies MB_ICONHAND, the message box does
  896. not become modal until after it is created; consequently, the parent
  897. window and other windows continue to receive messages resulting from its
  898. activation. System-modal message boxes are used to notify the user of
  899. serious, potentially damaging errors that require immediate attention
  900. (for example, running out of memory).
  901. MB_TASKMODAL
  902. Same as MB_APPMODAL except that all the top-level windows belonging to
  903. the current task are disabled if the <hwndOwner> parameter is NULL. This
  904. flag should be used when the calling application or library does not
  905. have a window handle available, but still needs to prevent input to
  906. other windows in the current application without suspending other
  907. applications.
  908. MB_YESNO
  909. Message box contains two push buttons: Yes and No.
  910. MB_YESNOCANCEL
  911. Message box contains three push buttons: Yes, No, and Cancel.
  912. The return value specifies the outcome of the function. It is zero if there
  913. is not enough memory to create the message box. Otherwise, it is one of the
  914. following menu-item values returned by the dialog box:
  915. IDABORT Abort button pressed.
  916. IDCANCEL Cancel button pressed.
  917. IDIGNORE Ignore button pressed.
  918. IDNO No button pressed.
  919. IDOK OK button pressed.
  920. IDRETRY Retry button pressed.
  921. IDYES Yes button pressed.
  922. If a message box has a Cancel button, the IDCANCEL value will be returned if
  923. either the ^ESCAPE^ key or Cancel button is pressed. If the message box has
  924. no Cancel button, pressing the ^ESCAPE^ key has no effect.
  925. When a system-modal message box is created to indicate that the system is
  926. low on memory, the strings passed as the <lpText> and <lpCaption> parameters
  927. should not be taken from a resource file, since an attempt to load the
  928. resource may fail.
  929. When an application calls the %MessageBox% function and specifies the
  930. MB_ICONHAND and MB_SYSTEMMODAL flags for the <wType> parameter, Windows will
  931. display the resulting message box regardless of available memory. When these
  932. flags are specified, Windows limits the length of the message-box text to
  933. one line.
  934. If a message box is created while a dialog box is present, use the handle of
  935. the dialog box as the <hwndParent> parameter. The <hwndParent> parameter
  936. should not identify a child window, such as a dialog-box control.
  937. --*/
  938. ULONG FASTCALL WU32MessageBox(PVDMFRAME pFrame)
  939. {
  940. ULONG ul;
  941. UINT uType;
  942. PSZ psz2;
  943. PSZ psz3;
  944. register PMESSAGEBOX16 parg16;
  945. GETARGPTR(pFrame, sizeof(MESSAGEBOX16), parg16);
  946. GETPSZPTR(parg16->f2, psz2);
  947. GETPSZPTR(parg16->f3, psz3);
  948. // WHISTLER RAID BUG #348251
  949. // A messagebox posted by artgalry.exe would remain behind autosketches window
  950. // after it was invoked. In order to move the messagebox to the foreground we
  951. // need to set its MB_SETFOREGROUND bit. Since this will be applied to all
  952. // 16bit MessageBox's we will only set this bit if the MessageBox does not
  953. // have the MB_NOFOCUS bit. This fix works in conjunction with the
  954. // GACF2_GIVEUPFOREGROUND compat flag.
  955. uType = (UINT)parg16->f4;
  956. if(!(uType & MB_NOFOCUS))
  957. {
  958. uType |= MB_SETFOREGROUND;
  959. }
  960. ul = GETINT16(MessageBox(
  961. HWND32(parg16->f1),
  962. psz2,
  963. psz3,
  964. uType
  965. ));
  966. FREEPSZPTR(psz2);
  967. FREEPSZPTR(psz3);
  968. FREEARGPTR(parg16);
  969. RETURN(ul);
  970. }
  971. /*++
  972. void SetDlgItemInt(<hDlg>, <nIDDlgItem>, <wValue>, <bSigned>)
  973. HWND <hDlg>;
  974. int <nIDDlgItem>;
  975. WORD <wValue>;
  976. BOOL <bSigned>;
  977. The %SetDlgItemInt% function sets the text of a control in the given dialog
  978. box to the string that represents the integer value given by the <wValue>
  979. parameter. The %SetDlgItemInt% function converts <wValue> to a string that
  980. consists of decimal digits, and then copies the string to the control. If
  981. the <bSigned> parameter is TRUE, <wValue> is assumed to be signed. If
  982. <wValue> is signed and less than zero, the function places a minus sign
  983. before the first digit in the string.
  984. %SetDlgItemInt% sends a WM_SETTEXT message to the given control.
  985. <hDlg>
  986. Identifies the dialog box that contains the control.
  987. <nIDDlgItem>
  988. Specifies the control to be modified.
  989. <wValue>
  990. Specifies the value to be set.
  991. <bSigned>
  992. Specifies whether or not the integer value is signed.
  993. This function does not return a value.
  994. --*/
  995. ULONG FASTCALL WU32SetDlgItemInt(PVDMFRAME pFrame)
  996. {
  997. HWND hwnd;
  998. register PSETDLGITEMINT16 parg16;
  999. GETARGPTR(pFrame, sizeof(SETDLGITEMINT16), parg16);
  1000. hwnd = HWND32(parg16->f1);
  1001. SetDlgItemInt(
  1002. hwnd,
  1003. WORD32(parg16->f2), // see comment in wu32getdlgitem
  1004. (parg16->f4) ? INT32(parg16->f3) : WORD32(parg16->f3),
  1005. BOOL32(parg16->f4)
  1006. );
  1007. FREEARGPTR(parg16);
  1008. RETURN(0);
  1009. }
  1010. /*++
  1011. void SetDlgItemText(<hDlg>, <nIDDlgItem>, <lpString>)
  1012. HWND <hDlg>;
  1013. int <nIDDlgItem>;
  1014. LPSTR <lpString>;
  1015. The %SetDlgItemText% function sets the caption or text of a control in the
  1016. dialog box specified by the <hDlg> parameter. The %SetDlgItemText% function
  1017. sends a WM_SETTEXT message to the given control.
  1018. <hDlg>
  1019. Identifies the dialog box that contains the control.
  1020. <nIDDlgItem>
  1021. Specifies the control whose text is to be set.
  1022. <lpString>
  1023. Points to the null-terminated string that is to be copied to the
  1024. control.
  1025. This function does not return a value.
  1026. --*/
  1027. ULONG FASTCALL WU32SetDlgItemText(PVDMFRAME pFrame)
  1028. {
  1029. HWND hwnd;
  1030. PSZ psz3;
  1031. register PSETDLGITEMTEXT16 parg16;
  1032. GETARGPTR(pFrame, sizeof(SETDLGITEMTEXT16), parg16);
  1033. GETPSZPTR(parg16->f3, psz3);
  1034. hwnd = HWND32(parg16->f1);
  1035. if (NULL != psz3) {
  1036. AddParamMap((DWORD)psz3, FETCHDWORD(parg16->f3));
  1037. }
  1038. SetDlgItemText(
  1039. hwnd,
  1040. WORD32(parg16->f2), // see comment in wu32getdlgitem
  1041. psz3
  1042. );
  1043. if (NULL != psz3) {
  1044. DeleteParamMap((DWORD)psz3, PARAM_32, NULL);
  1045. }
  1046. FREEPSZPTR(psz3);
  1047. FREEARGPTR(parg16);
  1048. RETURN(0);
  1049. }
  1050. /*++
  1051. No REF header file
  1052. --*/
  1053. ULONG FASTCALL WU32SysErrorBox(PVDMFRAME pFrame)
  1054. {
  1055. DWORD dwExitCode;
  1056. PSZ pszText;
  1057. PSZ pszCaption;
  1058. register PSYSERRORBOX16 parg16;
  1059. GETARGPTR(pFrame, sizeof(SYSERRORBOX16), parg16);
  1060. // WARNING - If things go wrong during boot, this routine can be called in
  1061. // real mode (v86 mode). So be very careful which GetPtr routines you
  1062. // use to convert from 16:16 to flat pointers
  1063. pszText = WOWGetVDMPointer(FETCHDWORD(parg16->vpszText),0,fWowMode);
  1064. pszCaption = WOWGetVDMPointer(FETCHDWORD(parg16->vpszCaption),0,fWowMode);
  1065. LOGDEBUG(5,(" SYSERRORBOX: %s\n", pszText));
  1066. dwExitCode = WOWSysErrorBox(
  1067. pszCaption,
  1068. pszText,
  1069. parg16->sBtn1,
  1070. parg16->sBtn2,
  1071. parg16->sBtn3
  1072. );
  1073. FREEPSZPTR(pszCaption);
  1074. FREEPSZPTR(pszText);
  1075. FREEARGPTR(parg16);
  1076. RETURN(dwExitCode);
  1077. }