home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c480 / 19.ddi / MFC / SRC / AFXDLL.AS_ / AFXDLL.AS
Encoding:
Text File  |  1993-02-08  |  3.6 KB  |  137 lines

  1. ; This is a part of the Microsoft Foundation Classes C++ library. 
  2. ; Copyright (C) 1992 Microsoft Corporation 
  3. ; All rights reserved. 
  4. ;  
  5. ; This source code is only intended as a supplement to the 
  6. ; Microsoft Foundation Classes Reference and Microsoft 
  7. ; QuickHelp and/or WinHelp documentation provided with the library. 
  8. ; See these sources for detailed information regarding the 
  9. ; Microsoft Foundation Classes product. 
  10.  
  11. ;**************************************************************************
  12. ;* AFXDLL.ASM
  13. ;*
  14. ;* Allocates space on the stack for AFX per-app globals
  15. ;**************************************************************************
  16.  
  17. NULL        SEGMENT WORD PUBLIC 'BEGDATA'
  18. NULL        ENDS
  19. AFX_NULL    SEGMENT WORD PUBLIC 'BEGDATA'
  20. AFX_NULL    ENDS
  21. _DATA       SEGMENT WORD PUBLIC 'DATA'
  22. _DATA       ENDS
  23. _BSS        SEGMENT WORD PUBLIC 'BSS'
  24. _BSS        ENDS
  25.  
  26. DGROUP      GROUP NULL, AFX_NULL, _DATA, _BSS
  27.  
  28. ;*****************************************************************************
  29. ; DLL Library provided WinMain and alloc stub routines
  30.  
  31.     extrn AFXWINMAIN:FAR        ;; DLL initialization
  32.     extrn __fmalloc:FAR
  33.     extrn __ffree:FAR
  34.  
  35.     extrn __acrtused:ABS        ; bring in C runtime
  36.  
  37. IFDEF _DEBUG
  38.     ;; initialize diagnostics
  39.     extrn AFXDIAGNOSTICINIT:FAR         ;; DLL initialization
  40. ENDIF ;_DEBUG
  41.  
  42.  
  43. _TEXT   SEGMENT BYTE PUBLIC 'CODE'
  44.     ASSUME CS:_TEXT
  45.  
  46. ;********************************************
  47.  
  48.  
  49. public WINMAIN
  50. WINMAIN PROC FAR
  51.  
  52. IFDEF _DEBUG
  53.     CALL AFXDIAGNOSTICINIT      ;; assume it worked
  54. ENDIF
  55.     JMP AFXWINMAIN
  56.  
  57. WINMAIN ENDP
  58.  
  59.  
  60. ;; Export linkage for CWinApp::_ForceDLLinkage()
  61. public ?_ForceLinkage@CWinApp@@VECXXZ
  62. ?_ForceLinkage@CWinApp@@VECXXZ PROC FAR
  63.     int 3       ; // should never be called
  64. ?_ForceLinkage@CWinApp@@VECXXZ ENDP
  65.  
  66. _TEXT ENDS
  67.     
  68. ;*****************************************************************************
  69. ; This module contains data which must be at a fixed offset in the _DATA
  70. ; segment and allocate 128 bytes for AFX specific data
  71.  
  72. ;; NOTE: the following structure must mirror struct AFX_APPDATA defined
  73. ;;   in MFC\INCLUDE\AFXDLL_.H
  74.  
  75. IFDEF _DEBUG
  76.     extrn AFXTRACEV:FAR     ;; from app linked 'dumpout.obj' module
  77.     extrn AFXASSERTFAILEDLINE:FAR ;; from app linked 'afxasert.obj' module
  78. ENDIF
  79.     extrn AFXAPPABORT:FAR   ;; from app linked 'afxabort.obj' module
  80.  
  81.     extrn AFXAPPSETNEWHANDLER:FAR   ;; from app linked 'afxmem.obj' module
  82.     extrn AFXAPPALLOC:FAR   ;; from app linked 'afxmem.obj' module
  83.     extrn AFXAPPFREE:FAR    ;; from app linked 'afxmem.obj' module
  84.     extrn AFXAPPREALLOC:FAR ;; from app linked 'afxmem.obj' module
  85.  
  86.     extrn _AFXVBAPIENTRY:FAR    ;; VBX API vector from DLL
  87.  
  88. AFX_NULL    SEGMENT
  89.     ASSUME CS:DGROUP
  90.     ASSUME DS:DGROUP
  91.  
  92.     ;* struct AFX_APPDATA (128 bytes max)
  93.     DW      128         ; number of bytes reserved
  94.     DW      0200H       ; MFC 200
  95.  
  96. IFDEF _DEBUG
  97.     DW      OFFSET AppDebug ; stack based pointer to debug stuff
  98.     DW      0           ; reserved
  99. else
  100.     DD      0           ; reserved
  101. ENDIF
  102.  
  103.     DD      0
  104.     DD      0
  105.     ;* VBX HOOK (must be at SS:20)
  106.     DD      _AFXVBAPIENTRY
  107.  
  108.     ;* memory allocation routines
  109.     DD      AFXAPPABORT
  110.     DD      AFXAPPSETNEWHANDLER
  111.     DD      AFXAPPALLOC
  112.     DD      AFXAPPFREE
  113.     DD      AFXAPPREALLOC
  114.     DD      0
  115.     DD      0
  116.  
  117.     DB      128-48 DUP (0)
  118.  
  119. IFDEF _DEBUG
  120. ;; NOTE: the following structure must mirror struct AFX_APPDEBUG defined
  121. ;;   in MFC\INCLUDE\AFXDLL_.H
  122.  
  123.     ;* struct AFX_APPDEBUG (32 bytes max)
  124. AppDebug:
  125.     DD      AFXTRACEV
  126.     DD      AFXASSERTFAILEDLINE
  127.     DB      32-8 DUP (0)
  128.  
  129. ENDIF
  130.  
  131. AFX_NULL    ENDS
  132.  
  133.  
  134. ;*****************************************************************************
  135.  
  136.     END
  137.