Merge some changes from Wine

svn path=/trunk/; revision=30326
This commit is contained in:
Hervé Poussineau 2007-11-10 14:35:21 +00:00
parent 040332c006
commit 69a20f248e
11 changed files with 267 additions and 218 deletions

View file

@ -142,7 +142,7 @@ static const WCHAR *get_csidl_dir( DWORD csidl )
if (!SHGetSpecialFolderPathW( NULL, buffer, csidl, TRUE ))
{
FIXME( "CSIDL %lx not found\n", csidl );
FIXME( "CSIDL %x not found\n", csidl );
return get_unknown_dirid();
}
len = (strlenW(buffer) + 1) * sizeof(WCHAR);
@ -199,7 +199,7 @@ static BOOL store_user_dirid( HINF hinf, int id, WCHAR *str )
new = HeapReAlloc( GetProcessHeap(), 0, user_dirids,
new_size * sizeof(*new) );
else
new = HeapAlloc( GetProcessHeap(), 0,
new = HeapAlloc( GetProcessHeap(), 0,
new_size * sizeof(*new) );
if (!new) return FALSE;

View file

@ -52,9 +52,9 @@ HDSKSPC WINAPI SetupCreateDiskSpaceListW(PVOID Reserved1, DWORD Reserved2, UINT
list = HeapAlloc(GetProcessHeap(),0,sizeof(DISKSPACELIST));
list->dwDriveCount = 0;
ptr = drives;
while (*ptr)
{
DWORD type = GetDriveTypeW(ptr);
@ -89,8 +89,8 @@ HDSKSPC WINAPI SetupCreateDiskSpaceListA(PVOID Reserved1, DWORD Reserved2, UINT
/***********************************************************************
* SetupAddInstallSectionToDiskSpaceListA (SETUPAPI.@)
*/
BOOL WINAPI SetupAddInstallSectionToDiskSpaceListA(HDSKSPC DiskSpace,
HINF InfHandle, HINF LayoutInfHandle,
BOOL WINAPI SetupAddInstallSectionToDiskSpaceListA(HDSKSPC DiskSpace,
HINF InfHandle, HINF LayoutInfHandle,
LPCSTR SectionName, PVOID Reserved1, UINT Reserved2)
{
FIXME ("Stub\n");
@ -100,8 +100,8 @@ BOOL WINAPI SetupAddInstallSectionToDiskSpaceListA(HDSKSPC DiskSpace,
/***********************************************************************
* SetupQuerySpaceRequiredOnDriveA (SETUPAPI.@)
*/
BOOL WINAPI SetupQuerySpaceRequiredOnDriveA(HDSKSPC DiskSpace,
LPCSTR DriveSpec, LONGLONG* SpaceRequired,
BOOL WINAPI SetupQuerySpaceRequiredOnDriveA(HDSKSPC DiskSpace,
LPCSTR DriveSpec, LONGLONG* SpaceRequired,
PVOID Reserved1, UINT Reserved2)
{
WCHAR driveW[20];
@ -115,7 +115,7 @@ BOOL WINAPI SetupQuerySpaceRequiredOnDriveA(HDSKSPC DiskSpace,
lstrcatW(driveW,bkslsh);
TRACE("Looking for drive %s\n",debugstr_w(driveW));
for (i = 0; i < list->dwDriveCount; i++)
{
TRACE("checking drive %s\n",debugstr_w(list->Drives[i].lpzName));
@ -137,5 +137,5 @@ BOOL WINAPI SetupDestroyDiskSpaceList(HDSKSPC DiskSpace)
{
LPDISKSPACELIST list = (LPDISKSPACELIST)DiskSpace;
HeapFree(GetProcessHeap(),0,list);
return TRUE;
return TRUE;
}

View file

@ -156,9 +156,9 @@ static BOOL copy_files_callback( HINF hinf, PCWSTR field, void *arg )
struct files_callback_info *info = arg;
if (field[0] == '@') /* special case: copy single file */
SetupQueueDefaultCopyW( info->queue, info->layout, info->src_root, NULL, &field[1], info->copy_flags );
SetupQueueDefaultCopyW( info->queue, info->layout ? info->layout : hinf, info->src_root, NULL, field+1, info->copy_flags );
else
SetupQueueCopySectionW( info->queue, info->src_root, info->layout, hinf, field, info->copy_flags );
SetupQueueCopySectionW( info->queue, info->src_root, info->layout ? info->layout : hinf, hinf, field, info->copy_flags );
return TRUE;
}
@ -319,7 +319,7 @@ static BOOL do_reg_operation( HKEY hkey, const WCHAR *value, INFCONTEXT *context
}
else RegDeleteValueW( hkey, value );
}
else RegDeleteKeyW( hkey, NULL );
else NtDeleteKey( hkey );
return TRUE;
}
@ -379,7 +379,7 @@ static BOOL do_reg_operation( HKEY hkey, const WCHAR *value, INFCONTEXT *context
if (type == REG_DWORD)
{
DWORD dw = str ? strtoulW( str, NULL, 0 ) : 0;
TRACE( "setting dword %s to %lx\n", debugstr_w(value), dw );
TRACE( "setting dword %s to %x\n", debugstr_w(value), dw );
RegSetValueExW( hkey, value, 0, type, (BYTE *)&dw, sizeof(dw) );
}
else
@ -399,7 +399,7 @@ static BOOL do_reg_operation( HKEY hkey, const WCHAR *value, INFCONTEXT *context
if (size)
{
if (!(data = HeapAlloc( GetProcessHeap(), 0, size ))) return FALSE;
TRACE( "setting binary data %s len %ld\n", debugstr_w(value), size );
TRACE( "setting binary data %s len %d\n", debugstr_w(value), size );
SetupGetBinaryField( context, 5, data, size, NULL );
}
RegSetValueExW( hkey, value, 0, type, data, size );
@ -618,7 +618,7 @@ static BOOL do_register_dll( const struct register_dll_info *info, const WCHAR *
if (FAILED(res))
{
WARN( "calling %s in %s returned error %lx\n", entry_point, debugstr_w(path), res );
WARN( "calling %s in %s returned error %x\n", entry_point, debugstr_w(path), res );
status.FailureCode = SPREG_REGSVR;
status.Win32Error = res;
goto done;
@ -642,7 +642,7 @@ static BOOL do_register_dll( const struct register_dll_info *info, const WCHAR *
if (FAILED(res))
{
WARN( "calling DllInstall in %s returned error %lx\n", debugstr_w(path), res );
WARN( "calling DllInstall in %s returned error %x\n", debugstr_w(path), res );
status.FailureCode = SPREG_REGSVR;
status.Win32Error = res;
goto done;
@ -1163,7 +1163,7 @@ static BOOL iterate_section_fields( HINF hinf, PCWSTR section, PCWSTR key,
goto done;
if (!callback( hinf, buffer, arg ))
{
WARN("callback failed for %s %s err %ld\n",
WARN("callback failed for %s %s err %d\n",
debugstr_w(section), debugstr_w(buffer), GetLastError() );
goto done;
}
@ -1440,23 +1440,24 @@ BOOL WINAPI SetupInstallFromInfSectionW( HWND owner, HINF hinf, PCWSTR section,
*/
void WINAPI InstallHinfSectionW( HWND hwnd, HINSTANCE handle, LPCWSTR cmdline, INT show )
{
WCHAR *p, *path, section[MAX_PATH];
WCHAR *s, *path, section[MAX_PATH];
void *callback_context;
UINT mode;
HINF hinf;
TRACE("hwnd %p, handle %p, cmdline %s\n", hwnd, handle, debugstr_w(cmdline));
lstrcpynW( section, cmdline, sizeof(section)/sizeof(WCHAR) );
lstrcpynW( section, cmdline, MAX_PATH );
if (!(p = strchrW( section, ' ' ))) return;
*p++ = 0;
while (*p == ' ') p++;
mode = atoiW( p );
if (!(s = strchrW( section, ' ' ))) return;
*s++ = 0;
while (*s == ' ') s++;
mode = atoiW( s );
if (!(p = strchrW( p, ' ' ))) return;
path = p + 1;
while (*path == ' ') path++;
/* quoted paths are not allowed on native, the rest of the command line is taken as the path */
if (!(s = strchrW( s, ' ' ))) return;
while (*s == ' ') s++;
path = s;
hinf = SetupOpenInfFileW( path, NULL, INF_STYLE_WIN4, NULL );
if (hinf == INVALID_HANDLE_VALUE) return;
@ -1492,27 +1493,24 @@ void WINAPI InstallHinfSectionA( HWND hwnd, HINSTANCE handle, LPCSTR cmdline, IN
}
}
/***********************************************************************
* SetupInstallServicesFromInfSectionA (SETUPAPI.@)
* SetupInstallServicesFromInfSectionW (SETUPAPI.@)
*/
BOOL WINAPI SetupInstallServicesFromInfSectionA( HINF hinf, PCSTR sectionname, DWORD flags )
BOOL WINAPI SetupInstallServicesFromInfSectionW( HINF Inf, PCWSTR SectionName, DWORD Flags)
{
return SetupInstallServicesFromInfSectionExA( hinf, sectionname, flags,
return SetupInstallServicesFromInfSectionExW( Inf, SectionName, Flags,
NULL, NULL, NULL, NULL );
}
/***********************************************************************
* SetupInstallServicesFromInfSectionW (SETUPAPI.@)
* SetupInstallServicesFromInfSectionA (SETUPAPI.@)
*/
BOOL WINAPI SetupInstallServicesFromInfSectionW( HINF hinf, PCWSTR sectionname, DWORD flags )
BOOL WINAPI SetupInstallServicesFromInfSectionA( HINF Inf, PCSTR SectionName, DWORD Flags)
{
return SetupInstallServicesFromInfSectionExW( hinf, sectionname, flags,
return SetupInstallServicesFromInfSectionExA( Inf, SectionName, Flags,
NULL, NULL, NULL, NULL );
}
/***********************************************************************
* SetupInstallServicesFromInfSectionExA (SETUPAPI.@)
*/

View file

@ -757,8 +757,7 @@ DWORD WINAPI TakeOwnershipOfFile(LPCWSTR lpFileName)
fail:;
dwError = GetLastError();
if (pOwner != NULL)
MyFree(pOwner);
MyFree(pOwner);
if (hToken != NULL)
CloseHandle(hToken);
@ -826,18 +825,36 @@ DWORD WINAPI RetreiveFileSecurity(LPCWSTR lpFileName,
}
/**************************************************************************
* AssertFail [SETUPAPI.@]
static DWORD global_flags = 0; /* FIXME: what should be in here? */
/***********************************************************************
* pSetupGetGlobalFlags (SETUPAPI.@)
*/
DWORD WINAPI pSetupGetGlobalFlags(void)
{
FIXME( "stub\n" );
return global_flags;
}
/***********************************************************************
* pSetupSetGlobalFlags (SETUPAPI.@)
*/
void WINAPI pSetupSetGlobalFlags( DWORD flags )
{
global_flags = flags;
}
/***********************************************************************
* AssertFail (SETUPAPI.@)
*
* Display an assertion message.
* Shows an assert fail error messagebox
*
* PARAMS
* lpFile [I] File name
* uLine [I] Line number
* lpMessage [I] Assertion message
* lpFile [I] file where assert failed
* uLine [I] line number in file
* lpMessage [I] assert message
*
* RETURNS
* Nothing
*/
VOID WINAPI AssertFail(LPSTR lpFile, UINT uLine, LPSTR lpMessage)
{
@ -1280,7 +1297,7 @@ BOOL WINAPI SetupGetFileCompressionInfoExA( PCSTR source, PSTR name, DWORD len,
DWORD nb_chars = 0;
LPSTR nameA;
TRACE("%s, %p, %lu, %p, %p, %p, %p\n", debugstr_a(source), name, len, required,
TRACE("%s, %p, %d, %p, %p, %p, %p\n", debugstr_a(source), name, len, required,
source_size, target_size, type);
if (!source || !(sourceW = MultiByteToUnicode( source, CP_ACP ))) return FALSE;
@ -1340,7 +1357,7 @@ BOOL WINAPI SetupGetFileCompressionInfoExW( PCWSTR source, PWSTR name, DWORD len
BOOL ret = FALSE;
DWORD source_len;
TRACE("%s, %p, %lu, %p, %p, %p, %p\n", debugstr_w(source), name, len, required,
TRACE("%s, %p, %d, %p, %p, %p, %p\n", debugstr_w(source), name, len, required,
source_size, target_size, type);
if (!source) return FALSE;
@ -1464,7 +1481,7 @@ static DWORD decompress_file_lz( LPCWSTR source, LPCWSTR target )
if ((error = LZCopy( src, dst )) >= 0) ret = ERROR_SUCCESS;
else
{
WARN("failed to decompress file %ld\n", error);
WARN("failed to decompress file %d\n", error);
ret = ERROR_INVALID_DATA;
}

View file

@ -162,7 +162,7 @@ static void *grow_array( void *array, unsigned int *count, size_t elem )
/* get the directory of the inf file (as counted string, not null-terminated) */
static const WCHAR *get_inf_dir( struct inf_file *file, unsigned int *len )
static const WCHAR *get_inf_dir( const struct inf_file *file, unsigned int *len )
{
const WCHAR *p = strrchrW( file->filename, '\\' );
*len = p ? (p + 1 - file->filename) : 0;
@ -171,7 +171,7 @@ static const WCHAR *get_inf_dir( struct inf_file *file, unsigned int *len )
/* find a section by name */
static int find_section( struct inf_file *file, const WCHAR *name )
static int find_section( const struct inf_file *file, const WCHAR *name )
{
unsigned int i;
@ -290,7 +290,7 @@ static struct field *add_field( struct inf_file *file, const WCHAR *text )
/* retrieve the string substitution for a directory id */
static const WCHAR *get_dirid_subst( struct inf_file *file, int dirid, unsigned int *len )
static const WCHAR *get_dirid_subst( const struct inf_file *file, int dirid, unsigned int *len )
{
const WCHAR *ret;
@ -303,7 +303,8 @@ static const WCHAR *get_dirid_subst( struct inf_file *file, int dirid, unsigned
/* retrieve the string substitution for a given string, or NULL if not found */
/* if found, len is set to the substitution length */
static const WCHAR *get_string_subst( struct inf_file *file, const WCHAR *str, unsigned int *len )
static const WCHAR *get_string_subst( const struct inf_file *file, const WCHAR *str, unsigned int *len,
BOOL no_trailing_slash )
{
static const WCHAR percent = '%';
@ -340,6 +341,7 @@ static const WCHAR *get_string_subst( struct inf_file *file, const WCHAR *str, u
dirid_str[*len] = 0;
dirid = strtolW( dirid_str, &end, 10 );
if (!*end) ret = get_dirid_subst( file, dirid, len );
if (no_trailing_slash && ret && *len && ret[*len - 1] == '\\') *len -= 1;
HeapFree( GetProcessHeap(), 0, dirid_str );
return ret;
}
@ -350,7 +352,7 @@ static const WCHAR *get_string_subst( struct inf_file *file, const WCHAR *str, u
/* do string substitutions on the specified text */
/* the buffer is assumed to be large enough */
/* returns necessary length not including terminating null */
unsigned int PARSER_string_substW( struct inf_file *file, const WCHAR *text, WCHAR *buffer,
unsigned int PARSER_string_substW( const struct inf_file *file, const WCHAR *text, WCHAR *buffer,
unsigned int size )
{
const WCHAR *start, *subst, *p;
@ -374,7 +376,7 @@ unsigned int PARSER_string_substW( struct inf_file *file, const WCHAR *text, WCH
else /* end of the %xx% string, find substitution */
{
len = p - start - 1;
subst = get_string_subst( file, start + 1, &len );
subst = get_string_subst( file, start + 1, &len, p[1] == '\\' );
if (!subst)
{
subst = start;
@ -403,7 +405,7 @@ unsigned int PARSER_string_substW( struct inf_file *file, const WCHAR *text, WCH
/* do string substitutions on the specified text */
/* the buffer is assumed to be large enough */
/* returns necessary length not including terminating null */
unsigned int PARSER_string_substA( struct inf_file *file, const WCHAR *text, char *buffer,
unsigned int PARSER_string_substA( const struct inf_file *file, const WCHAR *text, char *buffer,
unsigned int size )
{
WCHAR buffW[MAX_STRING_LEN+1];
@ -456,14 +458,14 @@ inline static enum parser_state set_state( struct parser *parser, enum parser_st
/* check if the pointer points to an end of file */
inline static int is_eof( struct parser *parser, const WCHAR *ptr )
inline static int is_eof( const struct parser *parser, const WCHAR *ptr )
{
return (ptr >= parser->end || *ptr == CONTROL_Z);
}
/* check if the pointer points to an end of line */
inline static int is_eol( struct parser *parser, const WCHAR *ptr )
inline static int is_eol( const struct parser *parser, const WCHAR *ptr )
{
return (ptr >= parser->end || *ptr == CONTROL_Z || *ptr == '\n');
}
@ -1044,7 +1046,7 @@ WCHAR *PARSER_get_dest_dir( INFCONTEXT *context )
const WCHAR *dir;
WCHAR *ptr, *ret;
INT dirid;
unsigned int len1 = 0;
unsigned int len1;
DWORD len2;
if (!SetupGetIntField( context, 1, &dirid )) return NULL;
@ -1321,16 +1323,14 @@ void WINAPI SetupCloseInfFile( HINF hinf )
struct inf_file *file = hinf;
unsigned int i;
if (file != NULL && file != INVALID_HANDLE_VALUE)
{
for (i = 0; i < file->nb_sections; i++)
HeapFree( GetProcessHeap(), 0, file->sections[i] );
HeapFree( GetProcessHeap(), 0, file->filename );
HeapFree( GetProcessHeap(), 0, file->sections );
HeapFree( GetProcessHeap(), 0, file->fields );
HeapFree( GetProcessHeap(), 0, file->strings );
HeapFree( GetProcessHeap(), 0, file );
}
if (!hinf || (hinf == INVALID_HANDLE_VALUE)) return;
for (i = 0; i < file->nb_sections; i++) HeapFree( GetProcessHeap(), 0, file->sections[i] );
HeapFree( GetProcessHeap(), 0, file->filename );
HeapFree( GetProcessHeap(), 0, file->sections );
HeapFree( GetProcessHeap(), 0, file->fields );
HeapFree( GetProcessHeap(), 0, file->strings );
HeapFree( GetProcessHeap(), 0, file );
}
@ -1362,16 +1362,13 @@ LONG WINAPI SetupGetLineCountW( HINF hinf, PCWSTR section )
int section_index;
LONG ret = -1;
if (hinf == NULL || hinf == INVALID_HANDLE_VALUE)
return ERROR_INVALID_PARAMETER;
for (file = hinf; file; file = file->next)
{
if ((section_index = find_section( file, section )) == -1) continue;
if (ret == -1) ret = 0;
ret += file->sections[section_index]->nb_lines;
}
TRACE( "(%p,%s) returning %ld\n", hinf, debugstr_w(section), ret );
TRACE( "(%p,%s) returning %d\n", hinf, debugstr_w(section), ret );
SetLastError( (ret == -1) ? ERROR_SECTION_NOT_FOUND : 0 );
return ret;
}
@ -1404,12 +1401,6 @@ BOOL WINAPI SetupGetLineByIndexW( HINF hinf, PCWSTR section, DWORD index, INFCON
struct inf_file *file = hinf;
int section_index;
if (hinf == NULL || hinf == INVALID_HANDLE_VALUE)
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
SetLastError( ERROR_SECTION_NOT_FOUND );
for (file = hinf; file; file = file->next)
{
@ -1422,7 +1413,7 @@ BOOL WINAPI SetupGetLineByIndexW( HINF hinf, PCWSTR section, DWORD index, INFCON
context->Section = section_index;
context->Line = index;
SetLastError( 0 );
TRACE( "(%p,%s): returning %d/%ld\n",
TRACE( "(%p,%s): returning %d/%d\n",
hinf, debugstr_w(section), section_index, index );
return TRUE;
}
@ -1470,12 +1461,6 @@ BOOL WINAPI SetupFindFirstLineW( HINF hinf, PCWSTR section, PCWSTR key, INFCONTE
struct inf_file *file;
int section_index;
if (hinf == NULL || hinf == INVALID_HANDLE_VALUE)
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
SetLastError( ERROR_SECTION_NOT_FOUND );
for (file = hinf; file; file = file->next)
{
@ -1770,7 +1755,7 @@ BOOL WINAPI SetupGetStringFieldA( PINFCONTEXT context, DWORD index, PSTR buffer,
}
PARSER_string_substA( file, field->text, buffer, size );
TRACE( "context %p/%p/%d/%d index %ld returning %s\n",
TRACE( "context %p/%p/%d/%d index %d returning %s\n",
context->Inf, context->CurrentInf, context->Section, context->Line,
index, debugstr_a(buffer) );
}
@ -1801,7 +1786,7 @@ BOOL WINAPI SetupGetStringFieldW( PINFCONTEXT context, DWORD index, PWSTR buffer
}
PARSER_string_substW( file, field->text, buffer, size );
TRACE( "context %p/%p/%d/%d index %ld returning %s\n",
TRACE( "context %p/%p/%d/%d index %d returning %s\n",
context->Inf, context->CurrentInf, context->Section, context->Line,
index, debugstr_w(buffer) );
}
@ -1888,7 +1873,7 @@ BOOL WINAPI SetupGetBinaryField( PINFCONTEXT context, DWORD index, BYTE *buffer,
}
if (TRACE_ON(setupapi))
{
TRACE( "%p/%p/%d/%d index %ld returning",
TRACE( "%p/%p/%d/%d index %d returning",
context->Inf, context->CurrentInf, context->Section, context->Line, index );
for (i = index; i < line->nb_fields; i++) TRACE( " %02x", buffer[i - index] );
TRACE( "\n" );

View file

@ -114,7 +114,7 @@ BOOL WINAPI SetupGetInfInformationA(LPCVOID InfSpec, DWORD SearchControl,
/***********************************************************************
* SetupGetInfInformationW (SETUPAPI.@)
*
*
* BUGS
* Only handles the case when InfSpec is an INF handle.
*/
@ -126,7 +126,7 @@ BOOL WINAPI SetupGetInfInformationW(LPCVOID InfSpec, DWORD SearchControl,
BOOL ret;
DWORD infSize;
TRACE("(%p, %ld, %p, %ld, %p)\n", InfSpec, SearchControl, ReturnBuffer,
TRACE("(%p, %d, %p, %d, %p)\n", InfSpec, SearchControl, ReturnBuffer,
ReturnBufferSize, RequiredSize);
if (!InfSpec)
@ -153,7 +153,7 @@ BOOL WINAPI SetupGetInfInformationW(LPCVOID InfSpec, DWORD SearchControl,
inf = search_for_inf(InfSpec, SearchControl);
break;
case INFINFO_INF_PATH_LIST_SEARCH:
FIXME("Unhandled search control: %ld\n", SearchControl);
FIXME("Unhandled search control: %d\n", SearchControl);
if (RequiredSize)
*RequiredSize = 0;
@ -214,6 +214,7 @@ BOOL WINAPI SetupQueryInfFileInformationA(PSP_INF_INFORMATION InfInformation,
if (!ReturnBuffer)
{
HeapFree(GetProcessHeap(), 0, filenameW);
if (ReturnBufferSize)
{
SetLastError(ERROR_INVALID_PARAMETER);
@ -225,6 +226,7 @@ BOOL WINAPI SetupQueryInfFileInformationA(PSP_INF_INFORMATION InfInformation,
if (size > ReturnBufferSize)
{
HeapFree(GetProcessHeap(), 0, filenameW);
SetLastError(ERROR_INSUFFICIENT_BUFFER);
return FALSE;
}
@ -240,12 +242,12 @@ BOOL WINAPI SetupQueryInfFileInformationA(PSP_INF_INFORMATION InfInformation,
*/
BOOL WINAPI SetupQueryInfFileInformationW(PSP_INF_INFORMATION InfInformation,
UINT InfIndex, PWSTR ReturnBuffer,
DWORD ReturnBufferSize, PDWORD RequiredSize)
DWORD ReturnBufferSize, PDWORD RequiredSize)
{
DWORD len;
LPWSTR ptr;
TRACE("(%p, %u, %p, %ld, %p) Stub!\n", InfInformation, InfIndex,
TRACE("(%p, %u, %p, %d, %p) Stub!\n", InfInformation, InfIndex,
ReturnBuffer, ReturnBufferSize, RequiredSize);
if (!InfInformation)
@ -289,7 +291,7 @@ BOOL WINAPI SetupGetSourceFileLocationA( HINF hinf, PINFCONTEXT context, PCSTR f
DWORD required;
INT size;
TRACE("%p, %p, %s, %p, %p, 0x%08lx, %p\n", hinf, context, debugstr_a(filename), source_id,
TRACE("%p, %p, %s, %p, %p, 0x%08x, %p\n", hinf, context, debugstr_a(filename), source_id,
buffer, buffer_size, required_size);
if (filename && *filename && !(filenameW = strdupAtoW( filename )))
@ -330,10 +332,8 @@ static LPWSTR get_source_id( HINF hinf, PINFCONTEXT context, PCWSTR filename )
WCHAR Section[MAX_PATH];
DWORD size;
LPWSTR source_id;
BOOL ret;
ret = SetupDiGetActualSectionToInstallW(hinf, source_disks_files, Section, MAX_PATH, NULL, NULL);
if (!ret)
if (!SetupDiGetActualSectionToInstallW(hinf, source_disks_files, Section, MAX_PATH, NULL, NULL))
return NULL;
if (!SetupFindFirstLineW( hinf, Section, filename, context ) &&
@ -352,8 +352,7 @@ static LPWSTR get_source_id( HINF hinf, PINFCONTEXT context, PCWSTR filename )
return NULL;
}
ret = SetupDiGetActualSectionToInstallW(hinf, source_disks_names, Section, MAX_PATH, NULL, NULL);
if (!ret)
if (!SetupDiGetActualSectionToInstallW(hinf, source_disks_names, Section, MAX_PATH, NULL, NULL))
return NULL;
if (!SetupFindFirstLineW( hinf, Section, source_id, context ) &&
@ -376,7 +375,7 @@ BOOL WINAPI SetupGetSourceFileLocationW( HINF hinf, PINFCONTEXT context, PCWSTR
INFCONTEXT ctx;
WCHAR *end, *source_id_str;
TRACE("%p, %p, %s, %p, %p, 0x%08lx, %p\n", hinf, context, debugstr_w(filename), source_id,
TRACE("%p, %p, %s, %p, %p, 0x%08x, %p\n", hinf, context, debugstr_w(filename), source_id,
buffer, buffer_size, required_size);
if (!context) context = &ctx;
@ -420,7 +419,7 @@ BOOL WINAPI SetupGetSourceInfoA( HINF hinf, UINT source_id, UINT info,
DWORD required;
INT size;
TRACE("%p, %d, %d, %p, %lu, %p\n", hinf, source_id, info, buffer, buffer_size,
TRACE("%p, %d, %d, %p, %d, %p\n", hinf, source_id, info, buffer, buffer_size,
required_size);
if (!SetupGetSourceInfoW( hinf, source_id, info, NULL, 0, &required ))
@ -464,15 +463,13 @@ BOOL WINAPI SetupGetSourceInfoW( HINF hinf, UINT source_id, UINT info,
WCHAR source_id_str[11];
static const WCHAR fmt[] = {'%','d',0};
DWORD index;
BOOL ret;
TRACE("%p, %d, %d, %p, %lu, %p\n", hinf, source_id, info, buffer, buffer_size,
TRACE("%p, %d, %d, %p, %d, %p\n", hinf, source_id, info, buffer, buffer_size,
required_size);
sprintfW( source_id_str, fmt, source_id );
ret = SetupDiGetActualSectionToInstallW(hinf, source_disks_names, Section, MAX_PATH, NULL, NULL);
if (!ret)
if (!SetupDiGetActualSectionToInstallW(hinf, source_disks_names, Section, MAX_PATH, NULL, NULL))
return FALSE;
if (!SetupFindFirstLineW( hinf, Section, source_id_str, &ctx ) &&
@ -517,7 +514,7 @@ BOOL WINAPI SetupGetTargetPathA( HINF hinf, PINFCONTEXT context, PCSTR section,
DWORD required;
INT size;
TRACE("%p, %p, %s, %p, 0x%08lx, %p\n", hinf, context, debugstr_a(section), buffer,
TRACE("%p, %p, %s, %p, 0x%08x, %p\n", hinf, context, debugstr_a(section), buffer,
buffer_size, required_size);
if (section && !(sectionW = strdupAtoW( section )))
@ -569,7 +566,7 @@ BOOL WINAPI SetupGetTargetPathW( HINF hinf, PINFCONTEXT context, PCWSTR section,
WCHAR *dir;
INT size;
TRACE("%p, %p, %s, %p, 0x%08lx, %p\n", hinf, context, debugstr_w(section), buffer,
TRACE("%p, %p, %s, %p, 0x%08x, %p\n", hinf, context, debugstr_w(section), buffer,
buffer_size, required_size);
if (context && !SetupFindFirstLineW( hinf, destination_dirs, NULL, context )) return FALSE;
@ -612,7 +609,7 @@ BOOL WINAPI SetupQueryInfOriginalFileInformationA(
if (OriginalFileInfo->cbSize != sizeof(*OriginalFileInfo))
{
ERR("incorrect OriginalFileInfo->cbSize of %lu\n", OriginalFileInfo->cbSize);
WARN("incorrect OriginalFileInfo->cbSize of %d\n", OriginalFileInfo->cbSize);
SetLastError( ERROR_INVALID_USER_BUFFER );
return FALSE;
}
@ -622,9 +619,9 @@ BOOL WINAPI SetupQueryInfOriginalFileInformationA(
AlternativePlatformInfo, &OriginalFileInfoW);
if (ret)
{
WideCharToMultiByte(CP_ACP, 0, OriginalFileInfoW.OriginalInfName, MAX_PATH,
WideCharToMultiByte(CP_ACP, 0, OriginalFileInfoW.OriginalInfName, -1,
OriginalFileInfo->OriginalInfName, MAX_PATH, NULL, NULL);
WideCharToMultiByte(CP_ACP, 0, OriginalFileInfoW.OriginalCatalogName, MAX_PATH,
WideCharToMultiByte(CP_ACP, 0, OriginalFileInfoW.OriginalCatalogName, -1,
OriginalFileInfo->OriginalCatalogName, MAX_PATH, NULL, NULL);
}
@ -645,16 +642,14 @@ BOOL WINAPI SetupQueryInfOriginalFileInformationW(
static const WCHAR wszVersion[] = { 'V','e','r','s','i','o','n',0 };
static const WCHAR wszCatalogFile[] = { 'C','a','t','a','l','o','g','F','i','l','e',0 };
//SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
//return FALSE;
FIXME("(%p, %d, %p, %p): semi-stub\n", InfInformation, InfIndex,
AlternativePlatformInfo, OriginalFileInfo);
if (OriginalFileInfo->cbSize != sizeof(*OriginalFileInfo))
{
ERR("incorrect OriginalFileInfo->cbSize of %lu\n", OriginalFileInfo->cbSize);
return ERROR_INVALID_USER_BUFFER;
WARN("incorrect OriginalFileInfo->cbSize of %d\n", OriginalFileInfo->cbSize);
SetLastError(ERROR_INVALID_USER_BUFFER);
return FALSE;
}
inf_path = (LPWSTR)&InfInformation->VersionData[0];

View file

@ -35,15 +35,15 @@ struct default_callback_context
struct file_op
{
struct file_op *next;
UINT style;
WCHAR *src_root;
WCHAR *src_path;
WCHAR *src_file;
WCHAR *src_descr;
WCHAR *src_tag;
WCHAR *dst_path;
WCHAR *dst_file;
struct file_op *next;
UINT style;
WCHAR *src_root;
WCHAR *src_path;
WCHAR *src_file;
WCHAR *src_descr;
WCHAR *src_tag;
WCHAR *dst_path;
WCHAR *dst_file;
PSECURITY_DESCRIPTOR dst_sd;
};
@ -207,6 +207,7 @@ UINT CALLBACK QUEUE_callback_WtoA( void *context, UINT notification,
case SPFILENOTIFY_RENAMEERROR:
case SPFILENOTIFY_STARTCOPY:
case SPFILENOTIFY_ENDCOPY:
case SPFILENOTIFY_QUEUESCAN_EX:
{
FILEPATHS_W *pathsW = (FILEPATHS_W *)param1;
FILEPATHS_A pathsA;
@ -240,8 +241,18 @@ UINT CALLBACK QUEUE_callback_WtoA( void *context, UINT notification,
}
break;
case SPFILENOTIFY_NEEDMEDIA:
case SPFILENOTIFY_QUEUESCAN:
{
LPWSTR targetW = (LPWSTR)param1;
LPSTR target = strdupWtoA( targetW );
ret = callback_ctx->orig_handler( callback_ctx->orig_context, notification,
(UINT_PTR)target, param2 );
HeapFree( GetProcessHeap(), 0, target );
}
break;
case SPFILENOTIFY_NEEDMEDIA:
FIXME("mapping for %d not implemented\n",notification);
case SPFILENOTIFY_STARTQUEUE:
case SPFILENOTIFY_ENDQUEUE:
@ -963,12 +974,13 @@ static BOOL create_full_pathW(const WCHAR *path)
return ret;
}
static BOOL do_file_copyW( LPCWSTR source, LPCWSTR target, DWORD style)
static BOOL do_file_copyW( LPCWSTR source, LPCWSTR target, DWORD style,
PSP_FILE_CALLBACK_W handler, PVOID context )
{
BOOL rc = FALSE;
BOOL docopy = TRUE;
TRACE("copy %s to %s style 0x%lx\n",debugstr_w(source),debugstr_w(target),style);
TRACE("copy %s to %s style 0x%x\n",debugstr_w(source),debugstr_w(target),style);
/* before copy processing */
if (style & SP_COPY_REPLACEONLY)
@ -999,7 +1011,7 @@ static BOOL do_file_copyW( LPCWSTR source, LPCWSTR target, DWORD style)
VersionSizeTarget = GetFileVersionInfoSizeW((LPWSTR)target,&zero);
}
TRACE("SizeTarget %li ... SizeSource %li\n",VersionSizeTarget,
TRACE("SizeTarget %i ... SizeSource %i\n",VersionSizeTarget,
VersionSizeSource);
if (VersionSizeSource && VersionSizeTarget)
@ -1030,20 +1042,32 @@ static BOOL do_file_copyW( LPCWSTR source, LPCWSTR target, DWORD style)
if (ret)
{
TRACE("Versions: Source %li.%li target %li.%li\n",
FILEPATHS_W filepaths;
TRACE("Versions: Source %i.%i target %i.%i\n",
SourceInfo->dwFileVersionMS, SourceInfo->dwFileVersionLS,
TargetInfo->dwFileVersionMS, TargetInfo->dwFileVersionLS);
/* used in case of notification */
filepaths.Target = target;
filepaths.Source = source;
filepaths.Win32Error = 0;
filepaths.Flags = 0;
if (TargetInfo->dwFileVersionMS > SourceInfo->dwFileVersionMS)
{
FIXME("Notify that target version is greater..\n");
docopy = FALSE;
if (handler)
docopy = handler (context, SPFILENOTIFY_TARGETNEWER, (UINT_PTR)&filepaths, 0);
else
docopy = FALSE;
}
else if ((TargetInfo->dwFileVersionMS == SourceInfo->dwFileVersionMS)
&& (TargetInfo->dwFileVersionLS > SourceInfo->dwFileVersionLS))
{
FIXME("Notify that target version is greater..\n");
docopy = FALSE;
if (handler)
docopy = handler (context, SPFILENOTIFY_TARGETNEWER, (UINT_PTR)&filepaths, 0);
else
docopy = FALSE;
}
else if ((style & SP_COPY_NEWER_ONLY) &&
(TargetInfo->dwFileVersionMS ==
@ -1051,8 +1075,10 @@ static BOOL do_file_copyW( LPCWSTR source, LPCWSTR target, DWORD style)
&&(TargetInfo->dwFileVersionLS ==
SourceInfo->dwFileVersionLS))
{
FIXME("Notify that target version is greater..\n");
docopy = FALSE;
if (handler)
docopy = handler (context, SPFILENOTIFY_TARGETNEWER, (UINT_PTR)&filepaths, 0);
else
docopy = FALSE;
}
}
}
@ -1071,7 +1097,7 @@ static BOOL do_file_copyW( LPCWSTR source, LPCWSTR target, DWORD style)
if (style & (SP_COPY_NODECOMP | SP_COPY_LANGUAGEAWARE | SP_COPY_FORCE_IN_USE |
SP_COPY_IN_USE_NEEDS_REBOOT | SP_COPY_NOSKIP | SP_COPY_WARNIFSKIP))
{
ERR("Unsupported style(s) 0x%lx\n",style);
ERR("Unsupported style(s) 0x%x\n",style);
}
if (docopy)
@ -1107,7 +1133,7 @@ BOOL WINAPI SetupCommitFileQueueW( HWND owner, HSPFILEQ handle, PSP_FILE_CALLBAC
if (!queue->copy_queue.count && !queue->delete_queue.count && !queue->rename_queue.count)
return TRUE; /* nothing to do */
if (!handler( context, SPFILENOTIFY_STARTQUEUE, (UINT)owner, 0 )) return FALSE;
if (!handler( context, SPFILENOTIFY_STARTQUEUE, (UINT_PTR)owner, 0 )) return FALSE;
/* perform deletes */
@ -1188,7 +1214,7 @@ BOOL WINAPI SetupCommitFileQueueW( HWND owner, HSPFILEQ handle, PSP_FILE_CALLBAC
}
}
if (do_file_copyW( op_result == FILEOP_NEWPATH ? newpath : paths.Source,
paths.Target, op->style )) break; /* success */
paths.Target, op->style, handler, context )) break; /* success */
/* try to extract it from the cabinet file */
if (op->src_tag)
{
@ -1238,11 +1264,17 @@ BOOL WINAPI SetupCommitFileQueueW( HWND owner, HSPFILEQ handle, PSP_FILE_CALLBAC
/***********************************************************************
* SetupScanFileQueueA (SETUPAPI.@)
*/
BOOL WINAPI SetupScanFileQueueA( HSPFILEQ queue, DWORD flags, HWND window,
PSP_FILE_CALLBACK_A callback, PVOID context, PDWORD result )
BOOL WINAPI SetupScanFileQueueA( HSPFILEQ handle, DWORD flags, HWND window,
PSP_FILE_CALLBACK_A handler, PVOID context, PDWORD result )
{
FIXME("stub\n");
return FALSE;
struct callback_WtoA_context ctx;
TRACE("%p %x %p %p %p %p\n", handle, flags, window, handler, context, result);
ctx.orig_context = context;
ctx.orig_handler = handler;
return SetupScanFileQueueW( handle, flags, window, QUEUE_callback_WtoA, &ctx, result );
}
@ -1250,42 +1282,53 @@ BOOL WINAPI SetupScanFileQueueA( HSPFILEQ queue, DWORD flags, HWND window,
* SetupScanFileQueueW (SETUPAPI.@)
*/
BOOL WINAPI SetupScanFileQueueW( HSPFILEQ handle, DWORD flags, HWND window,
PSP_FILE_CALLBACK_W callback, PVOID context, PDWORD result )
PSP_FILE_CALLBACK_W handler, PVOID context, PDWORD result )
{
struct file_queue *queue = handle;
struct file_op *op;
BOOL allnodesprocessed = FALSE;
FILEPATHS_W paths;
UINT notification = 0;
BOOL ret = FALSE;
TRACE("%p %x %p %p %p %p\n", handle, flags, window, handler, context, result);
paths.Source = paths.Target = NULL;
*result = FALSE;
if ( flags & (SPQ_SCAN_FILE_PRESENCE | SPQ_SCAN_FILE_VALIDITY | SPQ_SCAN_USE_CALLBACKEX | SPQ_SCAN_INFORM_USER | SPQ_SCAN_PRUNE_COPY_QUEUE /*| SPQ_SCAN_USE_CALLBACK_SIGNERINFO | SPQ_SCAN_PRUNE_DELREN*/) )
if (!queue->copy_queue.count) return TRUE;
if (flags & SPQ_SCAN_USE_CALLBACK) notification = SPFILENOTIFY_QUEUESCAN;
else if (flags & SPQ_SCAN_USE_CALLBACKEX) notification = SPFILENOTIFY_QUEUESCAN_EX;
if (flags & ~(SPQ_SCAN_USE_CALLBACK | SPQ_SCAN_USE_CALLBACKEX))
{
FIXME( "flags ignored 0x%lx\n", flags & (SPQ_SCAN_FILE_PRESENCE | SPQ_SCAN_FILE_VALIDITY | SPQ_SCAN_USE_CALLBACKEX | SPQ_SCAN_INFORM_USER | SPQ_SCAN_PRUNE_COPY_QUEUE /*| SPQ_SCAN_USE_CALLBACK_SIGNERINFO | SPQ_SCAN_PRUNE_DELREN*/) );
FIXME("flags %x not fully implemented\n", flags);
}
if (queue->copy_queue.count)
paths.Source = paths.Target = NULL;
for (op = queue->copy_queue.head; op; op = op->next)
{
for (op = queue->copy_queue.head; op; op = op->next)
build_filepathsW( op, &paths );
switch (notification)
{
build_filepathsW( op, &paths );
if (flags & SPQ_SCAN_USE_CALLBACK)
{
/* FIXME: sometimes set param 2 to SPQ_DELAYED_COPY */
if (NO_ERROR != callback( context, SPFILENOTIFY_QUEUESCAN, (UINT)paths.Target, 0 ))
goto done;
}
case SPFILENOTIFY_QUEUESCAN:
/* FIXME: handle delay flag */
if (handler( context, notification, (UINT_PTR)paths.Target, 0 )) goto done;
break;
case SPFILENOTIFY_QUEUESCAN_EX:
if (handler( context, notification, (UINT_PTR)&paths, 0 )) goto done;
break;
default:
ret = TRUE; goto done;
}
}
*result = TRUE;
allnodesprocessed = TRUE;
done:
HeapFree( GetProcessHeap(), 0, (void *)paths.Source );
HeapFree( GetProcessHeap(), 0, (void *)paths.Target );
return allnodesprocessed;
return ret;
}
@ -1408,10 +1451,10 @@ UINT WINAPI SetupDefaultQueueCallbackA( PVOID context, UINT notification,
TRACE( "end queue\n" );
return 0;
case SPFILENOTIFY_STARTSUBQUEUE:
TRACE( "start subqueue %d count %d\n", param1, param2 );
TRACE( "start subqueue %ld count %ld\n", param1, param2 );
return TRUE;
case SPFILENOTIFY_ENDSUBQUEUE:
TRACE( "end subqueue %d\n", param1 );
TRACE( "end subqueue %ld\n", param1 );
return 0;
case SPFILENOTIFY_STARTDELETE:
TRACE( "start delete %s\n", debugstr_a(paths->Target) );
@ -1447,7 +1490,7 @@ UINT WINAPI SetupDefaultQueueCallbackA( PVOID context, UINT notification,
TRACE( "need media\n" );
return FILEOP_SKIP;
default:
FIXME( "notification %d params %x,%x\n", notification, param1, param2 );
FIXME( "notification %d params %lx,%lx\n", notification, param1, param2 );
break;
}
return 0;
@ -1472,10 +1515,10 @@ UINT WINAPI SetupDefaultQueueCallbackW( PVOID context, UINT notification,
TRACE( "end queue\n" );
return 0;
case SPFILENOTIFY_STARTSUBQUEUE:
TRACE( "start subqueue %d count %d\n", param1, param2 );
TRACE( "start subqueue %ld count %ld\n", param1, param2 );
return TRUE;
case SPFILENOTIFY_ENDSUBQUEUE:
TRACE( "end subqueue %d\n", param1 );
TRACE( "end subqueue %ld\n", param1 );
return 0;
case SPFILENOTIFY_STARTDELETE:
TRACE( "start delete %s\n", debugstr_w(paths->Target) );
@ -1512,7 +1555,7 @@ UINT WINAPI SetupDefaultQueueCallbackW( PVOID context, UINT notification,
TRACE( "need media\n" );
return FILEOP_SKIP;
default:
FIXME( "notification %d params %x,%x\n", notification, param1, param2 );
FIXME( "notification %d params %lx,%lx\n", notification, param1, param2 );
break;
}
return 0;
@ -1571,9 +1614,9 @@ UINT WINAPI SetupRenameErrorW( HWND parent, PCWSTR dialogTitle, PCWSTR source,
* SetupCopyErrorA (SETUPAPI.@)
*/
UINT WINAPI SetupCopyErrorA( HWND parent, PCSTR dialogTitle, PCSTR diskname,
UINT WINAPI SetupCopyErrorA( HWND parent, PCSTR dialogTitle, PCSTR diskname,
PCSTR sourcepath, PCSTR sourcefile, PCSTR targetpath,
UINT w32error, DWORD style, PSTR pathbuffer,
UINT w32error, DWORD style, PSTR pathbuffer,
DWORD buffersize, PDWORD requiredsize)
{
FIXME( "stub: (Error Number %d when attempting to copy file %s from %s to %s)\n",
@ -1585,12 +1628,31 @@ UINT WINAPI SetupCopyErrorA( HWND parent, PCSTR dialogTitle, PCSTR diskname,
* SetupCopyErrorW (SETUPAPI.@)
*/
UINT WINAPI SetupCopyErrorW( HWND parent, PCWSTR dialogTitle, PCWSTR diskname,
UINT WINAPI SetupCopyErrorW( HWND parent, PCWSTR dialogTitle, PCWSTR diskname,
PCWSTR sourcepath, PCWSTR sourcefile, PCWSTR targetpath,
UINT w32error, DWORD style, PWSTR pathbuffer,
UINT w32error, DWORD style, PWSTR pathbuffer,
DWORD buffersize, PDWORD requiredsize)
{
FIXME( "stub: (Error Number %d when attempting to copy file %s from %s to %s)\n",
w32error, debugstr_w(sourcefile), debugstr_w(sourcepath) ,debugstr_w(targetpath));
return DPROMPT_SKIPFILE;
}
/***********************************************************************
* pSetupGetQueueFlags (SETUPAPI.@)
*/
DWORD WINAPI pSetupGetQueueFlags( HSPFILEQ handle )
{
struct file_queue *queue = handle;
return queue->flags;
}
/***********************************************************************
* pSetupSetQueueFlags (SETUPAPI.@)
*/
BOOL WINAPI pSetupSetQueueFlags( HSPFILEQ handle, DWORD flags )
{
struct file_queue *queue = handle;
queue->flags = flags;
return TRUE;
}

View file

@ -285,10 +285,14 @@
@ stdcall SetupDiCreateDevRegKeyA(ptr ptr long long long ptr str)
@ stdcall SetupDiCreateDevRegKeyW(ptr ptr long long long ptr wstr)
@ stdcall SetupDiCreateDeviceInfoA(ptr str ptr str ptr long ptr)
@ stdcall SetupDiCreateDeviceInfoW(ptr wstr ptr wstr ptr long ptr)
@ stdcall SetupDiCreateDeviceInfoList(ptr ptr)
@ stdcall SetupDiCreateDeviceInfoListExA(ptr long str ptr)
@ stdcall SetupDiCreateDeviceInfoListExW(ptr long wstr ptr)
@ stdcall SetupDiCreateDeviceInfoW(ptr wstr ptr wstr ptr long ptr)
@ stub SetupDiCreateDeviceInterfaceA
@ stub SetupDiCreateDeviceInterfaceW
@ stub SetupDiCreateDeviceInterfaceRegKeyA
@ stub SetupDiCreateDeviceInterfaceRegKeyW
@ stdcall SetupDiDeleteDevRegKey(ptr ptr long long long)
@ stdcall SetupDiDeleteDeviceInfo(long ptr)
@ stub SetupDiDeleteDeviceInterfaceData
@ -328,15 +332,15 @@
@ stdcall SetupDiGetDeviceInstallParamsW(ptr ptr ptr)
@ stdcall SetupDiGetDeviceInstanceIdA(ptr ptr str long ptr)
@ stdcall SetupDiGetDeviceInstanceIdW(ptr ptr wstr long ptr)
@ stub SetupDiGetDeviceInterfaceAlias
@ stdcall SetupDiGetDeviceInterfaceDetailA(long ptr ptr long ptr ptr)
@ stdcall SetupDiGetDeviceInterfaceDetailW(long ptr ptr long ptr ptr)
@ stdcall SetupDiGetDeviceRegistryPropertyA(long ptr long ptr ptr long ptr)
@ stdcall SetupDiGetDeviceRegistryPropertyW(long ptr long ptr ptr long ptr)
@ stdcall SetupDiGetDriverInfoDetailA(ptr ptr ptr ptr long ptr)
@ stdcall SetupDiGetDriverInfoDetailW(ptr ptr ptr ptr long ptr)
@ stub SetupDiGetDriverInstallParamsA
@ stdcall SetupDiGetDriverInstallParamsW(ptr ptr ptr ptr)
@ stub SetupDiGetDeviceInterfaceAlias
@ stdcall SetupDiGetDeviceInterfaceDetailA(long ptr ptr long ptr ptr)
@ stdcall SetupDiGetDeviceInterfaceDetailW(long ptr ptr long ptr ptr)
@ stub SetupDiGetHwProfileFriendlyNameA
@ stub SetupDiGetHwProfileFriendlyNameExA
@ stub SetupDiGetHwProfileFriendlyNameExW
@ -548,15 +552,15 @@
@ stub pSetupDestroyRunOnceNodeList
@ stub pSetupDirectoryIdToPath
@ stdcall pSetupGetField(ptr long)
@ stub pSetupGetGlobalFlags
@ stdcall pSetupGetGlobalFlags()
@ stub pSetupGetOsLoaderDriveAndPath
@ stub pSetupGetQueueFlags
@ stdcall pSetupGetQueueFlags(ptr)
@ stub pSetupGetVersionDatum
@ stub pSetupGuidFromString
@ stub pSetupIsGuidNull
@ stub pSetupMakeSurePathExists
@ stub pSetupSetGlobalFlags
@ stub pSetupSetQueueFlags
@ stdcall pSetupSetGlobalFlags(long)
@ stdcall pSetupSetQueueFlags(ptr long)
@ stub pSetupSetSystemSourceFlags
@ stub pSetupStringFromGuid
@ stub pSetupVerifyQueuedCatalogs

View file

@ -242,10 +242,10 @@ inline static WCHAR *strdupAtoW( const char *str )
struct inf_file;
extern const WCHAR *DIRID_get_string( int dirid );
extern const WCHAR *PARSER_get_inf_filename( HINF hinf );
extern unsigned int PARSER_string_substA( struct inf_file *file, const WCHAR *text,
char *buffer, unsigned int size );
extern unsigned int PARSER_string_substW( struct inf_file *file, const WCHAR *text,
WCHAR *buffer, unsigned int size );
extern unsigned int PARSER_string_substA( const struct inf_file *file, const WCHAR *text, char *buffer,
unsigned int size );
extern unsigned int PARSER_string_substW( const struct inf_file *file, const WCHAR *text, WCHAR *buffer,
unsigned int size );
extern WCHAR *PARSER_get_src_root( HINF hinf );
extern WCHAR *PARSER_get_dest_dir( INFCONTEXT *context );

View file

@ -1,4 +1,4 @@
/*
/*
* Setupapi cabinet routines
*
* Copyright 2003 Gregory M. Turner
@ -20,7 +20,7 @@
*
* Many useful traces are commented in code, uncomment them if you have
* trouble and run with WINEDEBUG=+setupapi
*
*
*/
#include "setupapi_private.h"
@ -87,12 +87,12 @@ static void UnloadCABINETDll(void)
static void *sc_cb_alloc(ULONG cb)
{
return malloc(cb);
return HeapAlloc(GetProcessHeap(), 0, cb);
}
static void sc_cb_free(void *pv)
{
free(pv);
HeapFree(GetProcessHeap(), 0, pv);
}
static INT_PTR sc_cb_open(char *pszFile, int oflag, int pmode)
@ -523,10 +523,10 @@ BOOL WINAPI SetupIterateCabinetA(PCSTR CabinetFile, DWORD Reserved,
BOOL ret;
TRACE("(CabinetFile == %s, Reserved == %lu, MsgHandler == ^%p, Context == ^%p)\n",
TRACE("(CabinetFile == %s, Reserved == %u, MsgHandler == ^%p, Context == ^%p)\n",
debugstr_a(CabinetFile), Reserved, MsgHandler, Context);
if (! LoadCABINETDll())
if (! LoadCABINETDll())
return FALSE;
memset(&my_hsc, 0, sizeof(SC_HSC_A));
@ -588,7 +588,7 @@ BOOL WINAPI SetupIterateCabinetW(PCWSTR CabinetFile, DWORD Reserved,
DWORD fpnsize;
BOOL ret;
TRACE("(CabinetFile == %s, Reserved == %lu, MsgHandler == ^%p, Context == ^%p)\n",
TRACE("(CabinetFile == %s, Reserved == %u, MsgHandler == ^%p, Context == ^%p)\n",
debugstr_w(CabinetFile), Reserved, MsgHandler, Context);
if (!LoadCABINETDll())

View file

@ -39,8 +39,6 @@ typedef struct _STRING_TABLE
DWORD dwMaxDataSize;
} STRING_TABLE, *PSTRING_TABLE;
WCHAR empty[] = {0};
/**************************************************************************
* StringTableInitialize [SETUPAPI.@]
@ -111,11 +109,7 @@ StringTableInitializeEx(DWORD dwMaxExtraDataSize,
TRACE("\n");
pStringTable = MyMalloc(sizeof(STRING_TABLE));
if (pStringTable == NULL)
{
ERR("Invalid hStringTable!\n");
return NULL;
}
if (pStringTable == NULL) return NULL;
memset(pStringTable, 0, sizeof(STRING_TABLE));
@ -155,7 +149,7 @@ StringTableDestroy(HSTRING_TABLE hStringTable)
PSTRING_TABLE pStringTable;
DWORD i;
TRACE("%p\n", (PVOID)hStringTable);
TRACE("%p\n", hStringTable);
pStringTable = (PSTRING_TABLE)hStringTable;
if (pStringTable == NULL)
@ -165,18 +159,12 @@ StringTableDestroy(HSTRING_TABLE hStringTable)
{
for (i = 0; i < pStringTable->dwMaxSlots; i++)
{
if (pStringTable->pSlots[i].pString != NULL)
{
MyFree(pStringTable->pSlots[i].pString);
pStringTable->pSlots[i].pString = NULL;
}
MyFree(pStringTable->pSlots[i].pString);
pStringTable->pSlots[i].pString = NULL;
if (pStringTable->pSlots[i].pData != NULL)
{
MyFree(pStringTable->pSlots[i].pData);
pStringTable->pSlots[i].pData = NULL;
pStringTable->pSlots[i].dwSize = 0;
}
MyFree(pStringTable->pSlots[i].pData);
pStringTable->pSlots[i].pData = NULL;
pStringTable->pSlots[i].dwSize = 0;
}
MyFree(pStringTable->pSlots);
@ -214,7 +202,7 @@ StringTableAddString(HSTRING_TABLE hStringTable,
PSTRING_TABLE pStringTable;
DWORD i;
TRACE("%p %s %lx\n", (PVOID)hStringTable, debugstr_w(lpString), dwFlags);
TRACE("%p %s %x\n", hStringTable, debugstr_w(lpString), dwFlags);
pStringTable = (PSTRING_TABLE)hStringTable;
if (pStringTable == NULL)
@ -422,7 +410,7 @@ StringTableDuplicate(HSTRING_TABLE hStringTable)
DWORD i;
DWORD length;
TRACE("%p\n", (PVOID)hStringTable);
TRACE("%p\n", hStringTable);
pSourceTable = (PSTRING_TABLE)hStringTable;
if (pSourceTable == NULL)
@ -508,8 +496,8 @@ StringTableGetExtraData(HSTRING_TABLE hStringTable,
{
PSTRING_TABLE pStringTable;
TRACE("%p %lx %p %lu\n",
(PVOID)hStringTable, dwId, lpExtraData, dwExtraDataSize);
TRACE("%p %x %p %u\n",
hStringTable, dwId, lpExtraData, dwExtraDataSize);
pStringTable = (PSTRING_TABLE)hStringTable;
if (pStringTable == NULL)
@ -561,7 +549,7 @@ StringTableLookUpString(HSTRING_TABLE hStringTable,
PSTRING_TABLE pStringTable;
DWORD i;
TRACE("%p %s %lx\n", (PVOID)hStringTable, debugstr_w(lpString), dwFlags);
TRACE("%p %s %x\n", hStringTable, debugstr_w(lpString), dwFlags);
pStringTable = (PSTRING_TABLE)hStringTable;
if (pStringTable == NULL)
@ -685,8 +673,8 @@ StringTableSetExtraData(HSTRING_TABLE hStringTable,
{
PSTRING_TABLE pStringTable;
TRACE("%p %lx %p %lu\n",
(PVOID)hStringTable, dwId, lpExtraData, dwExtraDataSize);
TRACE("%p %x %p %u\n",
hStringTable, dwId, lpExtraData, dwExtraDataSize);
pStringTable = (PSTRING_TABLE)hStringTable;
if (pStringTable == NULL)
@ -741,8 +729,9 @@ StringTableStringFromId(HSTRING_TABLE hStringTable,
DWORD dwId)
{
PSTRING_TABLE pStringTable;
static WCHAR empty[] = {0};
TRACE("%p %lx\n", (PVOID)hStringTable, dwId);
TRACE("%p %x\n", hStringTable, dwId);
pStringTable = (PSTRING_TABLE)hStringTable;
if (pStringTable == NULL)
@ -783,8 +772,7 @@ StringTableStringFromIdEx(HSTRING_TABLE hStringTable,
DWORD dwLength;
BOOL bResult = FALSE;
TRACE("%p %lx %p %p\n",
(PVOID)hStringTable, dwId, lpBuffer, lpBufferLength);
TRACE("%p %x %p %p\n", hStringTable, dwId, lpBuffer, lpBufferLength);
pStringTable = (PSTRING_TABLE)hStringTable;
if (pStringTable == NULL)
@ -829,5 +817,5 @@ StringTableStringFromIdEx(HSTRING_TABLE hStringTable,
VOID WINAPI
StringTableTrim(HSTRING_TABLE hStringTable)
{
FIXME("%p\n", (PVOID)hStringTable);
FIXME("%p\n", hStringTable);
}