home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / LordLucifer / win32asm / files / win32asm.exe / Win32ASM / ASMInc / Win32.mac < prev    next >
Encoding:
Text File  |  1997-09-02  |  2.3 KB  |  73 lines

  1. ; Philippe AUphelle - 08.09.96
  2. ; Message dispatching macros.
  3.  
  4. ; $Id: Win32.mac 1.1 1997/09/02 09:51:00 Philippe Exp $
  5.  
  6. ; $Log: /Win32Equ/Win32.mac $
  7. ; 1     18/09/97 14:24 Philippe
  8. ; Initial checkin into SourceSafe.
  9. ; Revision 1.1  1997/09/02 09:51:00  Philippe
  10. ; Initial revision
  11. ;
  12.  
  13.  
  14. ; It would be a good idea to remove the target macros and do things by hand
  15. ; there. It would probably make the code easier to understand (by making the
  16. ; parms apparent).
  17. ; The use of the
  18. ;   ALIAS <MyLabel> = <TrueLabel>
  19. ; would solve the problem of the MsgProcAlias alternate entry point.
  20.  
  21. CALLBACK        Macro CallBackName:REQ
  22. $$CBPrefix      CATSTR <CallBackName>,<_>
  23.                 EndM
  24.  
  25. MESSAGE         Macro MessageID:REQ,TargetProc
  26.                 LOCAL TempString
  27.                   IFNDEF $$CBPrefix
  28.                   .ERR CallBack macro must be defined first.
  29.                   ELSE                  ;;&&CBPrefix defined.
  30.                     IFB $$CBPrefix
  31.                     .ERR Message macro used out of a CallBack block.
  32.                     ELSE                ;; and not blank.
  33. TempString          TEXTEQU @CatStr (<%$$CBPrefix>,&MessageID)
  34. TempString          PROTO STDCALL hWnd:DWORD,wMsg:DWORD,wParam:DWORD,lParam:DWORD
  35.                     CMP EAX,&MessageID
  36.                     JE TempString
  37.                     ENDIF
  38.                   ENDIF
  39.                 EndM
  40.  
  41. MSGCHAIN        Macro MessageID:REQ,TargetProc:REQ
  42.                 CMP EAX,&MessageID
  43.                 JE &TargetProc
  44.                 EndM
  45.  
  46. CALLBACKDEFAULT Macro DefaultProc:REQ
  47. $$CBPrefix      TEXTEQU <>
  48.                   IFIDNI <DefaultProc>,<None>
  49.                   MOV EAX,FALSE
  50.                   RET
  51.                   ELSE
  52. %                 JMP &DefaultProc
  53.                   ENDIF
  54.                 EndM
  55.  
  56. MSGPROC         Macro ProcName:REQ
  57. ProcName        PROTO STDCALL hWnd:DWORD,wMsg:DWORD,wParam:DWORD,lParam:DWORD
  58. ProcName        PROC USES EBX EDI ESI,
  59.                          hWnd:DWORD,
  60.                          wMsg:DWORD,
  61.                        wParam:DWORD,
  62.                        lParam:DWORD
  63.                 EndM
  64.  
  65. MSGPROCALIAS    Macro AliasProcName:REQ
  66.                 LOCAL TempString
  67. TempString      TEXTEQU @CatStr(<&AliasProcName>,<@16>)
  68.                 EXTERNDEF STDCALL TempString:NEAR
  69. TempString      LABEL NEAR
  70.                 EndM
  71.  
  72.