Accessing struct members;
-
I have a DllGetVersion function that takes a pointer to DLLVERSIONINFO. When I check the cbSize field, how do I set the members if cbSize is sizeof(DLLVERSIONINFO2) struct? Thank You Bo Hunter
From the docs:
dwFlags
Reserved.
ullVersion
Value that contains the version information. It is divided into four 16-bit fields containing the major and minor version numbers, the build number, and the QFE version, in that order. Use the
MAKEDLLVERULL
macro to construct this value.The page on
MAKEDLLVERULL
has an example usage:MAKEDLLVERULL(4,71,0,0)
which indicates version 4.71.0.0 --Mike-- Ericahist | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber "That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas." -- Buffy -
From the docs:
dwFlags
Reserved.
ullVersion
Value that contains the version information. It is divided into four 16-bit fields containing the major and minor version numbers, the build number, and the QFE version, in that order. Use the
MAKEDLLVERULL
macro to construct this value.The page on
MAKEDLLVERULL
has an example usage:MAKEDLLVERULL(4,71,0,0)
which indicates version 4.71.0.0 --Mike-- Ericahist | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber "That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas." -- BuffyActually Michael I have read the same info. I was wondering since my function took DLLVERSIONINFO* struct and cbSize == sizeof(DLLVERSIONINFO2) how would I set the new members. Put it this way, is this safe? Or will it even work?
STDAPI DllGetVersion(DLLVERSIONINFO* pDllInfo) { // DLLVERSIONINFO pDllInfo->dwBuildNumber = BUILD_NUMBER; pDllInfo->dwMajorVersion = MAJOR_NUMBER; pDllInfo->dwMinorVersion = MINOR_NUMBER; pDllInfo->dwPlatformID = PLATFORM_ID; if (pDllInfo->cbSize == sizeof(DLLVERSIONINFO2)) { // DLLVERSIONINFO2 DLLVERSIONINFO2* pDllInfo2 = (DLLVERSIONINFO2*)pDllInfo; pDllInfo2->ullVersion = MAKEDLLVERULL(MAJOR_NUMBER, MINOR_NUMBER, BUILD_NUMBER, DLL_SRVPACK); } return (S_OK); }
Thank You Bo Hunter