mirror of
https://github.com/reactos/reactos.git
synced 2025-05-06 18:31:26 +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
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "wine/port.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "windef.h"
|
||||
|
@ -120,10 +117,10 @@ BOOL WINAPI SetupQuerySpaceRequiredOnDriveA(HDSKSPC DiskSpace,
|
|||
PVOID Reserved1, UINT Reserved2)
|
||||
{
|
||||
WCHAR driveW[20];
|
||||
int i;
|
||||
unsigned int i;
|
||||
LPDISKSPACELIST list = (LPDISKSPACELIST)DiskSpace;
|
||||
BOOL rc = FALSE;
|
||||
WCHAR bkslsh[]= {'\\',0};
|
||||
static const WCHAR bkslsh[]= {'\\',0};
|
||||
|
||||
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) );
|
||||
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 );
|
||||
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 (array)
|
||||
new_array = HeapReAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, array, new_count * elem );
|
||||
new_array = HeapReAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, array, new_count * elem );
|
||||
else
|
||||
new_array = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, new_count * elem );
|
||||
new_array = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, new_count * elem );
|
||||
|
||||
if (new_array)
|
||||
*count = new_count;
|
||||
else
|
||||
if (array)
|
||||
HeapFree( GetProcessHeap(), 0, array );
|
||||
HeapFree( GetProcessHeap(), 0, 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 */
|
||||
static int find_section( struct inf_file *file, const WCHAR *name )
|
||||
{
|
||||
int i;
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < file->nb_sections; 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 line *line;
|
||||
struct field *field;
|
||||
int i, dirid;
|
||||
unsigned int i;
|
||||
int dirid;
|
||||
WCHAR *dirid_str, *end;
|
||||
const WCHAR *ret = NULL;
|
||||
|
||||
|
@ -1170,9 +1170,7 @@ HINF WINAPI SetupOpenMasterInf( VOID )
|
|||
WCHAR Buffer[MAX_PATH];
|
||||
|
||||
GetWindowsDirectoryW( Buffer, MAX_PATH );
|
||||
|
||||
wcscat( Buffer, Layout );
|
||||
|
||||
strcatW( Buffer, Layout );
|
||||
return SetupOpenInfFileW( Buffer, NULL, INF_STYLE_WIN4, NULL);
|
||||
}
|
||||
|
||||
|
@ -1184,7 +1182,7 @@ HINF WINAPI SetupOpenMasterInf( VOID )
|
|||
void WINAPI SetupCloseInfFile( HINF 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] );
|
||||
HeapFree( GetProcessHeap(), 0, file->src_root );
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
*
|
||||
*
|
||||
* 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 "wine/unicode.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <share.h>
|
||||
#include "fcntl.h"
|
||||
#include "share.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
|
@ -312,7 +312,7 @@ static INT_PTR sc_FNNOTIFY_A(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin)
|
|||
if (err == FILEOP_DOIT) {
|
||||
TRACE(" Callback specified filename: %s\n", debugstr_a(&(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);
|
||||
return -1;
|
||||
}
|
||||
|
@ -597,11 +597,11 @@ BOOL WINAPI SetupIterateCabinetA(PCSTR CabinetFile, DWORD Reserved,
|
|||
BOOL WINAPI SetupIterateCabinetW(PCWSTR CabinetFile, DWORD Reserved,
|
||||
PSP_FILE_CALLBACK_W MsgHandler, PVOID Context)
|
||||
{
|
||||
CHAR CabinetFile_A[MAX_PATH];
|
||||
unsigned int len;
|
||||
CHAR pszCabinet[MAX_PATH], pszCabPath[MAX_PATH];
|
||||
UINT len;
|
||||
SC_HSC_W my_hsc;
|
||||
ERF erf;
|
||||
CHAR pszCabinet[MAX_PATH], pszCabPath[MAX_PATH], *p;
|
||||
WCHAR pszCabPathW[MAX_PATH], *p;
|
||||
DWORD fpnsize;
|
||||
BOOL ret;
|
||||
|
||||
|
@ -612,36 +612,33 @@ BOOL WINAPI SetupIterateCabinetW(PCWSTR CabinetFile, DWORD Reserved,
|
|||
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));
|
||||
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) {
|
||||
SetLastError(ERROR_BAD_PATHNAME);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (p) {
|
||||
strcpy(pszCabinet, p);
|
||||
*p = '\0';
|
||||
strcpyW(my_hsc.most_recent_cabinet_name, p);
|
||||
*p = 0;
|
||||
len = WideCharToMultiByte(CP_ACP, 0, pszCabPathW, -1, pszCabPath,
|
||||
MAX_PATH, 0, 0);
|
||||
if (!len) return FALSE;
|
||||
} else {
|
||||
strcpy(pszCabinet, CabinetFile_A);
|
||||
strcpyW(my_hsc.most_recent_cabinet_name, CabinetFile);
|
||||
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.msghandler = MsgHandler;
|
||||
my_hsc.context = Context;
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include "wine/windef16.h"
|
||||
|
||||
typedef UINT16 DI_FUNCTION16;
|
||||
typedef UINT16 HINF16;
|
||||
typedef UINT16 LOGDISKID16;
|
||||
typedef UINT16 VHSTR;
|
||||
|
|
|
@ -476,9 +476,9 @@ RETERR16 WINAPI CtlSetLdd16(LPLOGDISKDESC pldd)
|
|||
else
|
||||
{
|
||||
pCurrLDD = pCurr->pldd;
|
||||
if (pCurrLDD->pszPath) HeapFree(heap, 0, pCurrLDD->pszPath);
|
||||
if (pCurrLDD->pszVolLabel) HeapFree(heap, 0, pCurrLDD->pszVolLabel);
|
||||
if (pCurrLDD->pszDiskName) HeapFree(heap, 0, pCurrLDD->pszDiskName);
|
||||
HeapFree(heap, 0, pCurrLDD->pszPath);
|
||||
HeapFree(heap, 0, pCurrLDD->pszVolLabel);
|
||||
HeapFree(heap, 0, pCurrLDD->pszDiskName);
|
||||
}
|
||||
|
||||
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.@)
|
||||
*/
|
||||
|
|
|
@ -658,7 +658,7 @@ void VCP_UI_RegisterProgressClass(void)
|
|||
registered = TRUE;
|
||||
ZeroMemory (&wndClass, sizeof(WNDCLASSA));
|
||||
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.cbWndExtra = 0;
|
||||
wndClass.hCursor = LoadCursorA (0, (LPSTR)IDC_ARROW);
|
||||
|
|
Loading…
Reference in a new issue