⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dllentry.asm

📁 这是一些例程
💻 ASM
字号:
; DLLENTRY.ASM
;
; Entry code for example Windows dynamic link library.  When Windows first
; loads the DLL, control comes here first.
;
; This module generates a code segment called INIT_TEXT.  It calls the API
; function LocalInit to initialize the local heap (if one exists), then calls 
; the API function UnlockSegment to unlock the heap segment.  (The call to
; to UnlockSegment is not necessary in protected mode.)  If successful,
; DLLEntry calls the DLL's data initialization routine, prototyped like this:
;
;                       BOOL FAR PASCAL LibMain( void );
;
; DLLEntry returns the result of all this to Windows:  TRUE if successful,
; FALSE otherwise.  Note DLLEntry differs from LibEntry of the Windows SDK in
; that it does not pass arguements to LibMain.
;
; Refer to Chapter 11 of the Programmer's Guide for further information.

.MODEL  small, pascal, farstack
.286

INCLUDE WIN.INC

LibMain PROTO FAR PASCAL

.CODE
DLLEntry        PROC FAR PASCAL PUBLIC          ; Entry point for DLL

; On entry, DS = data segment and CX = heap size
		jcxz    @F                      ; If no heap, skip
		INVOKE  LocalInit, ds, 0, cx    ; Else set up the heap
		.IF     ( ax )                  ; If successful,
		INVOKE  UnlockSegment, -1       ;   unlock the data segment
@@:             call    LibMain                 ; Call DLL's data init routine
		mov     ax, TRUE                ; Return AX = TRUE if okay,
		.ENDIF                          ;   else if LocalInit error,
		ret                             ;   return AX = FALSE

DLLEntry        ENDP

END             DLLEntry

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -