我注意到Visual Studio社区2015 sp3奇怪地没有为单行创建代码(在代码中显示)(调试和发布)。我最小化了项目并将代码放在这里。
#include "stdafx.h"
enum AMINZIPCMD { AMINZIP_RELEASE = 0 };
enum AMINZIPRESULT { AMINZIP_SUCCESS = 0, AMINZIP_FAILURE };
struct AMINZIP {
unsigned __int32 m_cbSize;
unsigned __int32 m_dwType;
};
#define DLL_EXPORT __declspec(dllexport) __stdcall
extern "C" {
int DLL_EXPORT uAminZip(enum AMINZIPCMD iCmd, struct AMINZIP * pAminZip);
};
#define global_func
/*------------------------------------------------------------*/
global_func int DLL_EXPORT uAminZip(enum AMINZIPCMD iCmd, struct AMINZIP * pAminZip)
{
//No code generated for this line
if (pAminZip->m_cbSize != sizeof(*pAminZip)) AMINZIP_FAILURE;
if (pAminZip->m_dwType != 718624670) return AMINZIP_FAILURE;
return AMINZIP_SUCCESS;
}
int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow)
{
struct AMINZIP aminzip;
return uAminZip(AMINZIP_RELEASE, &aminzip);
}
/*------------------------------------------------------------*/
和uAminZip函数的汇编窗口
global_func int DLL_EXPORT uAminZip(enum AMINZIPCMD iCmd, struct AMINZIP * pAminZip)
{
00F01690 55 push ebp
00F01691 8B EC mov ebp,esp
00F01693 81 EC C0 00 00 00 sub esp,0C0h
00F01699 53 push ebx
00F0169A 56 push esi
00F0169B 57 push edi
00F0169C 8D BD 40 FF FF FF lea edi,[ebp-0C0h]
00F016A2 B9 30 00 00 00 mov ecx,30h
00F016A7 B8 CC CC CC CC mov eax,0CCCCCCCCh
00F016AC F3 AB rep stos dword ptr es:[edi]
if (pAminZip->m_cbSize != sizeof(*pAminZip)) AMINZIP_FAILURE;
if (pAminZip->m_dwType != 718624670) return AMINZIP_FAILURE;
00F016AE 8B 45 0C mov eax,dword ptr [pAminZip]
00F016B1 81 78 04 9E 57 D5 2A cmp dword ptr [eax+4],2AD5579Eh
00F016B8 74 07 je uAminZip+31h (0F016C1h)
00F016BA B8 01 00 00 00 mov eax,1
00F016BF EB 02 jmp uAminZip+33h (0F016C3h)
return AMINZIP_SUCCESS;
00F016C1 33 C0 xor eax,eax
}
00F016C3 5F pop edi
00F016C4 5E pop esi
00F016C5 5B pop ebx
00F016C6 8B E5 mov esp,ebp
00F016C8 5D pop ebp
00F016C9 C2 08 00 ret 8
我创建了一个新的Win32项目并将代码复制到它,但问题仍然存在
mr.abzadeh
答案 0 :(得分:0)
该行是否包含“return”语句?