Implement GetVersionInfoFromImage.
Add missing prototypes to w32api.
Modified: trunk/reactos/include/wine/setupapi.h
Modified: trunk/reactos/lib/setupapi/misc.c
Modified: trunk/reactos/lib/setupapi/setupapi.spec
Modified: trunk/reactos/w32api/include/setupapi.h
_____
Modified: trunk/reactos/include/wine/setupapi.h
--- trunk/reactos/include/wine/setupapi.h 2005-07-02 17:57:51 UTC
(rev 16381)
+++ trunk/reactos/include/wine/setupapi.h 2005-07-02 19:26:43 UTC
(rev 16382)
@@ -683,6 +683,7 @@
BOOL WINAPI EnablePrivilege(PCWSTR lpPrivilegeName, BOOL bEnable);
BOOL WINAPI FileExists(PCWSTR lpFileName, PWIN32_FIND_DATAW
lpFileFindData);
DWORD WINAPI GetSetFileTimestamp(PCWSTR, PFILETIME, PFILETIME,
PFILETIME, BOOLEAN);
+BOOL WINAPI GetVersionInfoFromImage(LPWSTR, PULARGE_INTEGER,
LPWORD);
void WINAPI InstallHinfSectionA( HWND hwnd, HINSTANCE handle, PCSTR
cmdline, INT show );
void WINAPI InstallHinfSectionW( HWND hwnd, HINSTANCE handle,
PCWSTR cmdline, INT show );
#define InstallHinfSection WINELIB_NAME_AW(InstallHinfSection)
_____
Modified: trunk/reactos/lib/setupapi/misc.c
--- trunk/reactos/lib/setupapi/misc.c 2005-07-02 17:57:51 UTC (rev
16381)
+++ trunk/reactos/lib/setupapi/misc.c 2005-07-02 19:26:43 UTC (rev
16382)
@@ -25,6 +25,7 @@
#include "wingdi.h"
#include "winuser.h"
#include "winreg.h"
+#include "winver.h"
#include "setupapi.h"
#include "wine/unicode.h"
@@ -1090,3 +1091,73 @@
MoveWindow(hwnd, posX, posY, nWindowHeight, nWindowWidth, 0);
}
+
+
+/**********************************************************************
****
+ * GetVersionInfoFromImage [SETUPAPI.@]
+ *
+ * Retrieves version information for a given file.
+ *
+ * PARAMS
+ * lpFileName [I] File name
+ * lpFileVersion [O] Pointer to the full file version
+ * lpVersionVarSize [O] Pointer to the size of the variable version
+ * information
+ *
+ * RETURNS
+ * Success: TRUE
+ * Failure: FALSE
+ */
+BOOL WINAPI
+GetVersionInfoFromImage(LPWSTR lpFileName,
+ PULARGE_INTEGER lpFileVersion,
+ LPWORD lpVersionVarSize)
+{
+ DWORD dwHandle;
+ DWORD dwSize;
+ LPVOID lpInfo;
+ UINT uSize;
+ VS_FIXEDFILEINFO *lpFixedInfo;
+ LPWORD lpVarSize;
+
+ dwSize = GetFileVersionInfoSizeW(lpFileName, &dwHandle);
+ if (dwSize == 0)
+ return FALSE;
+
+ lpInfo = MyMalloc(dwSize);
+ if (lpInfo == NULL)
+ return FALSE;
+
+ if (!GetFileVersionInfoW(lpFileName, 0, dwSize, lpInfo))
+ {
+ MyFree(lpInfo);
+ return FALSE;
+ }
+
+ if (!VerQueryValueW(lpInfo, L"\\",
+ (LPVOID*)&lpFixedInfo, &uSize))
+ {
+ MyFree(lpInfo);
+ return FALSE;
+ }
+
+ lpFileVersion->LowPart = lpFixedInfo->dwFileVersionLS;
+ lpFileVersion->HighPart = lpFixedInfo->dwFileVersionMS;
+
+ *lpVersionVarSize = 0;
+ if (!VerQueryValueW(lpInfo, L"\\VerFileInfo\\Translation",
+ (LPVOID*)&lpVarSize, &uSize))
+ {
+ MyFree(lpInfo);
+ return TRUE;
+ }
+
+ if (uSize >= 4)
+ {
+ *lpVersionVarSize = *lpVarSize;
+ }
+
+ MyFree(lpInfo);
+
+ return TRUE;
+}
_____
Modified: trunk/reactos/lib/setupapi/setupapi.spec
--- trunk/reactos/lib/setupapi/setupapi.spec 2005-07-02 17:57:51 UTC
(rev 16381)
+++ trunk/reactos/lib/setupapi/setupapi.spec 2005-07-02 19:26:43 UTC
(rev 16382)
@@ -206,7 +206,7 @@
@ stub GetCurrentDriverSigningPolicy
@ stub GetNewInfName
@ stdcall GetSetFileTimestamp(wstr ptr ptr ptr long)
-@ stub GetVersionInfoFromImage
+@ stdcall GetVersionInfoFromImage(wstr ptr ptr)
@ stub InfIsFromOemLocation
@ stub InstallCatalog
@ stdcall InstallHinfSection(long long str long) InstallHinfSectionA
_____
Modified: trunk/reactos/w32api/include/setupapi.h
--- trunk/reactos/w32api/include/setupapi.h 2005-07-02 17:57:51 UTC
(rev 16381)
+++ trunk/reactos/w32api/include/setupapi.h 2005-07-02 19:26:43 UTC
(rev 16382)
@@ -1038,13 +1038,27 @@
WINSETUPAPI LONG WINAPI AddTagToGroupOrderList(PCWSTR, DWORD, DWORD);
+WINSETUPAPI VOID WINAPI AssertFail(LPSTR, UINT, LPSTR);
+WINSETUPAPI DWORD WINAPI CaptureAndConvertAnsiArg(PCSTR, PWSTR*);
+WINSETUPAPI DWORD WINAPI CaptureStringArg(PCWSTR, PWSTR*);
WINSETUPAPI VOID WINAPI CenterWindowRelativeToParent(HWND);
+WINSETUPAPI BOOL WINAPI ConcatenatePaths(LPWSTR, LPCWSTR, DWORD,
LPDWORD);
+WINSETUPAPI BOOL WINAPI DelayedMove(PCWSTR, PCWSTR);
+WINSETUPAPI BOOL WINAPI DoesUserHavePrivilege(PCWSTR);
WINSETUPAPI PWSTR WINAPI DuplicateString(PCWSTR);
+WINSETUPAPI BOOL WINAPI EnablePrivilege(PCWSTR, BOOL);
+WINSETUPAPI BOOL WINAPI FileExists(PCWSTR, PWIN32_FIND_DATAW);
+WINSETUPAPI DWORD WINAPI GetSetFileTimestamp(PCWSTR, PFILETIME,
PFILETIME, PFILETIME, BOOLEAN);
+WINSETUPAPI BOOL WINAPI GetVersionInfoFromImage(LPWSTR,
PULARGE_INTEGER, LPWORD);
WINSETUPAPI BOOL WINAPI IsUserAdmin(VOID);
+WINSETUPAPI PWSTR WINAPI MultiByteToUnicode(PCSTR, UINT);
WINSETUPAPI VOID WINAPI MyFree(PVOID);
+WINSETUPAPI PWSTR WINAPI MyGetFileTitle(PCWSTR);
WINSETUPAPI PVOID WINAPI MyMalloc(DWORD);
WINSETUPAPI PVOID WINAPI MyRealloc(PVOID, DWORD);
+WINSETUPAPI DWORD WINAPI OpenAndMapForRead(PCWSTR, PDWORD, PHANDLE,
PHANDLE, PVOID*);
WINSETUPAPI LONG WINAPI QueryRegistryValue(HKEY, PCWSTR, PBYTE*,
PDWORD, PDWORD);
+WINSETUPAPI DWORD WINAPI RetreiveFileSecurity(PCWSTR,
PSECURITY_DESCRIPTOR*);
WINSETUPAPI BOOL WINAPI
SetupAddInstallSectionToDiskSpaceListA(HDSKSPC,HINF,HINF,PCSTR,PVOID,UIN
T);
WINSETUPAPI BOOL WINAPI
SetupAddInstallSectionToDiskSpaceListW(HDSKSPC,HINF,HINF,PCWSTR,PVOID,UI
NT);
@@ -1332,6 +1346,8 @@
WINSETUPAPI VOID WINAPI SetupTermDefaultQueueCallback(PVOID);
WINSETUPAPI BOOL WINAPI SetupTerminateFileLog(HSPFILELOG);
+WINSETUPAPI DWORD WINAPI StampFileSecurity(PCWSTR,
PSECURITY_DESCRIPTOR);
+
WINSETUPAPI DWORD WINAPI StringTableAddString(HSTRING_TABLE, LPWSTR,
DWORD);
WINSETUPAPI VOID WINAPI StringTableDestroy(HSTRING_TABLE);
WINSETUPAPI HSTRING_TABLE WINAPI StringTableInitialize(VOID);
@@ -1340,7 +1356,11 @@
WINSETUPAPI BOOL WINAPI StringTableStringFromIdEx(HSTRING_TABLE,
DWORD, LPWSTR, LPDWORD);
WINSETUPAPI VOID WINAPI StringTableTrim(HSTRING_TABLE);
+WINSETUPAPI DWORD WINAPI TakeOwnershipOfFile(PCWSTR);
+WINSETUPAPI PSTR WINAPI UnicodeToMultiByte(PCWSTR lpUnicodeStr, UINT
uCodePage);
+WINSETUPAPI BOOL WINAPI UnmapAndCloseFile(HANDLE, HANDLE, PVOID);
+
/* for backward compatability */
#define SetupDiCreateInterfaceDeviceW SetupDiCreateDeviceInterfaceW
#define SetupDiCreateInterfaceDeviceRegKeyW
SetupDiCreateDeviceInterfaceRegKeyW