Problems with GetFileVersionInfo[Size]()

Malte Starostik Malte.Starostik at
Mon Jun 11 21:20:40 CDT 2001


The Shockwave ActiveX control I'm loading tries to read the VERSIONINFO 
resource from my winelib app. AFAICS it subsequently crashes because that 
Anyway, there seems to be a problem:

        char path[PATH_MAX];
        GetModuleFileName(inst, path, sizeof(path));
        kdDebug() << "GetModuleFileName: " << path << endl;
        DWORD dummy;
        kdDebug() << "GetFileVersionInfoSize: " << 
GetFileVersionInfoSize(path, &dummy) << endl;
        kdDebug() << "GetLastError: " << GetLastError() << endl;

activexproxy: GetModuleFileName: 
activexproxy: GetFileVersionInfoSize: 0
activexproxy: GetLastError: 0

which means it obviously doesn't find the resource. (btw, why is 
GetLastError() 0 here?)
However, this code suceeds (inst is the HINSTANCE passed to WinMain()):

        HRSRC ver = FindResource(inst, MAKEINTRESOURCE(VS_VERSION_INFO),
        kdDebug() << "FindResource: " << ver << endl;
        int size = SizeofResource(inst, ver);
        kdDebug() << "SizeofResource:" << size << endl;
        HGLOBAL mem = LoadResource(inst, ver);
        void *buf, *block = LockResource(mem);
        UINT len;
        VerQueryValue(block, "StringFileInfo\\040904b0\\FileDescription", 
&buf, &len);
        kdDebug() << "Description: " << reinterpret_cast<WCHAR *>(buf) << 

the output is:

activexproxy: FindResource: 1078760168
activexproxy: SizeofResource:608
activexproxy: Description: ActiveX-Proxy for Konqueror

So basically the code GetFileInfoVersion[Size]() use to load a library fail 
if the given path is the winelib app (the symlink to wine) itself :(
Wars don't determine who's right, only who's left.

More information about the wine-devel mailing list