0
我注意到Visual Studio社區2015 sp3奇怪地不會爲單行(代碼顯示)(調試和發佈)創建代碼。我最小化了項目並將代碼放在這裏。爲什麼visual studion 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
沒錯。我應該寫回到那裏。謝謝 –