Started some basic work on the more or less undocumented SETUPX
functions.
This commit is contained in:
parent
0fc9d151fd
commit
5644cdc1f5
|
@ -8,6 +8,7 @@ ALTNAMES = setupx
|
||||||
IMPORTS = advapi32 kernel32
|
IMPORTS = advapi32 kernel32
|
||||||
|
|
||||||
C_SRCS = \
|
C_SRCS = \
|
||||||
|
infparse.c \
|
||||||
setupx_main.c \
|
setupx_main.c \
|
||||||
stubs.c
|
stubs.c
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,93 @@
|
||||||
|
/*
|
||||||
|
* SetupX .inf file parsing functions
|
||||||
|
*
|
||||||
|
* FIXME: return values ???
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "debugtools.h"
|
||||||
|
#include "windef.h"
|
||||||
|
#include "winbase.h"
|
||||||
|
#include "wine/winbase16.h"
|
||||||
|
#include "setupx16.h"
|
||||||
|
|
||||||
|
DEFAULT_DEBUG_CHANNEL(setupx);
|
||||||
|
|
||||||
|
WORD InfNumEntries = 0;
|
||||||
|
INF_HANDLE *InfList = NULL;
|
||||||
|
|
||||||
|
#define GET_INF_ENTRY(x) ((InfList - x)/4)
|
||||||
|
|
||||||
|
RETERR16 IP_OpenInf(LPCSTR lpInfFileName, HINF16 *lphInf)
|
||||||
|
{
|
||||||
|
HFILE16 hFile = _lopen16(lpInfFileName, OF_READ);
|
||||||
|
|
||||||
|
if (!lphInf)
|
||||||
|
return IP_ERROR;
|
||||||
|
|
||||||
|
if (hFile != HFILE_ERROR16)
|
||||||
|
{
|
||||||
|
InfList = HeapReAlloc(GetProcessHeap(), 0, InfList, InfNumEntries+1);
|
||||||
|
InfList[InfNumEntries].hInfFile = hFile;
|
||||||
|
InfList[InfNumEntries].lpInfFileName = lpInfFileName;
|
||||||
|
InfNumEntries++;
|
||||||
|
*lphInf = &InfList[InfNumEntries-1] - InfList;
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
*lphInf = 0xffff;
|
||||||
|
return ERR_IP_INVALID_INFFILE;
|
||||||
|
}
|
||||||
|
|
||||||
|
LPCSTR IP_GetFileName(HINF16 hInf)
|
||||||
|
{
|
||||||
|
if ((hInf <= (InfNumEntries*sizeof(INF_HANDLE *)))
|
||||||
|
&& ((hInf & 3) == 0)) /* aligned ? */
|
||||||
|
{
|
||||||
|
return InfList[hInf/4].lpInfFileName;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
RETERR16 IP_CloseInf(HINF16 hInf)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
HFILE16 res = ERR_IP_INVALID_HINF;
|
||||||
|
|
||||||
|
if ((hInf <= (InfNumEntries*sizeof(INF_HANDLE *)))
|
||||||
|
&& ((hInf & 3) == 0)) /* aligned ? */
|
||||||
|
{
|
||||||
|
_lclose16(InfList[hInf/4].hInfFile);
|
||||||
|
res = OK;
|
||||||
|
for (i=hInf/4; i < InfNumEntries-1; i++)
|
||||||
|
InfList[i] = InfList[i+1];
|
||||||
|
InfNumEntries--;
|
||||||
|
InfList = HeapReAlloc(GetProcessHeap(), 0, InfList, InfNumEntries);
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* IpOpen16
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
RETERR16 WINAPI IpOpen16(LPCSTR lpInfFileName, HINF16 *lphInf)
|
||||||
|
{
|
||||||
|
TRACE("('%s', %p)\n", lpInfFileName, lphInf);
|
||||||
|
return IP_OpenInf(lpInfFileName, lphInf);
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* IpClose16
|
||||||
|
*/
|
||||||
|
RETERR16 WINAPI IpClose16(HINF16 hInf)
|
||||||
|
{
|
||||||
|
return IP_CloseInf(hInf);
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* IpGetProfileString16
|
||||||
|
*/
|
||||||
|
RETERR16 WINAPI IpGetProfileString16(HINF16 hInf, LPCSTR section, LPCSTR entry, LPSTR buffer, WORD buflen)
|
||||||
|
{
|
||||||
|
GetPrivateProfileString16(section, entry, "", buffer, buflen, IP_GetFileName(hInf));
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -3,9 +3,9 @@ type win16
|
||||||
owner setupapi
|
owner setupapi
|
||||||
|
|
||||||
1 stub WEP
|
1 stub WEP
|
||||||
2 stub IPOPEN
|
2 pascal16 IpOpen(str ptr) IpOpen16
|
||||||
3 stub IPOPENAPPEND
|
3 stub IPOPENAPPEND
|
||||||
4 stub IPCLOSE
|
4 pascal16 IpClose(word) IpClose16
|
||||||
5 stub IPGETLONGFIELD
|
5 stub IPGETLONGFIELD
|
||||||
6 stub IPGETSTRINGFIELD
|
6 stub IPGETSTRINGFIELD
|
||||||
7 stub IPFINDFIRSTLINE
|
7 stub IPFINDFIRSTLINE
|
||||||
|
@ -39,7 +39,7 @@ owner setupapi
|
||||||
35 stub CTLFINDLDD
|
35 stub CTLFINDLDD
|
||||||
36 stub CTLADDLDD
|
36 stub CTLADDLDD
|
||||||
37 stub CTLDELLDD
|
37 stub CTLDELLDD
|
||||||
38 stub CTLGETLDDPATH
|
38 pascal16 CtlGetLddPath(word ptr) CtlGetLddPath16
|
||||||
39 stub SUREGCLOSEKEY
|
39 stub SUREGCLOSEKEY
|
||||||
40 stub SUREGCREATEKEY
|
40 stub SUREGCREATEKEY
|
||||||
41 stub SUREGDELETEKEY
|
41 stub SUREGDELETEKEY
|
||||||
|
@ -48,7 +48,7 @@ owner setupapi
|
||||||
44 stub SUREGENUMVALUE
|
44 stub SUREGENUMVALUE
|
||||||
45 stub SUREGFLUSH
|
45 stub SUREGFLUSH
|
||||||
46 stub SUREGINIT
|
46 stub SUREGINIT
|
||||||
47 pascal SUregOpenKey(word str ptr) SURegOpenKey
|
47 pascal SURegOpenKey(word str ptr) SURegOpenKey
|
||||||
48 stub SUREGQUERYVALUE
|
48 stub SUREGQUERYVALUE
|
||||||
49 stub SUREGQUERYVALUE16
|
49 stub SUREGQUERYVALUE16
|
||||||
50 pascal SURegQueryValueEx(long str ptr ptr ptr ptr) SURegQueryValueEx
|
50 pascal SURegQueryValueEx(long str ptr ptr ptr ptr) SURegQueryValueEx
|
||||||
|
@ -64,9 +64,9 @@ owner setupapi
|
||||||
63 stub SURPLSETUP
|
63 stub SURPLSETUP
|
||||||
64 stub SUSTORELDIDPATH
|
64 stub SUSTORELDIDPATH
|
||||||
65 stub WILDCARDSTRCMPI
|
65 stub WILDCARDSTRCMPI
|
||||||
101 stub GENINSTALL
|
101 pascal16 GenInstall(word str word) GenInstall16
|
||||||
102 stub GENWININITRENAME
|
102 stub GENWININITRENAME
|
||||||
103 stub GENFORMSTRWITHOUTPLACEHOLDERS
|
103 pascal GenFormStrWithoutPlaceHolders(str str word) GenFormStrWithoutPlaceHolders16
|
||||||
104 stub SETUPX
|
104 stub SETUPX
|
||||||
105 stub CFGSETUPMERGE
|
105 stub CFGSETUPMERGE
|
||||||
106 stub INITDEPENDANTLDIDS
|
106 stub INITDEPENDANTLDIDS
|
||||||
|
@ -113,8 +113,8 @@ owner setupapi
|
||||||
160 stub SXUPDATEDS
|
160 stub SXUPDATEDS
|
||||||
170 stub SUSETMEM
|
170 stub SUSETMEM
|
||||||
171 stub WRITEDMFBOOTDATA
|
171 stub WRITEDMFBOOTDATA
|
||||||
200 stub VCPOPEN
|
200 pascal vcpOpen(ptr str) vcpOpen16
|
||||||
201 stub VCPCLOSE
|
201 pascal vcpClose(word word word) vcpClose16
|
||||||
202 stub VCPDEFCALLBACKPROC
|
202 stub VCPDEFCALLBACKPROC
|
||||||
203 stub VCPENUMFILES
|
203 stub VCPENUMFILES
|
||||||
204 stub VCPQUEUERENAME
|
204 stub VCPQUEUERENAME
|
||||||
|
@ -123,7 +123,7 @@ owner setupapi
|
||||||
207 stub VSMSTRINGADD
|
207 stub VSMSTRINGADD
|
||||||
208 stub VSMGETSTRINGRAWNAME
|
208 stub VSMGETSTRINGRAWNAME
|
||||||
209 stub IPSAVERESTOREPOSITION
|
209 stub IPSAVERESTOREPOSITION
|
||||||
210 stub IPGETPROFILESTRING
|
210 pascal16 IpGetProfileString(word str str ptr word) IpGetProfileString16
|
||||||
211 stub IPOPENEX
|
211 stub IPOPENEX
|
||||||
212 stub IPOPENAPPENDEX
|
212 stub IPOPENAPPENDEX
|
||||||
213 stub VCPUICALLBACKPROC
|
213 stub VCPUICALLBACKPROC
|
||||||
|
@ -204,7 +204,7 @@ owner setupapi
|
||||||
504 stub SXOCPAGEDLG
|
504 stub SXOCPAGEDLG
|
||||||
506 stub SXOCBATCHSETTINGS
|
506 stub SXOCBATCHSETTINGS
|
||||||
507 stub SXOCFIXNEEDS
|
507 stub SXOCFIXNEEDS
|
||||||
508 stub CTLSETLDDPATH
|
508 pascal16 CtlSetLddPath(word str) CtlSetLddPath16
|
||||||
509 stub SXCALLOCPROC
|
509 stub SXCALLOCPROC
|
||||||
520 stub DIBUILDCLASSDRVINFOLIST
|
520 stub DIBUILDCLASSDRVINFOLIST
|
||||||
521 stub DIBUILDCOMPATDRVINFOLIST
|
521 stub DIBUILDCOMPATDRVINFOLIST
|
||||||
|
|
|
@ -0,0 +1,42 @@
|
||||||
|
#ifndef __WINE_SETUPX16_H
|
||||||
|
#define __WINE_SETUPX16_H
|
||||||
|
|
||||||
|
#include "wine/windef16.h"
|
||||||
|
|
||||||
|
typedef UINT16 HINF16;
|
||||||
|
typedef UINT16 LOGDISKID16;
|
||||||
|
|
||||||
|
/* error codes stuff */
|
||||||
|
|
||||||
|
typedef UINT16 RETERR16;
|
||||||
|
#define OK 0
|
||||||
|
#define IP_ERROR (UINT16)100
|
||||||
|
|
||||||
|
enum _IP_ERR {
|
||||||
|
ERR_IP_INVALID_FILENAME = IP_ERROR+1,
|
||||||
|
ERR_IP_ALLOC_ERR,
|
||||||
|
ERR_IP_INVALID_SECT_NAME,
|
||||||
|
ERR_IP_OUT_OF_HANDLES,
|
||||||
|
ERR_IP_INF_NOT_FOUND,
|
||||||
|
ERR_IP_INVALID_INFFILE,
|
||||||
|
ERR_IP_INVALID_HINF,
|
||||||
|
ERR_IP_INVALID_FIELD,
|
||||||
|
ERR_IP_SECTION_NOT_FOUND,
|
||||||
|
ERR_IP_END_OF_SECTION,
|
||||||
|
ERR_IP_PROFILE_NOT_FOUND,
|
||||||
|
ERR_IP_LINE_NOT_FOUND,
|
||||||
|
ERR_IP_FILEREAD,
|
||||||
|
ERR_IP_TOOMANYINFFILES,
|
||||||
|
ERR_IP_INVALID_SAVERESTORE,
|
||||||
|
ERR_IP_INVALID_INFTYPE
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
HFILE16 hInfFile;
|
||||||
|
LPCSTR lpInfFileName;
|
||||||
|
} INF_HANDLE;
|
||||||
|
|
||||||
|
extern INF_HANDLE *InfList;
|
||||||
|
extern WORD InfNumEntries;
|
||||||
|
|
||||||
|
#endif /* __WINE_SETUPX16_H */
|
|
@ -1,13 +1,23 @@
|
||||||
/*
|
/*
|
||||||
* SETUPX library
|
* SETUPX library
|
||||||
*
|
*
|
||||||
* Copyright 1998 Andreas Mohr
|
* Copyright 1998,2000 Andreas Mohr
|
||||||
*
|
*
|
||||||
* FIXME: Rather non-functional functions for now.
|
* FIXME: Rather non-functional functions for now.
|
||||||
|
*
|
||||||
|
* See:
|
||||||
|
* http://www.geocities.com/SiliconValley/Network/5317/drivers.html
|
||||||
|
* http://www.microsoft.com/ddk/ddkdocs/win98ddk/devinst_12uw.htm
|
||||||
|
* DDK: setupx.h
|
||||||
|
* http://mmatrix.tripod.com/customsystemfolder/infsysntaxfull.html
|
||||||
|
* http://www.rdrop.com/~cary/html/inf_faq.html
|
||||||
|
*
|
||||||
|
* Stuff tested with rs405deu.exe (German Acroread 4.05 setup)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "winreg.h"
|
#include "winreg.h"
|
||||||
#include "wine/winuser16.h"
|
#include "wine/winuser16.h"
|
||||||
|
#include "setupx16.h"
|
||||||
#include "debugtools.h"
|
#include "debugtools.h"
|
||||||
|
|
||||||
DEFAULT_DEBUG_CHANNEL(setupx);
|
DEFAULT_DEBUG_CHANNEL(setupx);
|
||||||
|
@ -48,5 +58,48 @@ DWORD WINAPI SURegQueryValueEx( HKEY hkey, LPSTR lpszValueName,
|
||||||
DWORD WINAPI InstallHinfSection16( HWND16 hwnd, HINSTANCE16 hinst, LPCSTR lpszCmdLine, INT16 nCmdShow)
|
DWORD WINAPI InstallHinfSection16( HWND16 hwnd, HINSTANCE16 hinst, LPCSTR lpszCmdLine, INT16 nCmdShow)
|
||||||
{
|
{
|
||||||
FIXME("(%04x, %04x, %s, %d), stub.\n", hwnd, hinst, lpszCmdLine, nCmdShow);
|
FIXME("(%04x, %04x, %s, %d), stub.\n", hwnd, hinst, lpszCmdLine, nCmdShow);
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* GenFormStrWithoutPlaceholders
|
||||||
|
*
|
||||||
|
* Any real docu ?
|
||||||
|
*/
|
||||||
|
void WINAPI GenFormStrWithoutPlaceHolders16( LPSTR szDst, LPCSTR szSrc, HINF16 hInf)
|
||||||
|
{
|
||||||
|
FIXME("(%p, '%s', %04x), stub.\n", szDst, szSrc, hInf);
|
||||||
|
strcpy(szDst, szSrc);
|
||||||
|
}
|
||||||
|
|
||||||
|
RETERR16 WINAPI CtlGetLddPath16(LOGDISKID16 ldid, LPSTR szPath)
|
||||||
|
{
|
||||||
|
FIXME("(%04x, %p), stub.\n", ldid, szPath);
|
||||||
|
strcpy(szPath, "FIXME_BogusLddPath");
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
RETERR16 WINAPI CtlSetLddPath16(LOGDISKID16 ldid, LPSTR szPath)
|
||||||
|
{
|
||||||
|
FIXME("(%04x, '%s'), stub.\n", ldid, szPath);
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
RETERR16 WINAPI vcpOpen16(LPWORD p1, LPWORD p2)
|
||||||
|
{
|
||||||
|
FIXME("(%p, %p, stub.\n", p1, p2);
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
RETERR16 WINAPI vcpClose16(WORD w1, WORD w2, WORD w3)
|
||||||
|
{
|
||||||
|
FIXME("(%04x, %04x %04x), stub.\n", w1, w2, w3);
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
RETERR16 WINAPI GenInstall16(HINF16 hInfFile, LPCSTR szInstallSection, WORD wFlags)
|
||||||
|
{
|
||||||
|
FIXME("(%04x, '%s', %04x), stub. This doesn't install anything yet !\n", hInfFile, szInstallSection, wFlags);
|
||||||
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue