Hang on, you haven't adjusted all of your CallFunction()'s correctly!
Try the following :
Code: Select all
Procedure.s GFVI_GetInfo(lptstrFilename$,lekFlags,bFieldName);- get exe/dll file information [gfvi]
;CallDebugger
Protected lpdwHandle.l, dwLen.w, lpData.l, lplpBuffer.l, puLen.l, *pBlock, lpSubBlock$
Protected nSize.w, szLang$, bBit.b, lekFlag.l, sElement$, sGFVI$
lplpBuffer = 0 : puLen = 0 : sGFVI$ = "" : nSize = 128 : szLang$ = Space(nSize)
If FileSize(lptstrFilename$)>0
If OpenLibrary(1,"Version.dll")
dwLen = CallFunction(1,"GetFileVersionInfoSizeA",@lptstrFilename$,@lpdwHandle)
If dwLen>0
*pBlock=AllocateMemory(dwLen)
If *pBlock>0
Result = CallFunction(1,"GetFileVersionInfoA",@lptstrFilename$,0,dwLen,*pBlock)
If Result
lpSubBlock$ = "\\VarFileInfo\\Translation"
Result = CallFunction(1,"VerQueryValueA",*pBlock,@lpSubBlock$,@lplpBuffer,@puLen)
If Result
CPLI$ = RSet(Hex(PeekW(lplpBuffer)),4,"0")+RSet(Hex(PeekW(lplpBuffer+2)),4,"0")
Result = CallFunction(1,"VerLanguageNameA",PeekW(lplpBuffer),@szLang$,nSize)
EndIf
lekFlag = 1
For bBit = 1 To 12
If lekFlag & lekFlags
sElement$ = GFVI_GetElementName(lekFlag)
lpSubBlock$ = "\\StringFileInfo\\"+CPLI$+"\\"+sElement$
Result = CallFunction(1,"VerQueryValueA",*pBlock,@lpSubBlock$,@lplpBuffer,@puLen)
If Result
If sGFVI$<>"" : sGFVI$+Chr(10) : EndIf
If bFieldName
sGFVI$=sGFVI$+sElement$+":"+Chr(9)+PeekS(lplpBuffer)
Else
sGFVI$=sGFVI$+PeekS(lplpBuffer)
EndIf
EndIf
EndIf
lekFlag << 1
Next
If lekFlag & lekFlags
If sGFVI$<>"" : sGFVI$+Chr(10) : EndIf
If bFieldName
sElement$ = GFVI_GetElementName(lekFlag)
sGFVI$ = sGFVI$+sElement$+":"+Chr(9)+szLang$
Else
sGFVI$ = sGFVI$+szLang$
EndIf
EndIf
EndIf
FreeMemory(*pBlock)
EndIf
EndIf
CloseLibrary(1)
EndIf
EndIf
ProcedureReturn sGFVI$
EndProcedure
I may look like a mule, but I'm not a complete ass.