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.

92 lines
2.8 KiB

  1. ;**************************************************************************
  2. ;* CLASS2.ASM
  3. ;*
  4. ;* Assembly support for the class enumeration routines.
  5. ;*
  6. ;**************************************************************************
  7. INCLUDE TOOLPRIV.INC
  8. PMODE32 = 0
  9. PMODE = 0
  10. SWAPPRO = 0
  11. INCLUDE TDB.INC
  12. ;** Class structure
  13. CLS STRUC
  14. cls_pclsNext DW ?
  15. cls_clsMagic DW ?
  16. cls_atom DW ?
  17. cls_pdce DW ?
  18. cls_RefCount DW ?
  19. cls_style DW ?
  20. cls_lpfnWndProc DD ?
  21. cls_cbclsExtra DW ?
  22. cls_cbwndExtra DW ?
  23. cls_hInstance DW ?
  24. cls_hIcon DW ?
  25. cls_hCursor DW ?
  26. cls_hbrBackgr DW ?
  27. cls_lpszMnName DW ?
  28. cls_lpszClsName DW ?
  29. CLS ENDS
  30. ;** External functions
  31. externNP HelperVerifySeg
  32. externFP GetAtomName
  33. ;** Functions
  34. sBegin CODE
  35. assumes CS,CODE
  36. ; ClassInfo
  37. ;
  38. ; Returns information about the class with the given block handle
  39. cProc ClassInfo, <PUBLIC,NEAR>, <si,di,ds>
  40. parmD lpClass
  41. parmW wOffset
  42. cBegin
  43. ;** Start by verifying that we can read the segment here
  44. mov ax,hUserHeap ;Get the selector
  45. mov bx,wOffset ; and the desired offset
  46. cCall HelperVerifySeg, <ax,bx>
  47. or ax,ax ;FALSE return?
  48. jnz CI_SelOk ;We're OK
  49. xor ax,ax ;Return FALSE
  50. jmp CI_End
  51. CI_SelOk:
  52. ;** Point to the CLS structure with DS:SI. Note that using DS to
  53. ;** point to USER's DS is useful to get USER's local atoms
  54. mov ax,hUserHeap ;User's heap is User's DGROUP
  55. mov ds,ax
  56. mov si,wOffset ;Get a pointer to the CLS structure
  57. ;** Copy the hInstance
  58. les di,lpClass ;Get the structure
  59. mov ax,[si].cls_hInstance ;Get the hInst of the class owner
  60. mov es:[di].ce_hInst,ax ;Save in the CLASSENTRY struct
  61. ;** Get the string from the atom and copy the next pointer
  62. mov ax,[si].cls_atom ;Get the desired atom number
  63. lea bx,[di].ce_szClassName ;Get the offset to copy string to
  64. push es ;Save ES (GetAtomName may trash)
  65. mov cx,MAX_CLASSNAME ;Get max classname length
  66. cCall GetAtomName, <ax,es,bx,cx> ;Copy the atom string
  67. pop es
  68. or ax,ax ;OK?
  69. jnz CI_20 ;Yes
  70. mov es:[di].ce_szClassName,0 ;No. Clear the string
  71. CI_20: mov ax,[si].cls_pclsNext ;Get the next pointer
  72. mov es:[di].ce_wNext,ax ;Save it
  73. ;** Return TRUE on success
  74. mov ax,TRUE
  75. CI_End:
  76. cEnd
  77. sEnd
  78. END