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

📄 reportlasterror.asm

📁 用汇编语言编写Windows驱动程序的工具
💻 ASM
字号:
; Written by Four-F

.code

;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

ReportLastError proc

	option PROLOGUE:NONE
	option EPILOGUE:NONE

	.const
	szCaption			db "ErrorShow",0
	szNotFoundMessage	db "Sorry. Error number not found.", 0

	.code

	pushfd
	pushad

	sub esp, 800h

	invoke GetLastError
	mov ecx, esp
	invoke FormatMessage, FORMAT_MESSAGE_FROM_SYSTEM, NULL, eax, \
					SUBLANG_DEFAULT SHL 10 + LANG_NEUTRAL, ecx, 800h, NULL
	.if eax != 0
		mov ecx, esp
		invoke MessageBox, NULL, ecx, addr szCaption, MB_OK
	.else
		invoke MessageBox, NULL, addr szNotFoundMessage, addr szCaption, MB_OK
	.endif
 
	add esp, 800h

	popad
	popfd
    
	option PROLOGUE:PROLOGUEDEF
	option EPILOGUE:EPILOGUEDEF

	ret

ReportLastError endp

⌨️ 快捷键说明

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