Added stubs for NeedRebootInit and NeedReboot.

Added implementations for GetVersionFromFile and
GetVersionFromFileEx.
Added test for GetVersionFromFile.
This commit is contained in:
Robert Reif 2005-01-20 20:03:13 +00:00 committed by Alexandre Julliard
parent fccfcbf7ba
commit 97199823bf
9 changed files with 159 additions and 6 deletions

3
configure vendored

File diff suppressed because one or more lines are too long

View File

@ -1511,6 +1511,7 @@ dlls/Makefile
dlls/advapi32/Makefile
dlls/advapi32/tests/Makefile
dlls/advpack/Makefile
dlls/advpack/tests/Makefile
dlls/amstream/Makefile
dlls/atl/Makefile
dlls/avicap32/Makefile

View File

@ -3,13 +3,15 @@ TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = advpack.dll
IMPORTS = setupapi user32 kernel32 ntdll
IMPORTS = setupapi version user32 kernel32 ntdll
EXTRALIBS = $(LIBUNICODE)
C_SRCS = \
advpack.c \
reg.c
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:

View File

@ -24,6 +24,8 @@
#include "winbase.h"
#include "winuser.h"
#include "winreg.h"
#include "winver.h"
#include "winnls.h"
#include "setupapi.h"
#include "advpub.h"
#include "wine/debug.h"
@ -96,3 +98,77 @@ BOOL WINAPI DoInfInstall(const SETUPCOMMAND_PARAMS *setup)
return ret;
}
/***********************************************************************
* NeedRebootInit (ADVPACK.@)
*/
DWORD WINAPI NeedRebootInit(VOID)
{
FIXME("() stub!\n");
return 0;
}
/***********************************************************************
* NeedReboot (ADVPACK.@)
*/
BOOL WINAPI NeedReboot(DWORD dwRebootCheck)
{
FIXME("(0x%08lx) stub!\n", dwRebootCheck);
return FALSE;
}
/***********************************************************************
* GetVersionFromFile (ADVPACK.@)
*/
HRESULT WINAPI GetVersionFromFile( LPSTR Filename, LPDWORD MajorVer,
LPDWORD MinorVer, BOOL Version )
{
TRACE("(%s, %p, %p, %d)\n", Filename, MajorVer, MinorVer, Version);
return GetVersionFromFileEx(Filename, MajorVer, MinorVer, Version);
}
/***********************************************************************
* GetVersionFromFileEx (ADVPACK.@)
*/
HRESULT WINAPI GetVersionFromFileEx( LPSTR lpszFilename, LPDWORD pdwMSVer,
LPDWORD pdwLSVer, BOOL bVersion )
{
DWORD hdl, retval;
LPVOID pVersionInfo;
BOOL boolret;
VS_FIXEDFILEINFO *pFixedVersionInfo;
UINT uiLength;
TRACE("(%s, %p, %p, %d)\n", lpszFilename, pdwMSVer, pdwLSVer, bVersion);
if (bVersion)
{
retval = GetFileVersionInfoSizeA(lpszFilename, &hdl);
if (retval == 0 || hdl != 0)
return E_FAIL;
pVersionInfo = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, retval);
if (pVersionInfo == NULL)
return E_FAIL;
GetFileVersionInfoA( lpszFilename, 0, retval, pVersionInfo);
boolret = VerQueryValueA(pVersionInfo, "\\",
(LPVOID) &pFixedVersionInfo, &uiLength);
HeapFree(GetProcessHeap(), 0, pVersionInfo);
if (boolret)
{
*pdwMSVer = pFixedVersionInfo->dwFileVersionMS;
*pdwLSVer = pFixedVersionInfo->dwFileVersionLS;
}
else
return E_FAIL;
}
else
{
*pdwMSVer = GetUserDefaultUILanguage();
*pdwLSVer = GetACP();
}
return S_OK;
}

View File

@ -10,13 +10,13 @@
@ stub FileSaveMarkNotExist
@ stub FileSaveRestore
@ stub FileSaveRestoreOnINF
@ stub GetVersionFromFile
@ stub GetVersionFromFileEx
@ stdcall GetVersionFromFile(str ptr ptr long)
@ stdcall GetVersionFromFileEx(str ptr ptr long)
@ stub IsNTAdmin
@ stdcall LaunchINFSection(ptr ptr str long)
@ stdcall LaunchINFSectionEx(ptr ptr str long)
@ stub NeedReboot
@ stub NeedRebootInit
@ stdcall NeedReboot(long)
@ stdcall NeedRebootInit()
@ stub OpenINFEngine
@ stub RebootCheckOnInstall
@ stdcall RegInstall(ptr str ptr)

View File

@ -0,0 +1,3 @@
Makefile
advpack.ok
testlist.c

View File

@ -0,0 +1,13 @@
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../../..
SRCDIR = @srcdir@
VPATH = @srcdir@
TESTDLL = advpack.dll
IMPORTS = advpack user32 kernel32
CTESTS = \
advpack.c
@MAKE_TEST_RULES@
### Dependencies:

View File

@ -0,0 +1,53 @@
/*
* Unit tests for advpack.dll
*
* Copyright (C) 2005 Robert Reif
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define NONAMELESSSTRUCT
#define NONAMELESSUNION
#include <windows.h>
#include "wine/test.h"
#include "advpub.h"
static void version_test()
{
HRESULT hr;
DWORD major, minor;
major = minor = 0;
hr = GetVersionFromFile("kernel32.dll", &major, &minor, FALSE);
ok (hr == S_OK, "GetVersionFromFileEx(kernel32.dll) failed, returned "
"0x%08lx\n", hr);
trace("kernel32.dll Language ID: 0x%08lx, Codepage ID: 0x%08lx\n",
major, minor);
major = minor = 0;
hr = GetVersionFromFile("kernel32.dll", &major, &minor, TRUE);
ok (hr == S_OK, "GetVersionFromFileEx(kernel32.dll) failed, returned "
"0x%08lx\n", hr);
trace("kernel32.dll version: %d.%d.%d.%d\n", HIWORD(major), LOWORD(major),
HIWORD(minor), LOWORD(minor));
}
START_TEST(advpack)
{
version_test();
}

View File

@ -38,7 +38,11 @@ typedef struct _StrTable {
typedef const STRTABLE CSTRTABLE;
typedef CSTRTABLE *LPCSTRTABLE;
DWORD WINAPI NeedRebootInit(VOID);
BOOL WINAPI NeedReboot(DWORD dwRebootCheck);
HRESULT WINAPI RegInstall(HMODULE hm, LPCSTR pszSection, LPCSTRTABLE pstTable);
HRESULT WINAPI GetVersionFromFile(LPSTR lpszFilename, LPDWORD pdwMSVer, LPDWORD pdwLSVer, BOOL bVersion);
HRESULT WINAPI GetVersionFromFileEx(LPSTR lpszFilename, LPDWORD pdwMSVer, LPDWORD pdwLSVer, BOOL bVersion);
#ifdef __cplusplus
}