Small changes (uses HIWORD/LOWORD).

This commit is contained in:
Juergen Schmied 1998-10-11 15:40:04 +00:00 committed by Alexandre Julliard
parent 84b358dc15
commit 5733ed761d
1 changed files with 23 additions and 18 deletions

View File

@ -71,10 +71,12 @@ static void print_vffi_debug(VS_FIXEDFILEINFO *vffi)
{ {
dbg_decl_str(ver, 1024); dbg_decl_str(ver, 1024);
TRACE(ver," structversion=0x%lx.0x%lx, fileversion=0x%lx.0x%lx, productversion=0x%lx.0x%lx, flagmask=0x%lx, flags=%s%s%s%s%s%s\n", TRACE(ver," structversion=%u.%u, fileversion=%u.%u.%u.%u, productversion=%u.%u.%u.%u, flagmask=0x%lx, flags=%s%s%s%s%s%s\n",
(vffi->dwStrucVersion>>16),vffi->dwStrucVersion&0xFFFF, HIWORD(vffi->dwStrucVersion),LOWORD(vffi->dwStrucVersion),
vffi->dwFileVersionMS,vffi->dwFileVersionLS, HIWORD(vffi->dwFileVersionMS),LOWORD(vffi->dwFileVersionMS),
vffi->dwProductVersionMS,vffi->dwProductVersionLS, HIWORD(vffi->dwFileVersionLS),LOWORD(vffi->dwFileVersionLS),
HIWORD(vffi->dwProductVersionMS),LOWORD(vffi->dwProductVersionMS),
HIWORD(vffi->dwProductVersionLS),LOWORD(vffi->dwProductVersionLS),
vffi->dwFileFlagsMask, vffi->dwFileFlagsMask,
(vffi->dwFileFlags & VS_FF_DEBUG) ? "DEBUG," : "", (vffi->dwFileFlags & VS_FF_DEBUG) ? "DEBUG," : "",
(vffi->dwFileFlags & VS_FF_PRERELEASE) ? "PRERELEASE," : "", (vffi->dwFileFlags & VS_FF_PRERELEASE) ? "PRERELEASE," : "",
@ -84,9 +86,9 @@ static void print_vffi_debug(VS_FIXEDFILEINFO *vffi)
(vffi->dwFileFlags & VS_FF_SPECIALBUILD) ? "SPECIALBUILD," : "" (vffi->dwFileFlags & VS_FF_SPECIALBUILD) ? "SPECIALBUILD," : ""
); );
dsprintf(ver," OS=0x%lx.0x%lx ", dsprintf(ver," OS=0x%x.0x%x ",
(vffi->dwFileOS&0xFFFF0000)>>16, HIWORD(vffi->dwFileOS),
vffi->dwFileOS&0x0000FFFF LOWORD(vffi->dwFileOS)
); );
switch (vffi->dwFileOS&0xFFFF0000) { switch (vffi->dwFileOS&0xFFFF0000) {
case VOS_DOS:dsprintf(ver,"DOS,");break; case VOS_DOS:dsprintf(ver,"DOS,");break;
@ -97,13 +99,13 @@ static void print_vffi_debug(VS_FIXEDFILEINFO *vffi)
default: default:
dsprintf(ver,"UNKNOWN(0x%lx),",vffi->dwFileOS&0xFFFF0000);break; dsprintf(ver,"UNKNOWN(0x%lx),",vffi->dwFileOS&0xFFFF0000);break;
} }
switch (vffi->dwFileOS & 0xFFFF) { switch (LOWORD(vffi->dwFileOS)) {
case VOS__BASE:dsprintf(ver,"BASE");break; case VOS__BASE:dsprintf(ver,"BASE");break;
case VOS__WINDOWS16:dsprintf(ver,"WIN16");break; case VOS__WINDOWS16:dsprintf(ver,"WIN16");break;
case VOS__WINDOWS32:dsprintf(ver,"WIN32");break; case VOS__WINDOWS32:dsprintf(ver,"WIN32");break;
case VOS__PM16:dsprintf(ver,"PM16");break; case VOS__PM16:dsprintf(ver,"PM16");break;
case VOS__PM32:dsprintf(ver,"PM32");break; case VOS__PM32:dsprintf(ver,"PM32");break;
default:dsprintf(ver,"UNKNOWN(0x%lx)",vffi->dwFileOS&0xFFFF);break; default:dsprintf(ver,"UNKNOWN(0x%x)",LOWORD(vffi->dwFileOS));break;
} }
TRACE(ver, "(%s)\n", dbg_str(ver)); TRACE(ver, "(%s)\n", dbg_str(ver));
@ -444,7 +446,7 @@ find_pe_resource(
pehdoffset = LZTELL(lzfd); pehdoffset = LZTELL(lzfd);
LZREAD(&pehd); LZREAD(&pehd);
resdir = pehd.OptionalHeader.DataDirectory[IMAGE_FILE_RESOURCE_DIRECTORY]; resdir = pehd.OptionalHeader.DataDirectory[IMAGE_FILE_RESOURCE_DIRECTORY];
TRACE(ver,"(.,%p,%p,....)\n",typeid,resid); TRACE(ver,"(.,type=%p, id=%p, len=%u, off=%lu)\n",typeid,resid,*reslen,*off);
if (!resdir.Size) { if (!resdir.Size) {
WARN(ver,"No resource directory found in PE file.\n"); WARN(ver,"No resource directory found in PE file.\n");
return 0; return 0;
@ -515,6 +517,7 @@ find_pe_resource(
} }
HeapFree(GetProcessHeap(),0,image); HeapFree(GetProcessHeap(),0,image);
HeapFree(GetProcessHeap(),0,sections); HeapFree(GetProcessHeap(),0,sections);
TRACE(ver,"-- found at off=%lu\n",*off);
return 1; return 1;
} }
@ -528,7 +531,7 @@ DWORD WINAPI GetFileResourceSize(LPCSTR filename,SEGPTR restype,SEGPTR resid,
int reslen=0; int reslen=0;
int res=0; int res=0;
TRACE(ver,"(%s,%lx,%lx,%p)\n", TRACE(ver,"(%s,type=0x%lx,id=0x%lx,off=%p)\n",
filename,(LONG)restype,(LONG)resid,off filename,(LONG)restype,(LONG)resid,off
); );
lzfd=LZOpenFile32A(filename,&ofs,OF_READ); lzfd=LZOpenFile32A(filename,&ofs,OF_READ);
@ -565,7 +568,7 @@ DWORD WINAPI GetFileResource(LPCSTR filename,SEGPTR restype,SEGPTR resid,
int res=0; int res=0;
int reslen=datalen; int reslen=datalen;
TRACE(ver,"(%s,%lx,%lx,%ld,%ld,%p)\n", TRACE(ver,"(%s,type=0x%lx,id=0x%lx,off=%ld,len=%ld,date=%p)\n",
filename,(LONG)restype,(LONG)resid,off,datalen,data filename,(LONG)restype,(LONG)resid,off,datalen,data
); );
@ -589,11 +592,13 @@ DWORD WINAPI GetFileResource(LPCSTR filename,SEGPTR restype,SEGPTR resid,
if (reslen>datalen) reslen = datalen; if (reslen>datalen) reslen = datalen;
memcpy(data,resdata,reslen); memcpy(data,resdata,reslen);
free(resdata); free(resdata);
TRACE(ver,"--[1] len=%u\n", reslen);
return reslen; return reslen;
} }
LZSeek32(lzfd,off,SEEK_SET); LZSeek32(lzfd,off,SEEK_SET);
reslen = LZRead32(lzfd,data,datalen); reslen = LZRead32(lzfd,data,datalen);
LZClose32(lzfd); LZClose32(lzfd);
TRACE(ver,"--[2] len=%u\n", reslen);
return reslen; return reslen;
} }
@ -656,12 +661,12 @@ DWORD WINAPI GetFileVersionInfoSize32W( LPCWSTR filename, LPDWORD handle )
DWORD WINAPI GetFileVersionInfo16(LPCSTR filename,DWORD handle,DWORD datasize, DWORD WINAPI GetFileVersionInfo16(LPCSTR filename,DWORD handle,DWORD datasize,
LPVOID data) LPVOID data)
{ {
TRACE(ver,"(%s,%ld,%ld,%p)\n", TRACE(ver,"(%s,%ld,size=%ld,data=%p)\n",
filename,handle,datasize,data filename,handle,datasize,data
); );
return GetFileResource( return GetFileResource(
filename,VS_FILE_INFO,VS_VERSION_INFO,handle,datasize,data filename,VS_FILE_INFO,VS_VERSION_INFO,handle,datasize,data
); );
} }
/* GetFileVersionInfoA [VERSION.0] */ /* GetFileVersionInfoA [VERSION.0] */