mirror of
https://github.com/reactos/reactos.git
synced 2025-05-07 18:56:48 +00:00
more syncing of setupapi
svn path=/trunk/; revision=13205
This commit is contained in:
parent
7d3a25e1cc
commit
c6bd59c308
8 changed files with 49 additions and 43 deletions
|
@ -18,9 +18,6 @@
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
#include "wine/port.h"
|
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
#include "windef.h"
|
#include "windef.h"
|
||||||
|
@ -120,10 +117,10 @@ BOOL WINAPI SetupQuerySpaceRequiredOnDriveA(HDSKSPC DiskSpace,
|
||||||
PVOID Reserved1, UINT Reserved2)
|
PVOID Reserved1, UINT Reserved2)
|
||||||
{
|
{
|
||||||
WCHAR driveW[20];
|
WCHAR driveW[20];
|
||||||
int i;
|
unsigned int i;
|
||||||
LPDISKSPACELIST list = (LPDISKSPACELIST)DiskSpace;
|
LPDISKSPACELIST list = (LPDISKSPACELIST)DiskSpace;
|
||||||
BOOL rc = FALSE;
|
BOOL rc = FALSE;
|
||||||
WCHAR bkslsh[]= {'\\',0};
|
static const WCHAR bkslsh[]= {'\\',0};
|
||||||
|
|
||||||
MultiByteToWideChar(CP_ACP,0,DriveSpec,-1,driveW,20);
|
MultiByteToWideChar(CP_ACP,0,DriveSpec,-1,driveW,20);
|
||||||
|
|
||||||
|
|
|
@ -342,7 +342,7 @@ static BOOL do_reg_operation( HKEY hkey, const WCHAR *value, INFCONTEXT *context
|
||||||
{
|
{
|
||||||
TRACE( "setting value %s to %s\n", debugstr_w(value), debugstr_w(str) );
|
TRACE( "setting value %s to %s\n", debugstr_w(value), debugstr_w(str) );
|
||||||
if (str) RegSetValueExW( hkey, value, 0, type, (BYTE *)str, size * sizeof(WCHAR) );
|
if (str) RegSetValueExW( hkey, value, 0, type, (BYTE *)str, size * sizeof(WCHAR) );
|
||||||
else RegSetValueExW( hkey, value, 0, type, (BYTE *)&empty, sizeof(WCHAR) );
|
else RegSetValueExW( hkey, value, 0, type, (const BYTE *)&empty, sizeof(WCHAR) );
|
||||||
}
|
}
|
||||||
HeapFree( GetProcessHeap(), 0, str );
|
HeapFree( GetProcessHeap(), 0, str );
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -162,15 +162,14 @@ static void *grow_array( void *array, unsigned int *count, size_t elem )
|
||||||
if (new_count < 32) new_count = 32;
|
if (new_count < 32) new_count = 32;
|
||||||
|
|
||||||
if (array)
|
if (array)
|
||||||
new_array = HeapReAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, array, new_count * elem );
|
new_array = HeapReAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, array, new_count * elem );
|
||||||
else
|
else
|
||||||
new_array = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, new_count * elem );
|
new_array = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, new_count * elem );
|
||||||
|
|
||||||
if (new_array)
|
if (new_array)
|
||||||
*count = new_count;
|
*count = new_count;
|
||||||
else
|
else
|
||||||
if (array)
|
HeapFree( GetProcessHeap(), 0, array );
|
||||||
HeapFree( GetProcessHeap(), 0, array );
|
|
||||||
return new_array;
|
return new_array;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,7 +177,7 @@ static void *grow_array( void *array, unsigned int *count, size_t elem )
|
||||||
/* find a section by name */
|
/* find a section by name */
|
||||||
static int find_section( struct inf_file *file, const WCHAR *name )
|
static int find_section( struct inf_file *file, const WCHAR *name )
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = 0; i < file->nb_sections; i++)
|
for (i = 0; i < file->nb_sections; i++)
|
||||||
if (!strcmpiW( name, file->sections[i]->name )) return i;
|
if (!strcmpiW( name, file->sections[i]->name )) return i;
|
||||||
|
@ -313,7 +312,8 @@ static const WCHAR *get_string_subst( struct inf_file *file, const WCHAR *str, u
|
||||||
struct section *strings_section;
|
struct section *strings_section;
|
||||||
struct line *line;
|
struct line *line;
|
||||||
struct field *field;
|
struct field *field;
|
||||||
int i, dirid;
|
unsigned int i;
|
||||||
|
int dirid;
|
||||||
WCHAR *dirid_str, *end;
|
WCHAR *dirid_str, *end;
|
||||||
const WCHAR *ret = NULL;
|
const WCHAR *ret = NULL;
|
||||||
|
|
||||||
|
@ -1170,9 +1170,7 @@ HINF WINAPI SetupOpenMasterInf( VOID )
|
||||||
WCHAR Buffer[MAX_PATH];
|
WCHAR Buffer[MAX_PATH];
|
||||||
|
|
||||||
GetWindowsDirectoryW( Buffer, MAX_PATH );
|
GetWindowsDirectoryW( Buffer, MAX_PATH );
|
||||||
|
strcatW( Buffer, Layout );
|
||||||
wcscat( Buffer, Layout );
|
|
||||||
|
|
||||||
return SetupOpenInfFileW( Buffer, NULL, INF_STYLE_WIN4, NULL);
|
return SetupOpenInfFileW( Buffer, NULL, INF_STYLE_WIN4, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1184,7 +1182,7 @@ HINF WINAPI SetupOpenMasterInf( VOID )
|
||||||
void WINAPI SetupCloseInfFile( HINF hinf )
|
void WINAPI SetupCloseInfFile( HINF hinf )
|
||||||
{
|
{
|
||||||
struct inf_file *file = hinf;
|
struct inf_file *file = hinf;
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = 0; i < file->nb_sections; i++) HeapFree( GetProcessHeap(), 0, file->sections[i] );
|
for (i = 0; i < file->nb_sections; i++) HeapFree( GetProcessHeap(), 0, file->sections[i] );
|
||||||
HeapFree( GetProcessHeap(), 0, file->src_root );
|
HeapFree( GetProcessHeap(), 0, file->src_root );
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* Many useful traces are commented in code, uncomment them if you have
|
* Many useful traces are commented in code, uncomment them if you have
|
||||||
* trouble and run with --debugmsg +setupapi
|
* trouble and run with WINEDEBUG=+setupapi
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -39,8 +39,8 @@
|
||||||
#include "fdi.h"
|
#include "fdi.h"
|
||||||
#include "wine/unicode.h"
|
#include "wine/unicode.h"
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include "fcntl.h"
|
||||||
#include <share.h>
|
#include "share.h"
|
||||||
|
|
||||||
#include "wine/debug.h"
|
#include "wine/debug.h"
|
||||||
|
|
||||||
|
@ -312,7 +312,7 @@ static INT_PTR sc_FNNOTIFY_A(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin)
|
||||||
if (err == FILEOP_DOIT) {
|
if (err == FILEOP_DOIT) {
|
||||||
TRACE(" Callback specified filename: %s\n", debugstr_a(&(fici.FullTargetName[0])));
|
TRACE(" Callback specified filename: %s\n", debugstr_a(&(fici.FullTargetName[0])));
|
||||||
if (!fici.FullTargetName[0]) {
|
if (!fici.FullTargetName[0]) {
|
||||||
WARN(" Empty return string causing abort.");
|
WARN(" Empty return string causing abort.\n");
|
||||||
SetLastError(ERROR_PATH_NOT_FOUND);
|
SetLastError(ERROR_PATH_NOT_FOUND);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -597,11 +597,11 @@ BOOL WINAPI SetupIterateCabinetA(PCSTR CabinetFile, DWORD Reserved,
|
||||||
BOOL WINAPI SetupIterateCabinetW(PCWSTR CabinetFile, DWORD Reserved,
|
BOOL WINAPI SetupIterateCabinetW(PCWSTR CabinetFile, DWORD Reserved,
|
||||||
PSP_FILE_CALLBACK_W MsgHandler, PVOID Context)
|
PSP_FILE_CALLBACK_W MsgHandler, PVOID Context)
|
||||||
{
|
{
|
||||||
CHAR CabinetFile_A[MAX_PATH];
|
CHAR pszCabinet[MAX_PATH], pszCabPath[MAX_PATH];
|
||||||
unsigned int len;
|
UINT len;
|
||||||
SC_HSC_W my_hsc;
|
SC_HSC_W my_hsc;
|
||||||
ERF erf;
|
ERF erf;
|
||||||
CHAR pszCabinet[MAX_PATH], pszCabPath[MAX_PATH], *p;
|
WCHAR pszCabPathW[MAX_PATH], *p;
|
||||||
DWORD fpnsize;
|
DWORD fpnsize;
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
|
|
||||||
|
@ -612,36 +612,33 @@ BOOL WINAPI SetupIterateCabinetW(PCWSTR CabinetFile, DWORD Reserved,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (!CabinetFile) return FALSE;
|
if (!CabinetFile) return FALSE;
|
||||||
if (!WideCharToMultiByte(CP_ACP, 0, CabinetFile, -1, CabinetFile_A, MAX_PATH, 0, 0))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
memset(&my_hsc, 0, sizeof(SC_HSC_W));
|
memset(&my_hsc, 0, sizeof(SC_HSC_W));
|
||||||
pszCabinet[0] = '\0';
|
|
||||||
pszCabPath[0] = '\0';
|
|
||||||
|
|
||||||
fpnsize = GetFullPathNameA(CabinetFile_A, MAX_PATH, &(pszCabPath[0]), &p);
|
fpnsize = GetFullPathNameW(CabinetFile, MAX_PATH, pszCabPathW, &p);
|
||||||
if (fpnsize > MAX_PATH) {
|
if (fpnsize > MAX_PATH) {
|
||||||
SetLastError(ERROR_BAD_PATHNAME);
|
SetLastError(ERROR_BAD_PATHNAME);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p) {
|
if (p) {
|
||||||
strcpy(pszCabinet, p);
|
strcpyW(my_hsc.most_recent_cabinet_name, p);
|
||||||
*p = '\0';
|
*p = 0;
|
||||||
|
len = WideCharToMultiByte(CP_ACP, 0, pszCabPathW, -1, pszCabPath,
|
||||||
|
MAX_PATH, 0, 0);
|
||||||
|
if (!len) return FALSE;
|
||||||
} else {
|
} else {
|
||||||
strcpy(pszCabinet, CabinetFile_A);
|
strcpyW(my_hsc.most_recent_cabinet_name, CabinetFile);
|
||||||
pszCabPath[0] = '\0';
|
pszCabPath[0] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE("path: %s, cabfile: %s\n", debugstr_a(pszCabPath), debugstr_a(pszCabinet));
|
len = WideCharToMultiByte(CP_ACP, 0, my_hsc.most_recent_cabinet_name, -1,
|
||||||
|
pszCabinet, MAX_PATH, 0, 0);
|
||||||
|
if (!len) return FALSE;
|
||||||
|
|
||||||
|
TRACE("path: %s, cabfile: %s\n",
|
||||||
|
debugstr_a(pszCabPath), debugstr_a(pszCabinet));
|
||||||
|
|
||||||
/* remember the cabinet name */
|
|
||||||
len = 1 + MultiByteToWideChar(CP_ACP, 0, pszCabinet, -1,
|
|
||||||
&(my_hsc.most_recent_cabinet_name[0]), MAX_PATH);
|
|
||||||
if (len > MAX_PATH)
|
|
||||||
return FALSE;
|
|
||||||
else if (len <= 1)
|
|
||||||
my_hsc.most_recent_cabinet_name[0] = '\0';
|
|
||||||
my_hsc.magic = SC_HSC_W_MAGIC;
|
my_hsc.magic = SC_HSC_W_MAGIC;
|
||||||
my_hsc.msghandler = MsgHandler;
|
my_hsc.msghandler = MsgHandler;
|
||||||
my_hsc.context = Context;
|
my_hsc.context = Context;
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
#include "wine/windef16.h"
|
#include "wine/windef16.h"
|
||||||
|
|
||||||
|
typedef UINT16 DI_FUNCTION16;
|
||||||
typedef UINT16 HINF16;
|
typedef UINT16 HINF16;
|
||||||
typedef UINT16 LOGDISKID16;
|
typedef UINT16 LOGDISKID16;
|
||||||
typedef UINT16 VHSTR;
|
typedef UINT16 VHSTR;
|
||||||
|
|
|
@ -476,9 +476,9 @@ RETERR16 WINAPI CtlSetLdd16(LPLOGDISKDESC pldd)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pCurrLDD = pCurr->pldd;
|
pCurrLDD = pCurr->pldd;
|
||||||
if (pCurrLDD->pszPath) HeapFree(heap, 0, pCurrLDD->pszPath);
|
HeapFree(heap, 0, pCurrLDD->pszPath);
|
||||||
if (pCurrLDD->pszVolLabel) HeapFree(heap, 0, pCurrLDD->pszVolLabel);
|
HeapFree(heap, 0, pCurrLDD->pszVolLabel);
|
||||||
if (pCurrLDD->pszDiskName) HeapFree(heap, 0, pCurrLDD->pszDiskName);
|
HeapFree(heap, 0, pCurrLDD->pszDiskName);
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(pCurrLDD, pldd, sizeof(LOGDISKDESC_S));
|
memcpy(pCurrLDD, pldd, sizeof(LOGDISKDESC_S));
|
||||||
|
|
|
@ -112,6 +112,19 @@ DWORD WINAPI CM_Disconnect_Machine(DWORD handle)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* CM_Get_Device_ID_ListA (SETUPAPI.@)
|
||||||
|
*/
|
||||||
|
|
||||||
|
DWORD WINAPI CM_Get_Device_ID_ListA(
|
||||||
|
PCSTR pszFilter, PCHAR Buffer, ULONG BufferLen, ULONG ulFlags )
|
||||||
|
{
|
||||||
|
FIXME("%p %p %ld %ld\n", pszFilter, Buffer, BufferLen, ulFlags );
|
||||||
|
memset(Buffer,0,2);
|
||||||
|
return CR_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* SetupCopyOEMInfA (SETUPAPI.@)
|
* SetupCopyOEMInfA (SETUPAPI.@)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -658,7 +658,7 @@ void VCP_UI_RegisterProgressClass(void)
|
||||||
registered = TRUE;
|
registered = TRUE;
|
||||||
ZeroMemory (&wndClass, sizeof(WNDCLASSA));
|
ZeroMemory (&wndClass, sizeof(WNDCLASSA));
|
||||||
wndClass.style = CS_GLOBALCLASS | CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;
|
wndClass.style = CS_GLOBALCLASS | CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;
|
||||||
wndClass.lpfnWndProc = (WNDPROC)VCP_UI_FileCopyWndProc;
|
wndClass.lpfnWndProc = VCP_UI_FileCopyWndProc;
|
||||||
wndClass.cbClsExtra = 0;
|
wndClass.cbClsExtra = 0;
|
||||||
wndClass.cbWndExtra = 0;
|
wndClass.cbWndExtra = 0;
|
||||||
wndClass.hCursor = LoadCursorA (0, (LPSTR)IDC_ARROW);
|
wndClass.hCursor = LoadCursorA (0, (LPSTR)IDC_ARROW);
|
||||||
|
|
Loading…
Reference in a new issue