i am having problem with this function input is int and output is dword i always get correct info, but other people doesn't, how should this be written in res file, or is there something wrong with the code?
source
EXPORT int GetVideoRam(int mode)
{
LPDIRECTDRAW7 lpDD;
DDSCAPS2 ddsCaps2;
DWORD dwTotal;
DWORD dwFree;
HRESULT hr;
DirectDrawCreateEx(NULL, (VOID **)&lpDD, IID_IDirectDraw7, NULL);
hr = lpDD->QueryInterface(IID_IDirectDraw7, (LPVOID*)&lpDD);
if (FAILED(hr))
return hr;
// Initialize the structure.
ZeroMemory(&ddsCaps2, sizeof(ddsCaps2));
ddsCaps2.dwCaps = DDSCAPS_VIDEOMEMORY;
hr = lpDD->GetAvailableVidMem(&ddsCaps2, &dwTotal, &dwFree);
if (FAILED(hr))
return hr;
DWORD vram_bytes = dwTotal;
DWORD vram_kilobytes = dwTotal / 1024;
DWORD vram_megabytes = dwTotal / 1048576 + 4;
DWORD vram_gigabytes = dwTotal / 1048576 / 1024;
if(mode == 1)
return (DWORD)vram_bytes;
if(mode == 2)
return (DWORD)vram_kilobytes;
if(mode == 3)
return (DWORD)vram_megabytes;
if(mode == 4)
return (DWORD)vram_gigabytes;
return 0;
}
rc file
GetVideoRam[%LD%?GetVideoRam@@YAHH@Z%
is this correct?