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.

1321 lines
34 KiB

  1. ;===========================================================================
  2. ;
  3. ; WinError.H constants
  4. ;
  5. ERROR_INVALID_PARAMETER EQU 87
  6. ;===========================================================================
  7. ;
  8. ; Validation constants
  9. ;
  10. GMEM_VALID equ 07372h ; include old GMEM_CODE_DATA
  11. GMEM_REALLOC_VALID equ 063f2h ; include GMEM_MODIFY and old GMEM_CODE_DATA
  12. GETFREESPACE_VALID equ 01002h ; undocumented "2" bit.
  13. OF_VALID equ 0fff7h
  14. LOPEN_VALID equ 000f7h
  15. LMEM_VALID equ 00f72h
  16. LMEM_REALLOC_VALID equ 00ff2h ; includes LMEM_MODIFY
  17. ATTR_MAX equ 3 ; _lcreat max
  18. ORIGIN_MAX equ 2 ; _lseek origin
  19. HANDLE_MAX equ 255
  20. SW_MAX equ 9 ; ShowWindow() SW_* max
  21. ERRMODE_VALID equ 08003h ; SetErrorMode
  22. SWAP_MAX equ 2 ; SwapRecording()
  23. ; Local heap structures and definitions
  24. ; (FROM WINKERN.INC)
  25. ;
  26. LocalHandleEntry STRUC
  27. lhe_address DW ? ; actual address of object
  28. lhe_flags DB ? ; flags and priority level
  29. lhe_count DB ? ; lock count
  30. LocalHandleEntry ENDS
  31. LHE_DISCARDED EQU 040h ; Marks objects that have been discarded.
  32. ; Local arena objects are kept in a doubly linked list.
  33. LocalArena STRUC
  34. la_prev DW ? ; previous arena entry (first entry points to self)
  35. la_next DW ? ; next arena entry (last entry points to self)
  36. la_handle DW ? ; back link to handle table entry
  37. LocalArena ENDS
  38. la_fixedsize = la_handle ; Fixed arena headers stop here
  39. LA_ALIGN = 4-1
  40. LA_MASK = NOT LA_ALIGN
  41. LA_FREE = 00h
  42. LA_BUSY = 01h ; Saved in la_prev field of header
  43. LA_MOVEABLE EQU 02h ; Saved in la_prev field of header
  44. ;==========================================================================
  45. ;
  46. ; Per-segment helper subroutine definitions
  47. ;
  48. EXTRA_EXPAND macro lseg
  49. ifdef genHLOCAL&lseg
  50. public HLOCAL0&lseg
  51. HLOCAL0&lseg:
  52. or bx,bx ; accept NULL
  53. jz LV_OK&lseg
  54. public HLOCAL&lseg
  55. HLOCAL&lseg:
  56. mov dx,si ; preserve SI in DX
  57. mov cx,bx ; cx = handle value
  58. beg_fault_trap LV_trap&lseg
  59. test bl,LA_MOVEABLE ; moveable block?
  60. jz LV_fixed&lseg
  61. mov bx,[bx].lhe_address ; deref moveable object
  62. or bx,bx ; if address is 0, ensure discarded.
  63. jnz @F ; not null addr: continue.
  64. mov bx,cx
  65. test [bx].lhe_flags,LHE_DISCARDED
  66. jnz LV_OK&lseg
  67. jmp short LV_Error&lseg
  68. @@:
  69. test [bx]-(SIZE LocalArena)+la_prev,LA_MOVEABLE ; make sure LA_MOVEABLE is set.
  70. jz LV_Error&lseg
  71. sub bx,(SIZE LocalArena)-la_fixedsize
  72. LV_fixed&lseg:
  73. sub bx,la_fixedsize ; Point to arena block
  74. ifdef DISABLE ; disabled for speed.
  75. ;** Make sure we're at least past the first heap block. We can
  76. ;** do this because heap blocks are always linked into the list
  77. ;** in order. We can get away with using WORD PTR hi_first
  78. ;** for both the 286 and 386 KERNELs because the pointer is
  79. ;** stored in the low WORD of this structure member in the
  80. ;** 386 KERNEL and the structures are identical in 286 and 386
  81. ;** up to this point. Members AFTER hi_first do NOT match
  82. ;** up and we'd have to make special case code for the KERNELs.
  83. mov si,[pLocalHeap] ;Points to HEAPINFO + LOCALINFO
  84. cmp bx,WORD PTR [si].hi_first ;Beyond first block?
  85. jl LV_Error&lseg ;Nope, can't be a local block
  86. endif
  87. ;** Check that this is really a local block
  88. mov ax,[bx].la_prev ;Point to previous arena
  89. test al,LA_BUSY
  90. jz LV_Error&lseg
  91. and al,LA_MASK ; strip off LA_BUSY and LA_MOVEABLE
  92. ; Assume that LA_BUSY bit is set (i.e., we're not a free block)
  93. xchg ax,si
  94. cmp [si].la_next,bx ;Does it chain to this block?
  95. jne LV_Error&lseg ;No, bail
  96. mov si,[bx].la_next ;Point to next arena
  97. mov ax,[si].la_prev
  98. and al,LA_MASK
  99. cmp ax,bx ;Does it chain back to our block?
  100. jne LV_Error&lseg ;Nope: error.
  101. end_fault_trap
  102. LV_OK&lseg:
  103. mov si,dx ; restore SI
  104. ret ; and return.
  105. LV_trap&lseg:
  106. fault_fix_stack
  107. LV_Error&lseg:
  108. mov si,dx ; restore SI
  109. xchg ax,cx ; ax = handle value
  110. mov bx,ERR_BAD_LOCAL_HANDLE
  111. jmp Short Inval_Param_&lseg
  112. endif ;genHLOCAL&lseg
  113. endm
  114. ;===========================================================================
  115. ;
  116. ; Argument types
  117. ;
  118. P_HLOCAL0 macro h,opts
  119. _GenParm <h>,2,<opts>
  120. if VLgen
  121. mov bx,_P_&h
  122. lcall HLOCAL0
  123. _gensub HLOCAL
  124. endif
  125. endm
  126. P_HLOCAL macro h,opts
  127. _GenParm <h>,2,<opts>
  128. if VLgen
  129. mov bx,_P_&h
  130. lcall HLOCAL
  131. _gensub HLOCAL
  132. endif
  133. endm
  134. ;
  135. ; Special case for GlobalReAlloc, GlobalFree, GlobalUnlock because
  136. ; of Turbo Pascal setup program. It turns out it dereferences a handle
  137. ; by doing an inc, which worked on 3.0 but not any more.
  138. ;
  139. ; What happens in 3.1 is that the 3 low bits of a selector will be 1,
  140. ; so an inc will set them all to 0 and carry to the next bit. We check
  141. ; for this by checking for the 3 low bits == 0.
  142. ;
  143. P_GHANDLETP macro h,opts
  144. _GenParm <h>,2,<opts>
  145. if VLgen
  146. mov ax,_P_&h
  147. or ax,ax ; Don't dec if == NULL!
  148. jz @F
  149. test al,0111b ; if GDT and ring 0 selector, it could be
  150. jnz @F ; that turbo pascal did a dec.
  151. dec ax
  152. @@:
  153. lcall GHANDLE
  154. endif
  155. endm
  156. P_SEL equ <P_H>
  157. P_SEL0 equ <P_H0>
  158. P_SELM1 equ <P_H>
  159. P_HRESINFO equ <P_H>
  160. STRUCT <CATCHBUF>
  161. F_RGW reserved,9
  162. ENDSTRUCT
  163. _GenLP <P_LPCATCHBUF>,<LP>,%VLcbsCATCHBUF
  164. _GenLP <P_CLPCATCHBUF>,<LP>,%VLcbsCATCHBUF
  165. P_NPTR equ <P_2>
  166. STRUCT <SEGINFO> ; NOTE: this should be defined in windows.h
  167. F_WORD offSegment
  168. F_WORD cbSegment
  169. F_WORD flags
  170. F_WORD cbAlloc
  171. F_RGW reserved,4
  172. ENDSTRUCT
  173. _GenLP <P_LPSEGINFO>,<LP>,%VLcbsSEGINFO
  174. P_NPBUFFER macro pb, cb, opts
  175. P_NPTR <pb>,<opts>
  176. P_int <cb>,<opts>
  177. endm
  178. ; special case for gettempfilename
  179. ; cannot be used as is for anything else
  180. ; will validate selector of buffer
  181. P_LPFILENAMEBUF macro name, opts
  182. _GenParm <name>,4,<opts>
  183. if VLgen
  184. mov cx,_P_&name+2
  185. mov ax,_P_&name
  186. mov bx, 127 ; 128-char filename buffer
  187. beg_fault_trap LPFbad
  188. mov es,cx
  189. LPFgood_es:
  190. add bx, ax ; offset + 127
  191. jc LPFbad1 ; check 16 bit overflow
  192. or byte ptr es:[bx],0 ; check write permission, limit
  193. end_fault_trap
  194. jmp short LPFexit
  195. LPFbad:
  196. pop bx ; fault ip
  197. add sp,2 ; fix flt stk (fault)
  198. cmp bx, offset LPFgood_es
  199. jb LPFbad1 ; bad selector, no excuse
  200. mov bx, ERR_BAD_PTR or ERR_WARNING
  201. jmp short LPFcallerr
  202. LPFbad1:
  203. mov bx,ERR_BAD_PTR
  204. LPFcallerr:
  205. call HandleParamError
  206. LPFexit:
  207. endif
  208. endm
  209. P_CLPSTRORD equ <P_CLPSTRATOM>
  210. P_CLPSZMODNAME equ <P_CLPSTRATOM>
  211. P_DRIVECHAR equ <P_2>
  212. P_DRIVE equ <P_2>
  213. P_HFILE macro name, opts
  214. _GenParm <name>,2,<opts>
  215. if VLgen
  216. mov ax,_P_&name ; Don't allow -1 for file handles
  217. cmp ax,0FFFFh ; 0 is a valid file handle
  218. jne @F
  219. ;
  220. ; We only want to warn here: this will let DOS return the appropriate error.
  221. ;
  222. mov bx,ERR_BAD_HFILE or ERR_WARNING ; only warn!
  223. lcall Inval_Param_
  224. @@:
  225. endif
  226. endm
  227. ; Huge buffer pointers, that allow accessing beyond the
  228. ; 64k segment limit. For now, we just ensure that there
  229. ; is at least one valid byte in the buffer.
  230. ;
  231. P_LPHUGEBUFFER macro pb, cb, opts
  232. _DefParm <pb>,4,<opts>
  233. _DefParm <cb>,2,<opts>
  234. if VLgen
  235. mov cx,_P_&cb ;; if cb == 0, don't validate
  236. jcxz @F
  237. mov ax,_P_&pb
  238. mov cx,_P_&pb+2
  239. mov bx,1
  240. lcall LP
  241. _gensub LP
  242. @@:
  243. endif
  244. endm
  245. P_CLPHUGEBUFFER macro pb, cb, opts
  246. _DefParm <pb>,4,<opts>
  247. _DefParm <cb>,2,<opts>
  248. if VLgen
  249. mov cx,_P_&cb ;; if cb == 0, don't validate
  250. jcxz @F
  251. mov ax,_P_&pb
  252. mov cx,_P_&pb+2
  253. mov bx,1
  254. lcall CLP
  255. _gensub LP
  256. @@:
  257. endif
  258. endm
  259. STRUCT <LOADPARAMS> ; Should be defined in windows.h
  260. F_WORD segEnv
  261. F_LPSTR lpCmdLine
  262. F_LPVOID lpCmdShow ; far pointer to rgw[2] = { 2, cmdShow };
  263. F_DWORDMBZ dwReserved
  264. ENDSTRUCT
  265. P_CLPLOADPARAMS0M1 macro name,opts
  266. _DefParm <name>,4,<opts>
  267. if VLgen
  268. _FlsFrame
  269. mov ax,_P_&name
  270. mov cx,_P_&name+2
  271. mov bx,ax
  272. or bx,cx
  273. jz @F ;; allow NULL for ATM
  274. mov bx,ax
  275. and bx,cx ;; if ax:cx == -1, accept parameter.
  276. inc bx
  277. jz @F
  278. mov bx,VLcbsLOADPARAMS
  279. lcall CLP
  280. _gensub LP
  281. @@:
  282. endif
  283. endm
  284. STRUCT <OFSTRUCT>
  285. F_BYTE cBytes ;** BYTE. Size of OFSTRUCT
  286. F_BYTE fFixedDisk
  287. F_WORD nErrCode
  288. F_RGB reserved,4 ;** 4 reserved bytes
  289. F_RGCH szPathName,128 ;** null-terminated name of length
  290. ;not > 128. Field length is 128
  291. ;Wrongly documented as 120.
  292. ENDSTRUCT
  293. ; We need this special code for openfile because the ofstruct was
  294. ; wrongly documented as having a szPathName of 120 bytes instead of 128.
  295. ; What we do is validate for 120 bytes, if that fails then issue error.
  296. ; If that succeeds then validate for 128, if that fails then issue a warning
  297. ; but continue the call.
  298. P_LPOFSTRUCT macro name, opts
  299. _GenParm <name>,4,<opts>
  300. if VLgen
  301. mov cx,_P_&name+2
  302. mov ax,_P_&name
  303. mov bx,VLcbsOFSTRUCT-1 ; last addressible byte
  304. sub bx,8 ; start by validating path=120 bytes
  305. beg_fault_trap LPOFbad
  306. mov es,cx
  307. add bx, ax
  308. jc LPOFbad1 ; check 16 bit overflow
  309. or byte ptr es:[bx],0 ; check write limit for path=120
  310. LPOFpath120:
  311. add bx,8
  312. jc LPOFwarn ; check 16 bit overflow
  313. or byte ptr es:[bx],0 ; check write limit for path=128
  314. end_fault_trap
  315. jmp short LPOFexit
  316. LPOFbad:
  317. pop bx ; fault ip
  318. add sp,2 ; fix flt stk (fault)
  319. cmp bx, offset LPOFpath120
  320. jb LPOFbad1 ; bad selector, or path < 120 => error
  321. LPOFwarn:
  322. mov bx, ERR_BAD_PTR or ERR_WARNING
  323. jmp short LPOFcallerr
  324. LPOFbad1:
  325. mov bx,ERR_BAD_PTR
  326. LPOFcallerr:
  327. call HandleParamError
  328. LPOFexit:
  329. endif
  330. endm
  331. P_NPHTABLE equ <P_NPTR>
  332. P_LPFNRHANDLER equ <P_LPFN>
  333. P_LPFNGNOTIFY0 equ <P_LPFN0>
  334. P_LPFNLNOTIFY0 equ <P_LPFN0>
  335. P_HKEY equ <P_4>
  336. ;===========================================================================
  337. ;
  338. ; API Descriptions
  339. ;
  340. ; in 3PROTECT.ASM
  341. API WORD, AllocCStoDSAlias, TEXT, <ASM>
  342. P_SEL sel ;** code selector
  343. ; in 3PROTECT.ASM
  344. API WORD, AllocDStoCSAlias, TEXT, <ASM>
  345. P_SEL sel ;** data selector
  346. ; in 3PROTECT.ASM
  347. API WORD, AllocSelector, TEXT, <ASM, NOGEN>
  348. P_SEL0 sel ;can be 0 (nogen)
  349. ; in 3PROTECT.ASM
  350. API WORD, FreeSelector, TEXT, <ASM>
  351. P_SEL sel
  352. ; in 3PROTECT.ASM
  353. API WORD, PrestoChangoSelector, TEXT, <ASM>
  354. P_SEL selSrc
  355. P_SEL selDst
  356. ; in RESAUX.ASM
  357. API GHANDLE,LoadResource, TEXT, <ASM>
  358. P_HINSTANCE hInstance
  359. P_HRESINFO hResInfo
  360. ; in RESAUX.ASM
  361. API int, AccessResource, TEXT, <ASM>
  362. P_HINSTANCE hInstance
  363. P_HRESINFO hRes
  364. APIERR
  365. mov ax, -1 ;cannot get file handle
  366. APIEND
  367. ; in RESAUX.ASM
  368. API HRESINFO, FindResource, MISCTEXT, <ASM>
  369. P_HINSTANCE hInstance
  370. P_CLPSTRRSRC lpName
  371. P_CLPSTRRSRC lpType
  372. ; in RESAUX.ASM
  373. API GHANDLE,AllocResource, TEXT, <ASM>
  374. P_HINSTANCE hInstance
  375. P_HRESINFO hRes
  376. P_DWORD cbRes
  377. ; in RESAUX.ASM
  378. API BOOL, FreeResource, TEXT, <ASM>
  379. P_GHANDLE hData
  380. ; in RESAUX.ASM
  381. API LPSTR, LockResource, TEXT, <ASM>
  382. P_GHANDLE hResData
  383. ; in RESAUX.ASM
  384. API LPFNRHANDLER, SetResourceHandler, MISCTEXT, <ASM>
  385. P_HINSTANCE hInstance
  386. P_CLPSTRRSRC lpType
  387. P_LPFNRHANDLER lpLoadFunc
  388. ; in RESAUX.ASM
  389. API DWORD, SizeofResource, TEXT, <ASM>
  390. P_HINSTANCE hInstance
  391. P_HRESINFO hResInfo
  392. ; in ATOM.ASM
  393. API BOOL, InitAtomTable, MISCTEXT, <ASM, NOGEN>
  394. P_int size
  395. ; in ATOM.ASM
  396. API ATOM, AddAtom, TEXT, <ASM,FUNNYFRAME,DEBUGONLY>
  397. P_CLPSTRATOM lpString
  398. ; in ATOM.ASM
  399. API ATOM, DeleteAtom, TEXT, <ASM>
  400. P_ATOM atom
  401. ; in ATOM.ASM
  402. API ATOM, FindAtom, TEXT, <ASM,FUNNYFRAME, DEBUGONLY>
  403. P_CLPSTRATOM lpAtomName
  404. ; in ATOM.ASM
  405. API WORD, GetAtomName, TEXT, <ASM>
  406. P_ATOM atom
  407. P_LPBUFFER lpBuffer, cchBuffer
  408. APIERR
  409. E_SETEMPTY lpBuffer, cchBuffer
  410. APIEND
  411. ; in ATOM.ASM
  412. API HANDLE, GetAtomHandle, TEXT, <ASM>
  413. P_ATOM atom
  414. ; in LDSTACK.ASM
  415. API int, Catch, MISCTEXT, <ASM, DEBUGONLY>
  416. P_LPCATCHBUF lpCatchBuf
  417. ; in LDSTACK.ASM
  418. API void, Throw, MISCTEXT, <ASM, FUNNYFRAME,DEBUGONLY>
  419. P_CLPCATCHBUF lpCatchBuf
  420. P_int catchReturn
  421. ; in RIPAUX.ASM
  422. API void, DebugBreak, TEXT, <VOID, ASM, FUNNYFRAME> ;nogen
  423. ; in MODULE.ASM
  424. API BOOL, FreeModule, NRESTEXT, <ASM>
  425. P_HMODULE hModule
  426. ; in MODULE.ASM
  427. API void, FreeLibrary, NRESTEXT, <ASM> ;Falls into FreeModule
  428. P_HMODULE hLibModule
  429. ; in RIPAUX.ASM (debug version) and RIP.C (retail version) ??
  430. API void, FatalExit, TEXT, <ASM, NOGEN, FUNNYFRAME>
  431. P_int code
  432. ; in LDINT.ASM
  433. API void, FatalAppExit, TEXT, <ASM>
  434. P_WORDMBZ reserved ; ** must be 0
  435. P_CLPSTR0 lpMsgText
  436. ; The 286 kernel has GlobalAlloc/ReAlloc size limits of 1meg - 16 bytes.
  437. ;
  438. ifdef PM386
  439. P_GHCB equ <P_DWORD>
  440. else
  441. P_GHCB macro cb,opts
  442. _GenParm <cb>,4,<opts>
  443. if VLgen
  444. mov ax,_P_&cb ; Error if cb > 0x000ffff0
  445. mov cx,_P_&cb+2
  446. cmp ax,0fff0h
  447. sbb cx,0000fh
  448. jbe @f
  449. mov cx,_P_&cb+2 ; we trashed cx.
  450. mov bx,ERR_BAD_DVALUE
  451. lcall Inval_Param_
  452. @@:
  453. endif
  454. endm
  455. endif
  456. ; in 3GINTERF.ASM
  457. API GHANDLE,GlobalAlloc, TEXT, <ASM>
  458. P_FLAGS flags,GMEM_VALID
  459. P_GHCB cb
  460. ; The 286 kernel has a GlobalCompact size limit of 1meg-16 bytes
  461. ; (but we also have to allow -1L, too).
  462. ;;
  463. ifdef PM386
  464. P_GCCB equ <P_DWORD>
  465. else
  466. P_GCCB macro cb,opts
  467. local noerr
  468. _GenParm <cb>,4,<opts>
  469. if VLgen
  470. mov ax,_P_&cb ; Error if cb > 0x000ffff0
  471. mov cx,_P_&cb+2
  472. cmp ax,0ffffh ; if ax == -1 && ax == cx, then ok.
  473. jnz @F
  474. cmp ax,cx
  475. jz noerr
  476. @@:
  477. cmp ax,0fff0h
  478. sbb cx,0000fh
  479. jbe noerr
  480. mov cx,_P_&cb+2 ; we trashed dx.
  481. mov bx,ERR_BAD_DVALUE
  482. lcall Inval_Param_
  483. noerr:
  484. endif
  485. endm
  486. endif
  487. ; in 3GINTERF.ASM
  488. API DWORD, GlobalCompact, TEXT, <ASM, NOGEN>
  489. P_GCCB cbMinFree
  490. ; in 3GINTERF.ASM
  491. API GHANDLE,GlobalFree, TEXT, <ASM>
  492. P_GHANDLETP h
  493. ; in 3GINTERF.ASM
  494. API DWORD, GlobalHandle, TEXT, <ASM>
  495. P_SEL sel
  496. ; in 3GINTERF.ASM
  497. API LPSTR, GlobalLock, TEXT, <ASM>
  498. P_GHANDLE h
  499. ; The 286 kernel has GlobalReAlloc size limits of 1meg - 16 bytes.
  500. ; However, if GMEM_MODIFY bit is set, we will completely ignore the size
  501. ; field for 3.0 compatability instead of failing the call.
  502. ifdef PM386
  503. P_GRAPARMS macro cb,flags,opts
  504. P_DWORD <cb>,<opts>
  505. P_FLAGS <flags>,GMEM_REALLOC_VALID,<opts>
  506. endm
  507. else
  508. GMEM_MODIFY = 0080h
  509. P_GRAPARMS macro cb,flags,opts
  510. _GenParm <cb>,4,<opts>
  511. _GenParm <flags>,2,<opts>
  512. if VLgen
  513. errnz high(GMEM_MODIFY)
  514. test byte ptr _P_&flags,low(GMEM_MODIFY)
  515. jnz @F ; Ignore byte count if GMEM_MODIFY is set
  516. mov ax,_P_&cb ; Error if cb > 0x000ffff0
  517. mov cx,_P_&cb+2
  518. cmp ax,0fff0h
  519. sbb cx,0000fh
  520. jbe @f
  521. mov cx,_P_&cb+2 ; we trashed cx.
  522. mov bx,ERR_BAD_DVALUE
  523. lcall Inval_Param_
  524. @@:
  525. ifdef DEBUG
  526. mov ax,_P_&flags
  527. test ax,not(GMEM_REALLOC_VALID)
  528. jz @F
  529. mov bx,ERR_BAD_FLAGS or ERR_WARNING
  530. lcall Inval_Param_
  531. @@:
  532. endif
  533. endif
  534. endm
  535. endif
  536. ; in 3GINTERF.ASM
  537. API GHANDLE,GlobalReAlloc, TEXT, <ASM>
  538. P_GHANDLETP h
  539. P_GRAPARMS cb,flags
  540. ; in 3GINTERF.ASM
  541. API DWORD, GlobalSize, TEXT, <ASM,FUNNYFRAME> ;nogen
  542. P_GHANDLE h
  543. ; in 3GINTERF.ASM
  544. API BOOL, GlobalUnlock, TEXT, <ASM>
  545. P_GHANDLETP h
  546. ; in 3GINTERF.ASM
  547. API WORD, GlobalFlags, TEXT, <ASM,FUNNYFRAME> ;nogen
  548. P_GHANDLE h
  549. ; in 3GINTERF.ASM
  550. API LPSTR, GlobalWire, TEXT, <ASM, FUNNYFRAME> ;nogen
  551. P_GHANDLE h
  552. ; in 3GINTERF.ASM
  553. API BOOL, GlobalUnWire, TEXT, <ASM, FUNNYFRAME> ;nogen
  554. P_GHANDLE h
  555. ; in 3GINTERF.ASM
  556. API GHANDLE,GlobalLRUNewest, TEXT, <ASM, FUNNYFRAME> ;nogen
  557. P_GHANDLE h
  558. ; in 3GINTERF.ASM
  559. API GHANDLE,GlobalLRUOldest, TEXT, <ASM, FUNNYFRAME> ;nogen
  560. P_GHANDLE h
  561. ; in 3GINTERF.ASM
  562. API VOID, GlobalNotify, TEXT, <ASM>
  563. P_LPFNGNOTIFY0 lpNotifyProc ;** fn. to reside in fixed CS
  564. ; in 3GINTERF.ASM
  565. API WORD, GlobalPageLock, TEXT, <ASM, FUNNYFRAME> ;nogen
  566. P_GHANDLE h
  567. ; in 3GINTERF.ASM
  568. API WORD, GlobalPageUnlock, TEXT, <ASM,FUNNYFRAME> ;nogen
  569. P_SEL sel
  570. ; in 3GINTERF.ASM
  571. API VOID, GlobalFix, TEXT, <ASM, FUNNYFRAME> ;nogen
  572. P_GHANDLE h
  573. ; in 3GINTERF.ASM
  574. API BOOL, GlobalUnfix, TEXT, <ASM, FUNNYFRAME> ;nogen
  575. P_GHANDLE h
  576. ; in 3GINTERF.ASM
  577. API DWORD, GlobalDosAlloc, TEXT, <ASM, NOGEN>
  578. P_GHCB cb
  579. ; in 3GINTERF.ASM
  580. API WORD, GlobalDosFree, TEXT, <ASM,NOGEN> ;calls GlobalFree
  581. P_SEL sel
  582. ; in 3GINTERF.ASM
  583. API GHANDLE,LockSegment, TEXT, <ASM, FUNNYFRAME>
  584. P_SELM1 sel ;** can be -1
  585. ; in 3GINTERF.ASM
  586. API GHANDLE,UnlockSegment, TEXT, <ASM, FUNNYFRAME> ;nogen
  587. P_SELM1 sel ;can be -1
  588. ; in TASK.ASM
  589. API HTASK, GetCurrentTask, TEXT, <VOID, ASM, FUNNYFRAME> ;nogen
  590. ; in USERPRO.ASM
  591. API WORD, GetWindowsDirectory, MISCTEXT, <ASM>
  592. P_LPBUFFER lpBuffer, cb
  593. APIERR
  594. E_SETEMPTY lpBuffer, cb
  595. APIEND
  596. ; in USERPRO.ASM
  597. API WORD, GetSystemDirectory, MISCTEXT, <ASM>
  598. P_LPBUFFER lpBuffer, cb
  599. APIERR
  600. E_SETEMPTY lpBuffer, cb
  601. APIEND
  602. ; in CONTEXT.ASM
  603. API LONG, GetWinFlags, MISCTEXT, <VOID, ASM, FUNNYFRAME> ;nogen
  604. ; in TASK.ASM
  605. API LPSTR, GetDOSEnvironment, MISCTEXT, <VOID, ASM, FUNNYFRAME> ;nogen
  606. ;calls GetCurrentTask
  607. ; in CONTEXT.ASM
  608. API DWORD, GetVersion, MISCTEXT, <VOID, ASM, FUNNYFRAME> ;nogen
  609. ; in TASK.ASM
  610. API WORD, GetNumTasks, MISCTEXT, <VOID, ASM, FUNNYFRAME> ;nogen
  611. ; in LDAUX.ASM
  612. API BOOL, DefineHandleTable, MISCTEXT, <ASM, NOGEN>
  613. P_NPHTABLE pTable ; offset from start of caller's DS
  614. ; in LDAUX.ASM
  615. API LPFN, MakeProcInstance, MISCTEXT, <ASM>
  616. P_LPFN lpProc
  617. P_HINSTANCE0 hInstance ; NULL => use caller's DS (not documemnted)
  618. ; in LDAUX.ASM
  619. API void, FreeProcInstance, MISCTEXT, <ASM>
  620. P_LPFN lpProc
  621. ; in LDAUX.ASM
  622. API GHANDLE,GetCodeHandle, TEXT, <ASM, NOGEN>
  623. P_DWORD lpProc ;;;; SHOULD BE P_CLP
  624. ;
  625. ; GetCodeInfo lpProc parameter can be either a proc addr
  626. ; or module handle:segment number. So, we just validate
  627. ; that the hi order word is a valid selector.
  628. ;
  629. P_LPFNGCI macro name,opts
  630. _DefParm <name>,4,<opts>
  631. if VLgen
  632. _FlsFrame
  633. mov cx,_P_&name+2
  634. inc cx ;; Allow 0xffff to pass...
  635. jz @F
  636. dec cx
  637. xor ax,ax
  638. mov bx,1
  639. lcall CLP
  640. _gensub LP
  641. @@:
  642. endif
  643. endm
  644. P_CLPLOADPARAMS0M1 macro name,opts
  645. _DefParm <name>,4,<opts>
  646. if VLgen
  647. _FlsFrame
  648. mov ax,_P_&name
  649. mov cx,_P_&name+2
  650. mov bx,ax
  651. or bx,cx
  652. jz @F ;; allow NULL for ATM
  653. mov bx,ax
  654. and bx,cx ;; if ax:cx == -1, accept parameter.
  655. inc bx
  656. jz @F
  657. mov bx,VLcbsLOADPARAMS
  658. lcall CLP
  659. _gensub LP
  660. @@:
  661. endif
  662. endm
  663. ; in LDAUX.ASM
  664. API void, GetCodeInfo, TEXT, <ASM>
  665. P_LPFNGCI lpProc ; LPFN or HMODULE:SegNum allowed
  666. P_LPSEGINFO lpSegInfo ; points to buffer of four 32-bit values
  667. ; in LDAUX.ASM
  668. API LPFN, GetProcAddress, NRESTEXT, <ASM>
  669. P_HMODULE0 hModule
  670. P_CLPSTRORD lpProcName
  671. ; in LDAUX.ASM
  672. API HMODULE,GetModuleHandle, NRESTEXT, <ASM>
  673. P_CLPSZMODNAME lpModuleName
  674. ; in LDAUX.ASM
  675. API int, GetModuleUsage, NRESTEXT, <ASM>
  676. P_HMODULE hModule
  677. ; in LDAUX.ASM
  678. API int, GetModuleFileName, NRESTEXT, <ASM, SAVEBX>
  679. P_HMODULE32 hModule
  680. P_LPBUFFER lpszName, cchName
  681. APIERR
  682. E_SETEMPTY lpszName, cchName
  683. APIEND
  684. ; in LDAUX.ASM
  685. API int, GetModuleName, NRESTEXT, <ASM>
  686. P_HMODULE hModule
  687. P_LPBUFFER lpszName, cchName
  688. APIERR
  689. E_SETEMPTY lpszName, cchName
  690. APIEND
  691. ; in LDAUX.ASM
  692. API int, GetInstanceData, NRESTEXT, <ASM>
  693. P_HINSTANCE hInstance
  694. P_NPBUFFER pb, cb ;** points to area in current DS of caller
  695. ; in 3GINTERF.ASM Relevant only in case of EMS
  696. API DWORD, GetFreeSpace, TEXT, <ASM>
  697. P_FLAGS flags,GETFREESPACE_VALID
  698. ; in I21TASK.ASM
  699. API WORD, GetCurrentPDB, MISCTEXT, <VOID, ASM, FUNNYFRAME>
  700. ; in LDOPEN.ASM
  701. API DRIVECHAR, GetTempDrive, MISCTEXT, <ASM, FUNNYFRAME, NOGEN>
  702. P_DRIVECHAR chDrive ;** BYTE drive letter or 0
  703. ; in LDOPEN.ASM
  704. API int, GetTempFileName, MISCTEXT, <ASM>
  705. P_DRIVECHAR chDrive
  706. P_CLPSTR lpPrefix
  707. P_WORD wUnique
  708. P_LPFILENAMEBUF lpTmpFileName ; at least 144(sic) 128 chars
  709. APIERR
  710. E_SETEMPTYNC lpTmpFileName
  711. APIEND
  712. ; in LDOPEN.ASM
  713. API WORD, GetDriveType, MISCTEXT, <ASM, FUNNYFRAME, NOGEN>
  714. P_DRIVE drive ;** int. drive number (0, 1, ...)
  715. ; in LSTRING.ASM
  716. API LPSTR, lstrcpy, TEXT, <ASM, FUNNYFRAME,DEBUGONLY> ;nogen
  717. P_LPSTR lpDst
  718. P_CLPSTR lpSrc
  719. APIERR
  720. E_SETEMPTYNC lpDst
  721. APIEND
  722. ; in LSTRING.ASM
  723. API LPSTR, lstrcat, TEXT, <ASM, FUNNYFRAME,DEBUGONLY> ;nogen
  724. P_LPSTR lpDst
  725. P_CLPSTR lpSrc
  726. APIERR
  727. E_SETEMPTYNC lpDst
  728. APIEND
  729. ; in LSTRING.ASM
  730. API int, lstrOriginal, TEXT, <ASM, FUNNYFRAME,DEBUGONLY> ;nogen
  731. P_CLPSTR lpSrc1
  732. P_CLPSTR lpSrc2
  733. APIERR
  734. mov ax,-1 ; return -1 on error
  735. APIEND
  736. ; in LSTRING.ASM
  737. API int, lstrlen, TEXT, <ASM, FUNNYFRAME,DEBUGONLY> ;nogen
  738. P_CLPSTR lpString
  739. ; in DISKIO.ASM
  740. API int, _lopen, TEXT, <ASM, FUNNYFRAME> ;nogen
  741. P_CLPSTR lpPathName
  742. P_FLAGS iReadWrite, LOPEN_VALID
  743. APIERR
  744. mov ax,-1 ; return -1 on error
  745. APIEND
  746. ; in DISKIO.ASM
  747. API int, _lclose, TEXT, <ASM, FUNNYFRAME> ;nogen
  748. P_HFILE fh
  749. APIERR
  750. mov ax,-1 ; return -1 on error
  751. APIEND
  752. ; in DISKIO.ASM
  753. API int, _lcreat, TEXT, <ASM, FUNNYFRAME> ;nogen
  754. P_CLPSTR lpPathName
  755. P_VALUE attrs, ATTR_MAX
  756. APIERR
  757. mov ax,-1 ; return -1 on error
  758. APIEND
  759. ; in DISKIO.ASM
  760. API LONG, _llseek, TEXT, <ASM, FUNNYFRAME> ;nogen
  761. P_HFILE fh
  762. P_long offset
  763. P_VALUE origin, ORIGIN_MAX
  764. APIERR
  765. mov ax,-1 ; return -1 on error
  766. cwd
  767. APIEND
  768. ; BACKWARD COMPATIBILITY HACK
  769. ; Special case for _lread and _lwrite parameter errors
  770. ;
  771. ; If we have an invalid buffer pointer, we must return 0, not -1
  772. ; for 3.0 compatibility. This is because some apps call these functions
  773. ; with bogus pointers at EOF, in which case DOS ignores the pointer and count.
  774. ; The P_HFILE parameter checking just warns about bogus values, which is
  775. ; later caught by DOS and returned as a -1 error.
  776. ;
  777. ; in DISKIO.ASM
  778. API WORD, _lread, TEXT, <ASM, FUNNYFRAME, SAVEES> ;nogen
  779. P_HFILE fh
  780. P_LPHUGEBUFFER lpBuffer, cb
  781. APIERR
  782. ; return 0 on a validation error (see above)
  783. ;;;;;;;;mov ax,-1 ; return 0 on error
  784. APIEND
  785. ; in DISKIO.ASM
  786. API WORD, _lwrite, TEXT, <ASM, FUNNYFRAME> ;nogen
  787. P_HFILE fh
  788. P_CLPHUGEBUFFER lpBuffer, cb
  789. APIERR
  790. ; Return 0 if we get an error (see above)
  791. ;;;;;;;;mov ax,-1 ; return -1 on error
  792. APIEND
  793. ; in LD.ASM
  794. API HINSTANCE, LoadLibrary, NRESTEXT, <ASM> ;calls LoadModule directly
  795. P_CLPSZMODNAME lpLibName
  796. ; in LD.ASM
  797. API HINSTANCE, LoadModule, NRESTEXT, <ASM, ATMFRAME>
  798. P_CLPSZMODNAME lpModuleMame
  799. P_CLPLOADPARAMS0M1 lpLoadParams ; -1L and NULL allowed
  800. ; in LINTERF.ASM
  801. API HLOCAL, LocalAlloc, TEXT, <ASM>
  802. P_FLAGS flags, LMEM_VALID ;** LMEM_DISCARDABLE, LMEM_FIXED, LMEM_MODIFY,
  803. ;LMEM_MOVEABLE, LMEM_NOCOMPACT, LMEM_NODISCARD
  804. ;LMEM_ZEROINIT
  805. P_WORD cb
  806. ; in LINTERF.ASM
  807. API WORD, LocalCompact, TEXT, <ASM,NOGEN>
  808. P_WORD cbMinFree
  809. ; in LINTERF.ASM
  810. API HLOCAL, LocalFree, TEXT, <ASM>
  811. P_HLOCAL h ;** handle cannot be locked
  812. ;DEBUG version checks if handle is locked
  813. ; in LINTERF.ASM
  814. API HLOCAL, LocalHandle, TEXT, <ASM, FUNNYFRAME, NOGEN>
  815. P_NPTR pmem
  816. ; in LINTERF.ASM
  817. API BOOL, LocalInit, NRESTEXT, <ASM, NOGEN>
  818. P_SEL0 sel ; 0 => current DS. This is not documented
  819. P_NPTR pStart ; start of heap in segment
  820. P_NPTR pEnd ; end of heap in segment
  821. ; in LINTERF.ASM
  822. ifdef DEBUG
  823. API NPSTR, LocalLock, TEXT, <ASM>
  824. else
  825. API NPSTR, LocalLock, TEXT, <ASM, FUNNYFRAME> ;nogen
  826. endif
  827. P_HLOCAL h ;DEBUG checks for lock count overflow
  828. ; in LINTERF.ASM
  829. API HLOCAL, LocalReAlloc, TEXT, <ASM>
  830. P_HLOCAL h
  831. P_WORD cb
  832. P_FLAGS flags, LMEM_REALLOC_VALID ;** LMEM_DISCARDABLE, LMEM_MODIFY,
  833. ;LMEM_MOVEABLE, LMEM_NOCOMPACT,
  834. ;LMEM_NODISCARD, LMEM_ZEROINIT
  835. ; in LINTERF.ASM
  836. API WORD, LocalSize, TEXT, <ASM, FUNNYFRAME> ;nogen
  837. P_HLOCAL h
  838. ; in LINTERF.ASM
  839. API BOOL, LocalUnlock, TEXT, <ASM, FUNNYFRAME> ;nogen
  840. P_HLOCAL h
  841. ; in LINTERF.ASM
  842. API WORD, LocalFlags, TEXT, <ASM, FUNNYFRAME> ;nogen
  843. P_HLOCAL h
  844. ; in LINTERF.ASM
  845. API WORD, LocalShrink, TEXT, <ASM, NOGEN>
  846. P_SEL0 sel ; segment containing heap
  847. P_WORD cb
  848. ; in LINTERF.ASM
  849. API LPFNLNOTIFY, LocalNotify, NRESTEXT, <ASM, FUNNYFRAME>
  850. P_LPFNLNOTIFY0 lpfnNotifyProc
  851. ; in EMSMISC.ASM (Relevant only if EMS present)
  852. API VOID, LimitEmsPages, EMS, <ASM, FUNNYFRAME, NOGEN> ;nogen
  853. P_DWORD cKiloBytes
  854. ; in LSTRING.ASM
  855. API BOOL, IsDBCSLeadByte, TEXT, <ASM, FUNNYFRAME, NOGEN> ;nogen
  856. P_WORD ch
  857. ; in 3LDDEBUG.ASM
  858. API void, OutputDebugString, TEXT, <ASM, FUNNYFRAME, NOGEN> ; preserves all regs
  859. P_CLPSTR lpString
  860. ; in LDOPEN.ASM
  861. API int, OpenFile, TEXT, <ASM>
  862. P_CLPSTR0 lpFileName ; can be NULL if OF_REOPEN is set.
  863. P_LPOFSTRUCT lpOF ;** ptr. to OFSTRUCT
  864. P_FLAGS flags, OF_VALID ;** OF_ flags
  865. APIERR
  866. mov ax,-1 ; return -1 on error
  867. APIEND
  868. ; in 3GINTERF.ASM
  869. API void, SwitchStackBack, TEXT, <VOID, ASM, FUNNYFRAME> ;nogen
  870. ; in 3GINTERF.ASM
  871. API void, SwitchStackTo, TEXT, <ASM, FUNNYFRAME, DEBUGONLY> ;nogen
  872. P_SEL sel
  873. P_NPTR pStack
  874. P_NPTR pStackTop
  875. ; in MISCAPI.ASM
  876. API WORD, SetHandleCount, TEXT, <ASM>
  877. P_UVALUEW wNumber, HANDLE_MAX ;** upto 255 allowed
  878. ; in 3GMOREME.ASM
  879. API LONG, SetSwapAreaSize, TEXT, <ASM, NOGEN>
  880. P_WORD cParagraphs
  881. ; in CONTEXT.ASM
  882. API BOOL, SetErrorMode, MISCTEXT, <ASM>
  883. P_FLAGS flags, ERRMODE_VALID
  884. ; in LDINT.ASM
  885. API void, SwapRecording, MISCTEXT, <ASM, FUNNYFRAME> ;nogen
  886. P_UVALUE action, SWAP_MAX ;** range 0-2
  887. ; in 3GALLOC.ASM
  888. API VOID, ValidateFreeSpaces, TEXT, <VOID, ASM, FUNNYFRAME> ;nogen
  889. ; in CHECKSUM.ASM
  890. API VOID, ValidateCodeSegments, TEXT, <VOID, ASM>
  891. API WORD, WinExec, NRESTEXT, <ASM>
  892. P_CLPSTR lpFileName,256 ; path max = 128 + arg max = 128
  893. P_UVALUE wShow, SW_MAX ;** ShowWindow SW_ IDs
  894. ; in UP.C
  895. API WORD, GetProfileInt, TEXT, <DATA>
  896. P_CLPSTR lpAppName
  897. P_CLPSTR lpKeyname
  898. P_int default
  899. ; in UP.C
  900. API int, GetProfileString, TEXT, <DATA>
  901. P_CLPSTR lpAppName
  902. P_CLPSTR0 lpKeyName
  903. P_CLPSTR0 lpDefault
  904. P_LPBUFFER lpReturnedString, cchBuffer
  905. APIERR
  906. E_SETEMPTY lpReturnedString, cchBuffer
  907. APIEND
  908. ; in UP.C
  909. API WORD, GetPrivateProfileInt, TEXT, <DATA>
  910. P_CLPSTR lpAppName
  911. P_CLPSTR lpKeyname
  912. P_int default
  913. P_CLPSTR lpFileName
  914. ; in UP.C
  915. API int, GetPrivateProfileString, TEXT, <DATA>
  916. P_CLPSTR lpAppName
  917. P_CLPSTR0 lpKeyName
  918. P_CLPSTR0 lpDefault
  919. P_LPBUFFER lpReturnedString, cchBuffer
  920. P_CLPSTR lpFileName
  921. APIERR
  922. E_SETEMPTY lpReturnedString, cchBuffer
  923. APIEND
  924. ; in UP.C
  925. API BOOL, WriteProfileString, TEXT, <DATA>
  926. P_CLPSTR0 lpAppName
  927. P_CLPSTR0 lpKeyName
  928. P_CLPSTR0 lpString
  929. ; in UP.C
  930. API BOOL, WritePrivateProfileString, TEXT, <DATA>
  931. P_CLPSTR0 lpAppName
  932. P_CLPSTR0 lpKeyName
  933. P_CLPSTR0 lpString
  934. P_CLPSTR lpFileName
  935. ; BUGBUG
  936. ; For Win95, the k16 Reg* APIs get only the weakest validation.
  937. ; This is because they were added without _any_ validation,
  938. ; and validation is being added after the final beta.
  939. ; The purpose of this weak validation is to touch each pointer
  940. ; param if non-zero. We need to do this because the real work of
  941. ; the APIs is done at ring0, where we cannot fault in the segment.
  942. ;
  943. ; Stronger validation should be implemented for the next release.
  944. ;
  945. ; [the above comment is directly from Win95's kernel.api]
  946. API LONG, RegEnumKey32, NRESTEXT, <DATA>
  947. ;(HKEY lhKey, DWORD dwIndex, LPSTR lpValue, DWORD dwMax)
  948. P_HKEY hKey
  949. P_DWORD dwIndex
  950. P_CLPVOID0 lpValue
  951. P_DWORD dwMax
  952. APIERR
  953. mov ax,ERROR_INVALID_PARAMETER
  954. APIEND
  955. API LONG, RegOpenKey32, NRESTEXT, <DATA>
  956. ;(HKEY hkey, LPCSTR lpSubKey, PHKEY phkResult)
  957. P_HKEY hKey
  958. P_CLPVOID0 lpSubKey
  959. P_CLPVOID0 phkResult
  960. APIERR
  961. mov ax,ERROR_INVALID_PARAMETER
  962. APIEND
  963. API LONG, RegCreateKey32, NRESTEXT, <DATA>
  964. ;(HKEY hkey, LPCSTR lpSubKey, PHKEY phkResult)
  965. P_HKEY hKey
  966. P_CLPVOID0 lpSubKey
  967. P_CLPVOID0 phkResult
  968. APIERR
  969. mov ax,ERROR_INVALID_PARAMETER
  970. APIEND
  971. API LONG, RegDeleteKey32, NRESTEXT, <DATA>
  972. ;(HKEY hkey, LPCSTR lpSubKey)
  973. P_HKEY hKey
  974. P_CLPVOID0 lpSubKey
  975. APIERR
  976. mov ax,ERROR_INVALID_PARAMETER
  977. APIEND
  978. API LONG, RegQueryValue32, NRESTEXT, <DATA>
  979. ;(HKEY hkey, LPCSTR lpSubKey, LPSTR lpValue, LONG FAR * lpcb)
  980. P_HKEY hKey
  981. P_CLPVOID0 lpSubKey
  982. P_CLPVOID0 lpValue
  983. P_CLPVOID0 lpcbValue
  984. APIERR
  985. mov ax,ERROR_INVALID_PARAMETER
  986. APIEND
  987. API LONG, RegSetValue32, NRESTEXT, <DATA>
  988. ;(HKEY hkey, LPCSTR lpSubKey, DWORD dwType, LPCSTR lpValue, DWORD cbValue)
  989. P_HKEY hKey
  990. P_CLPVOID0 lpSubKey
  991. P_DWORD dwType
  992. P_CLPVOID0 lpValue
  993. P_DWORD cbValue
  994. APIERR
  995. mov ax,ERROR_INVALID_PARAMETER
  996. APIEND
  997. API LONG, RegDeleteValue32, NRESTEXT, <DATA>
  998. ;(HKEY hkey, LPCSTR lpValue)
  999. P_HKEY hKey
  1000. P_CLPVOID0 lpValue
  1001. APIERR
  1002. mov ax,ERROR_INVALID_PARAMETER
  1003. APIEND
  1004. API LONG, RegEnumValue32, NRESTEXT, <DATA>
  1005. ;(HKEY hkey, DWORD dwValue, LPCSTR lpValue, LONG FAR * lpcbValue,DWORD dwReserved,LONG FAR *lpdwType, LPBYTE lpbData, LONG FAR *lpcbData)
  1006. P_HKEY hKey
  1007. P_DWORD dwValue
  1008. P_CLPVOID0 lpValue
  1009. P_CLPVOID0 lpcbValue
  1010. P_DWORD dwReserved
  1011. P_CLPVOID0 lpdwType
  1012. P_CLPVOID0 lpbData
  1013. P_CLPVOID0 lpcbData
  1014. APIERR
  1015. mov ax,ERROR_INVALID_PARAMETER
  1016. APIEND
  1017. API LONG, RegQueryValueEx32, NRESTEXT, <DATA>
  1018. ;(HKEY hkey, LPCSTR lpszValue, LONG FAR *lpdwReserved, LONG FAR * lpdwType, LPBYTE lpbData, LONG FAR *lpcbData)
  1019. P_HKEY hKey
  1020. P_CLPVOID0 lpValue
  1021. P_DWORD lpdwReserved
  1022. P_CLPVOID0 lpdwType
  1023. P_CLPVOID0 lpbData
  1024. P_CLPVOID0 lpcbData
  1025. APIERR
  1026. mov ax,ERROR_INVALID_PARAMETER
  1027. APIEND
  1028. API LONG, RegSetValueEx32, NRESTEXT, <DATA>
  1029. ;(HKEY hkey, LPCSTR lpValue, DWORD dwReserved, DWORD fdwType, LPBYTE lpbData,DWORD cbData)
  1030. P_HKEY hKey
  1031. P_CLPVOID0 lpValue
  1032. P_DWORD dwReserved
  1033. P_DWORD dwType
  1034. P_CLPVOID0 lpbData
  1035. P_DWORD cbData
  1036. APIERR
  1037. mov ax,ERROR_INVALID_PARAMETER
  1038. APIEND
  1039. API LONG, RegLoadKey32, NRESTEXT, <DATA>
  1040. ;(HKEY hkey, LPCSTR lpSubKey, LPCSTR lpszFileName)
  1041. P_HKEY hKey
  1042. P_CLPVOID0 lpSubKey
  1043. P_CLPVOID0 lpszFileName
  1044. APIERR
  1045. mov ax,ERROR_INVALID_PARAMETER
  1046. APIEND
  1047. API LONG, RegUnLoadKey32, NRESTEXT, <DATA>
  1048. ;(HKEY hkey, LPCSTR lpSubKey)
  1049. P_HKEY hKey
  1050. P_CLPVOID0 lpSubKey
  1051. APIERR
  1052. mov ax,ERROR_INVALID_PARAMETER
  1053. APIEND
  1054. API LONG, RegSaveKey32, NRESTEXT, <DATA>
  1055. ;(HKEY hkey, LPCSTR lpszFile,void far * lpSA)
  1056. P_HKEY hKey
  1057. P_CLPVOID0 lpszFile
  1058. P_CLPVOID0 lpSA
  1059. APIERR
  1060. mov ax,ERROR_INVALID_PARAMETER
  1061. APIEND
  1062. ; in CONTEXT.ASM
  1063. API void, Yield, TEXT, <VOID, ASM, FUNNYFRAME> ;nogen
  1064. ; in ERROR.C
  1065. API void, LogError, TEXT, <VOID, NOGEN>
  1066. P_WORD err
  1067. P_int iParam
  1068. P_LPVOID pParam
  1069. ; in ERROR.C
  1070. API void, LogParamError, TEXT, <VOID, NOGEN>
  1071. P_WORD err
  1072. ; in ERROR.C
  1073. WDI_VALID equ 0007h
  1074. _DefSimpleF F_MODNAME,8
  1075. STRUCT <WINDEBUGINFO>
  1076. F_FLAGS flags, WDI_VALID
  1077. F_DWORD dwOptions
  1078. F_DWORD dwFilter
  1079. F_MODNAME achAllocModule
  1080. F_DWORD dwAllocBreak
  1081. F_DWORD dwAllocCount
  1082. ENDSTRUCT
  1083. _GenLP <P_LPWINDEBUGINFO>,<LP>,%VLcbsWINDEBUGINFO
  1084. P_CLPWINDEBUGINFO macro lpwdi,opts
  1085. _GenParm <lpwdi>,4,<opts>
  1086. if VLgen
  1087. mov ax,_P_&lpwdi
  1088. mov cx,_P_&lpwdi+2
  1089. mov bx,VLcbsWINDEBUGINFO
  1090. lcall CLP
  1091. _gensub CLP
  1092. mov es,cx
  1093. mov bx,ax
  1094. test word ptr es:[bx]._F_flags,not WDI_VALID
  1095. jz @F
  1096. mov bx,ERR_BAD_PTR
  1097. lcall Inval_Param_
  1098. @@:
  1099. endif
  1100. endm
  1101. API void, SetWinDebugInfo, TEXT, <DEBUGONLY>
  1102. P_CLPWINDEBUGINFO lpwdi
  1103. API void, GetWinDebugInfo, TEXT, <DEBUGONLY>
  1104. P_LPWINDEBUGINFO lpwdi
  1105. P_FLAGS flags, WDI_VALID
  1106. ifdef DBCS
  1107. ; in USERPRO.ASM
  1108. API void, GetSystemDefaultLangID, MISCTEXT, <VOID, ASM, FUNNYFRAME> ;nogen
  1109. endif ; DBCS