win32汇编学习过程遇到的困惑
kernel32.inc声明的系统API如下
Process32FirstW PROTO STDCALL :DWORD,:DWORD
IFDEF __UNICODE__
Process32First equ <Process32FirstW>
ENDIF
Process32NextW PROTO STDCALL :DWORD,:DWORD
IFDEF __UNICODE__
Process32Next equ <Process32NextW>
ENDIF
我的asm文件编写如下
CheckFatherProcessID proc
LOCAL hProc: HANDLE
LOCAL pe: PROCESSENTRY32
mov pe.dwSize,sizeof PROCESSENTRY32
invoke CreateToolhelp32Snapshot,TH32CS_SNAPPROCESS,0
mov hProc,eax
mov eax,INVALID_HANDLE_VALUE
.if eax == hProc
xor eax,eax
ret
.endif
invoke Process32First,hProc,addr pe
.while (eax)
;invoke StrCmpi,addr szExplorer,addr pe.szExeFile
invoke lstrcmpi, szExplorer, pe.szExeFile
.if (eax == 0)
push pe.th32ParentProcessID
pop dwFather
push pe.th32ProcessID
pop dwSun
.endif
invoke Process32Next,hProc,addr pe
.endw
invoke CloseHandle,hProc
push ebx
mov eax,dwFather
mov ebx,dwSun
.if eax == ebx
xor eax,eax
pop ebx
ret
.else
mov eax,1
pop ebx
ret
.endif
ret
CheckFatherProcessID endp
end start
编译通过,链接错误
Link /subsystem:windows AntiDown.obj AntiDown.res
Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
AntiDown.obj : error LNK2001: unresolved external symbol _Process32First@8
AntiDown.obj : error LNK2001: unresolved external symbol _Process32Next@8
AntiDown.exe : fatal error LNK1120: 2 unresolved externals
什么原因啊 ????、大牛帮忙啊