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 )) if (!SHGetSpecialFolderPathW( NULL, buffer, csidl, TRUE ))
{ {
FIXME( "CSIDL %lx not found\n", csidl ); FIXME( "CSIDL %x not found\n", csidl );
return get_unknown_dirid(); return get_unknown_dirid();
} }
len = (strlenW(buffer) + 1) * sizeof(WCHAR); len = (strlenW(buffer) + 1) * sizeof(WCHAR);

View file

@ -156,9 +156,9 @@ static BOOL copy_files_callback( HINF hinf, PCWSTR field, void *arg )
struct files_callback_info *info = arg; struct files_callback_info *info = arg;
if (field[0] == '@') /* special case: copy single file */ 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 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; return TRUE;
} }
@ -319,7 +319,7 @@ static BOOL do_reg_operation( HKEY hkey, const WCHAR *value, INFCONTEXT *context
} }
else RegDeleteValueW( hkey, value ); else RegDeleteValueW( hkey, value );
} }
else RegDeleteKeyW( hkey, NULL ); else NtDeleteKey( hkey );
return TRUE; return TRUE;
} }
@ -379,7 +379,7 @@ static BOOL do_reg_operation( HKEY hkey, const WCHAR *value, INFCONTEXT *context
if (type == REG_DWORD) if (type == REG_DWORD)
{ {
DWORD dw = str ? strtoulW( str, NULL, 0 ) : 0; 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) ); RegSetValueExW( hkey, value, 0, type, (BYTE *)&dw, sizeof(dw) );
} }
else else
@ -399,7 +399,7 @@ static BOOL do_reg_operation( HKEY hkey, const WCHAR *value, INFCONTEXT *context
if (size) if (size)
{ {
if (!(data = HeapAlloc( GetProcessHeap(), 0, size ))) return FALSE; 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 ); SetupGetBinaryField( context, 5, data, size, NULL );
} }
RegSetValueExW( hkey, value, 0, type, data, size ); 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)) 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.FailureCode = SPREG_REGSVR;
status.Win32Error = res; status.Win32Error = res;
goto done; goto done;
@ -642,7 +642,7 @@ static BOOL do_register_dll( const struct register_dll_info *info, const WCHAR *
if (FAILED(res)) 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.FailureCode = SPREG_REGSVR;
status.Win32Error = res; status.Win32Error = res;
goto done; goto done;
@ -1163,7 +1163,7 @@ static BOOL iterate_section_fields( HINF hinf, PCWSTR section, PCWSTR key,
goto done; goto done;
if (!callback( hinf, buffer, arg )) 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() ); debugstr_w(section), debugstr_w(buffer), GetLastError() );
goto done; 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 ) 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; void *callback_context;
UINT mode; UINT mode;
HINF hinf; HINF hinf;
TRACE("hwnd %p, handle %p, cmdline %s\n", hwnd, handle, debugstr_w(cmdline)); 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; if (!(s = strchrW( section, ' ' ))) return;
*p++ = 0; *s++ = 0;
while (*p == ' ') p++; while (*s == ' ') s++;
mode = atoiW( p ); mode = atoiW( s );
if (!(p = strchrW( p, ' ' ))) return; /* quoted paths are not allowed on native, the rest of the command line is taken as the path */
path = p + 1; if (!(s = strchrW( s, ' ' ))) return;
while (*path == ' ') path++; while (*s == ' ') s++;
path = s;
hinf = SetupOpenInfFileW( path, NULL, INF_STYLE_WIN4, NULL ); hinf = SetupOpenInfFileW( path, NULL, INF_STYLE_WIN4, NULL );
if (hinf == INVALID_HANDLE_VALUE) return; 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 ); 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 ); NULL, NULL, NULL, NULL );
} }
/*********************************************************************** /***********************************************************************
* SetupInstallServicesFromInfSectionExA (SETUPAPI.@) * SetupInstallServicesFromInfSectionExA (SETUPAPI.@)
*/ */

View file

@ -757,8 +757,7 @@ DWORD WINAPI TakeOwnershipOfFile(LPCWSTR lpFileName)
fail:; fail:;
dwError = GetLastError(); dwError = GetLastError();
if (pOwner != NULL) MyFree(pOwner);
MyFree(pOwner);
if (hToken != NULL) if (hToken != NULL)
CloseHandle(hToken); CloseHandle(hToken);
@ -826,18 +825,36 @@ DWORD WINAPI RetreiveFileSecurity(LPCWSTR lpFileName,
} }
/************************************************************************** static DWORD global_flags = 0; /* FIXME: what should be in here? */
* AssertFail [SETUPAPI.@]
/***********************************************************************
* 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 * PARAMS
* lpFile [I] File name * lpFile [I] file where assert failed
* uLine [I] Line number * uLine [I] line number in file
* lpMessage [I] Assertion message * lpMessage [I] assert message
* *
* RETURNS
* Nothing
*/ */
VOID WINAPI AssertFail(LPSTR lpFile, UINT uLine, LPSTR lpMessage) 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; DWORD nb_chars = 0;
LPSTR nameA; 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); source_size, target_size, type);
if (!source || !(sourceW = MultiByteToUnicode( source, CP_ACP ))) return FALSE; 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; BOOL ret = FALSE;
DWORD source_len; 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); source_size, target_size, type);
if (!source) return FALSE; 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; if ((error = LZCopy( src, dst )) >= 0) ret = ERROR_SUCCESS;
else else
{ {
WARN("failed to decompress file %ld\n", error); WARN("failed to decompress file %d\n", error);
ret = ERROR_INVALID_DATA; 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) */ /* 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, '\\' ); const WCHAR *p = strrchrW( file->filename, '\\' );
*len = p ? (p + 1 - file->filename) : 0; *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 */ /* 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; 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 */ /* 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; 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 */ /* retrieve the string substitution for a given string, or NULL if not found */
/* if found, len is set to the substitution length */ /* 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 = '%'; 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_str[*len] = 0;
dirid = strtolW( dirid_str, &end, 10 ); dirid = strtolW( dirid_str, &end, 10 );
if (!*end) ret = get_dirid_subst( file, dirid, len ); 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 ); HeapFree( GetProcessHeap(), 0, dirid_str );
return ret; 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 */ /* do string substitutions on the specified text */
/* the buffer is assumed to be large enough */ /* the buffer is assumed to be large enough */
/* returns necessary length not including terminating null */ /* 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 ) unsigned int size )
{ {
const WCHAR *start, *subst, *p; 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 */ else /* end of the %xx% string, find substitution */
{ {
len = p - start - 1; len = p - start - 1;
subst = get_string_subst( file, start + 1, &len ); subst = get_string_subst( file, start + 1, &len, p[1] == '\\' );
if (!subst) if (!subst)
{ {
subst = start; 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 */ /* do string substitutions on the specified text */
/* the buffer is assumed to be large enough */ /* the buffer is assumed to be large enough */
/* returns necessary length not including terminating null */ /* 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 ) unsigned int size )
{ {
WCHAR buffW[MAX_STRING_LEN+1]; 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 */ /* 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); return (ptr >= parser->end || *ptr == CONTROL_Z);
} }
/* check if the pointer points to an end of line */ /* 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'); return (ptr >= parser->end || *ptr == CONTROL_Z || *ptr == '\n');
} }
@ -1044,7 +1046,7 @@ WCHAR *PARSER_get_dest_dir( INFCONTEXT *context )
const WCHAR *dir; const WCHAR *dir;
WCHAR *ptr, *ret; WCHAR *ptr, *ret;
INT dirid; INT dirid;
unsigned int len1 = 0; unsigned int len1;
DWORD len2; DWORD len2;
if (!SetupGetIntField( context, 1, &dirid )) return NULL; if (!SetupGetIntField( context, 1, &dirid )) return NULL;
@ -1321,16 +1323,14 @@ void WINAPI SetupCloseInfFile( HINF hinf )
struct inf_file *file = hinf; struct inf_file *file = hinf;
unsigned int i; unsigned int i;
if (file != NULL && file != INVALID_HANDLE_VALUE) if (!hinf || (hinf == INVALID_HANDLE_VALUE)) return;
{
for (i = 0; i < file->nb_sections; i++) for (i = 0; i < file->nb_sections; i++) HeapFree( GetProcessHeap(), 0, file->sections[i] );
HeapFree( GetProcessHeap(), 0, file->sections[i] ); HeapFree( GetProcessHeap(), 0, file->filename );
HeapFree( GetProcessHeap(), 0, file->filename ); HeapFree( GetProcessHeap(), 0, file->sections );
HeapFree( GetProcessHeap(), 0, file->sections ); HeapFree( GetProcessHeap(), 0, file->fields );
HeapFree( GetProcessHeap(), 0, file->fields ); HeapFree( GetProcessHeap(), 0, file->strings );
HeapFree( GetProcessHeap(), 0, file->strings ); HeapFree( GetProcessHeap(), 0, file );
HeapFree( GetProcessHeap(), 0, file );
}
} }
@ -1362,16 +1362,13 @@ LONG WINAPI SetupGetLineCountW( HINF hinf, PCWSTR section )
int section_index; int section_index;
LONG ret = -1; LONG ret = -1;
if (hinf == NULL || hinf == INVALID_HANDLE_VALUE)
return ERROR_INVALID_PARAMETER;
for (file = hinf; file; file = file->next) for (file = hinf; file; file = file->next)
{ {
if ((section_index = find_section( file, section )) == -1) continue; if ((section_index = find_section( file, section )) == -1) continue;
if (ret == -1) ret = 0; if (ret == -1) ret = 0;
ret += file->sections[section_index]->nb_lines; 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 ); SetLastError( (ret == -1) ? ERROR_SECTION_NOT_FOUND : 0 );
return ret; return ret;
} }
@ -1404,12 +1401,6 @@ BOOL WINAPI SetupGetLineByIndexW( HINF hinf, PCWSTR section, DWORD index, INFCON
struct inf_file *file = hinf; struct inf_file *file = hinf;
int section_index; int section_index;
if (hinf == NULL || hinf == INVALID_HANDLE_VALUE)
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
SetLastError( ERROR_SECTION_NOT_FOUND ); SetLastError( ERROR_SECTION_NOT_FOUND );
for (file = hinf; file; file = file->next) 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->Section = section_index;
context->Line = index; context->Line = index;
SetLastError( 0 ); SetLastError( 0 );
TRACE( "(%p,%s): returning %d/%ld\n", TRACE( "(%p,%s): returning %d/%d\n",
hinf, debugstr_w(section), section_index, index ); hinf, debugstr_w(section), section_index, index );
return TRUE; return TRUE;
} }
@ -1470,12 +1461,6 @@ BOOL WINAPI SetupFindFirstLineW( HINF hinf, PCWSTR section, PCWSTR key, INFCONTE
struct inf_file *file; struct inf_file *file;
int section_index; int section_index;
if (hinf == NULL || hinf == INVALID_HANDLE_VALUE)
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
SetLastError( ERROR_SECTION_NOT_FOUND ); SetLastError( ERROR_SECTION_NOT_FOUND );
for (file = hinf; file; file = file->next) 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 ); 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, context->Inf, context->CurrentInf, context->Section, context->Line,
index, debugstr_a(buffer) ); 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 ); 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, context->Inf, context->CurrentInf, context->Section, context->Line,
index, debugstr_w(buffer) ); index, debugstr_w(buffer) );
} }
@ -1888,7 +1873,7 @@ BOOL WINAPI SetupGetBinaryField( PINFCONTEXT context, DWORD index, BYTE *buffer,
} }
if (TRACE_ON(setupapi)) 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 ); context->Inf, context->CurrentInf, context->Section, context->Line, index );
for (i = index; i < line->nb_fields; i++) TRACE( " %02x", buffer[i - index] ); for (i = index; i < line->nb_fields; i++) TRACE( " %02x", buffer[i - index] );
TRACE( "\n" ); TRACE( "\n" );

View file

@ -126,7 +126,7 @@ BOOL WINAPI SetupGetInfInformationW(LPCVOID InfSpec, DWORD SearchControl,
BOOL ret; BOOL ret;
DWORD infSize; DWORD infSize;
TRACE("(%p, %ld, %p, %ld, %p)\n", InfSpec, SearchControl, ReturnBuffer, TRACE("(%p, %d, %p, %d, %p)\n", InfSpec, SearchControl, ReturnBuffer,
ReturnBufferSize, RequiredSize); ReturnBufferSize, RequiredSize);
if (!InfSpec) if (!InfSpec)
@ -153,7 +153,7 @@ BOOL WINAPI SetupGetInfInformationW(LPCVOID InfSpec, DWORD SearchControl,
inf = search_for_inf(InfSpec, SearchControl); inf = search_for_inf(InfSpec, SearchControl);
break; break;
case INFINFO_INF_PATH_LIST_SEARCH: case INFINFO_INF_PATH_LIST_SEARCH:
FIXME("Unhandled search control: %ld\n", SearchControl); FIXME("Unhandled search control: %d\n", SearchControl);
if (RequiredSize) if (RequiredSize)
*RequiredSize = 0; *RequiredSize = 0;
@ -214,6 +214,7 @@ BOOL WINAPI SetupQueryInfFileInformationA(PSP_INF_INFORMATION InfInformation,
if (!ReturnBuffer) if (!ReturnBuffer)
{ {
HeapFree(GetProcessHeap(), 0, filenameW);
if (ReturnBufferSize) if (ReturnBufferSize)
{ {
SetLastError(ERROR_INVALID_PARAMETER); SetLastError(ERROR_INVALID_PARAMETER);
@ -225,6 +226,7 @@ BOOL WINAPI SetupQueryInfFileInformationA(PSP_INF_INFORMATION InfInformation,
if (size > ReturnBufferSize) if (size > ReturnBufferSize)
{ {
HeapFree(GetProcessHeap(), 0, filenameW);
SetLastError(ERROR_INSUFFICIENT_BUFFER); SetLastError(ERROR_INSUFFICIENT_BUFFER);
return FALSE; return FALSE;
} }
@ -245,7 +247,7 @@ BOOL WINAPI SetupQueryInfFileInformationW(PSP_INF_INFORMATION InfInformation,
DWORD len; DWORD len;
LPWSTR ptr; 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); ReturnBuffer, ReturnBufferSize, RequiredSize);
if (!InfInformation) if (!InfInformation)
@ -289,7 +291,7 @@ BOOL WINAPI SetupGetSourceFileLocationA( HINF hinf, PINFCONTEXT context, PCSTR f
DWORD required; DWORD required;
INT size; 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); buffer, buffer_size, required_size);
if (filename && *filename && !(filenameW = strdupAtoW( filename ))) 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]; WCHAR Section[MAX_PATH];
DWORD size; DWORD size;
LPWSTR source_id; LPWSTR source_id;
BOOL ret;
ret = SetupDiGetActualSectionToInstallW(hinf, source_disks_files, Section, MAX_PATH, NULL, NULL); if (!SetupDiGetActualSectionToInstallW(hinf, source_disks_files, Section, MAX_PATH, NULL, NULL))
if (!ret)
return NULL; return NULL;
if (!SetupFindFirstLineW( hinf, Section, filename, context ) && if (!SetupFindFirstLineW( hinf, Section, filename, context ) &&
@ -352,8 +352,7 @@ static LPWSTR get_source_id( HINF hinf, PINFCONTEXT context, PCWSTR filename )
return NULL; return NULL;
} }
ret = SetupDiGetActualSectionToInstallW(hinf, source_disks_names, Section, MAX_PATH, NULL, NULL); if (!SetupDiGetActualSectionToInstallW(hinf, source_disks_names, Section, MAX_PATH, NULL, NULL))
if (!ret)
return NULL; return NULL;
if (!SetupFindFirstLineW( hinf, Section, source_id, context ) && if (!SetupFindFirstLineW( hinf, Section, source_id, context ) &&
@ -376,7 +375,7 @@ BOOL WINAPI SetupGetSourceFileLocationW( HINF hinf, PINFCONTEXT context, PCWSTR
INFCONTEXT ctx; INFCONTEXT ctx;
WCHAR *end, *source_id_str; 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); buffer, buffer_size, required_size);
if (!context) context = &ctx; if (!context) context = &ctx;
@ -420,7 +419,7 @@ BOOL WINAPI SetupGetSourceInfoA( HINF hinf, UINT source_id, UINT info,
DWORD required; DWORD required;
INT size; 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); required_size);
if (!SetupGetSourceInfoW( hinf, source_id, info, NULL, 0, &required )) 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]; WCHAR source_id_str[11];
static const WCHAR fmt[] = {'%','d',0}; static const WCHAR fmt[] = {'%','d',0};
DWORD index; 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); required_size);
sprintfW( source_id_str, fmt, source_id ); sprintfW( source_id_str, fmt, source_id );
ret = SetupDiGetActualSectionToInstallW(hinf, source_disks_names, Section, MAX_PATH, NULL, NULL); if (!SetupDiGetActualSectionToInstallW(hinf, source_disks_names, Section, MAX_PATH, NULL, NULL))
if (!ret)
return FALSE; return FALSE;
if (!SetupFindFirstLineW( hinf, Section, source_id_str, &ctx ) && if (!SetupFindFirstLineW( hinf, Section, source_id_str, &ctx ) &&
@ -517,7 +514,7 @@ BOOL WINAPI SetupGetTargetPathA( HINF hinf, PINFCONTEXT context, PCSTR section,
DWORD required; DWORD required;
INT size; 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); buffer_size, required_size);
if (section && !(sectionW = strdupAtoW( section ))) if (section && !(sectionW = strdupAtoW( section )))
@ -569,7 +566,7 @@ BOOL WINAPI SetupGetTargetPathW( HINF hinf, PINFCONTEXT context, PCWSTR section,
WCHAR *dir; WCHAR *dir;
INT size; 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); buffer_size, required_size);
if (context && !SetupFindFirstLineW( hinf, destination_dirs, NULL, context )) return FALSE; if (context && !SetupFindFirstLineW( hinf, destination_dirs, NULL, context )) return FALSE;
@ -612,7 +609,7 @@ BOOL WINAPI SetupQueryInfOriginalFileInformationA(
if (OriginalFileInfo->cbSize != sizeof(*OriginalFileInfo)) 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 ); SetLastError( ERROR_INVALID_USER_BUFFER );
return FALSE; return FALSE;
} }
@ -622,9 +619,9 @@ BOOL WINAPI SetupQueryInfOriginalFileInformationA(
AlternativePlatformInfo, &OriginalFileInfoW); AlternativePlatformInfo, &OriginalFileInfoW);
if (ret) if (ret)
{ {
WideCharToMultiByte(CP_ACP, 0, OriginalFileInfoW.OriginalInfName, MAX_PATH, WideCharToMultiByte(CP_ACP, 0, OriginalFileInfoW.OriginalInfName, -1,
OriginalFileInfo->OriginalInfName, MAX_PATH, NULL, NULL); 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); 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 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 }; 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, FIXME("(%p, %d, %p, %p): semi-stub\n", InfInformation, InfIndex,
AlternativePlatformInfo, OriginalFileInfo); AlternativePlatformInfo, OriginalFileInfo);
if (OriginalFileInfo->cbSize != sizeof(*OriginalFileInfo)) if (OriginalFileInfo->cbSize != sizeof(*OriginalFileInfo))
{ {
ERR("incorrect OriginalFileInfo->cbSize of %lu\n", OriginalFileInfo->cbSize); WARN("incorrect OriginalFileInfo->cbSize of %d\n", OriginalFileInfo->cbSize);
return ERROR_INVALID_USER_BUFFER; SetLastError(ERROR_INVALID_USER_BUFFER);
return FALSE;
} }
inf_path = (LPWSTR)&InfInformation->VersionData[0]; inf_path = (LPWSTR)&InfInformation->VersionData[0];

View file

@ -35,15 +35,15 @@ struct default_callback_context
struct file_op struct file_op
{ {
struct file_op *next; struct file_op *next;
UINT style; UINT style;
WCHAR *src_root; WCHAR *src_root;
WCHAR *src_path; WCHAR *src_path;
WCHAR *src_file; WCHAR *src_file;
WCHAR *src_descr; WCHAR *src_descr;
WCHAR *src_tag; WCHAR *src_tag;
WCHAR *dst_path; WCHAR *dst_path;
WCHAR *dst_file; WCHAR *dst_file;
PSECURITY_DESCRIPTOR dst_sd; PSECURITY_DESCRIPTOR dst_sd;
}; };
@ -207,6 +207,7 @@ UINT CALLBACK QUEUE_callback_WtoA( void *context, UINT notification,
case SPFILENOTIFY_RENAMEERROR: case SPFILENOTIFY_RENAMEERROR:
case SPFILENOTIFY_STARTCOPY: case SPFILENOTIFY_STARTCOPY:
case SPFILENOTIFY_ENDCOPY: case SPFILENOTIFY_ENDCOPY:
case SPFILENOTIFY_QUEUESCAN_EX:
{ {
FILEPATHS_W *pathsW = (FILEPATHS_W *)param1; FILEPATHS_W *pathsW = (FILEPATHS_W *)param1;
FILEPATHS_A pathsA; FILEPATHS_A pathsA;
@ -240,8 +241,18 @@ UINT CALLBACK QUEUE_callback_WtoA( void *context, UINT notification,
} }
break; break;
case SPFILENOTIFY_NEEDMEDIA:
case SPFILENOTIFY_QUEUESCAN: 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); FIXME("mapping for %d not implemented\n",notification);
case SPFILENOTIFY_STARTQUEUE: case SPFILENOTIFY_STARTQUEUE:
case SPFILENOTIFY_ENDQUEUE: case SPFILENOTIFY_ENDQUEUE:
@ -963,12 +974,13 @@ static BOOL create_full_pathW(const WCHAR *path)
return ret; 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 rc = FALSE;
BOOL docopy = TRUE; 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 */ /* before copy processing */
if (style & SP_COPY_REPLACEONLY) 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); VersionSizeTarget = GetFileVersionInfoSizeW((LPWSTR)target,&zero);
} }
TRACE("SizeTarget %li ... SizeSource %li\n",VersionSizeTarget, TRACE("SizeTarget %i ... SizeSource %i\n",VersionSizeTarget,
VersionSizeSource); VersionSizeSource);
if (VersionSizeSource && VersionSizeTarget) if (VersionSizeSource && VersionSizeTarget)
@ -1030,20 +1042,32 @@ static BOOL do_file_copyW( LPCWSTR source, LPCWSTR target, DWORD style)
if (ret) 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, SourceInfo->dwFileVersionMS, SourceInfo->dwFileVersionLS,
TargetInfo->dwFileVersionMS, TargetInfo->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) if (TargetInfo->dwFileVersionMS > SourceInfo->dwFileVersionMS)
{ {
FIXME("Notify that target version is greater..\n"); if (handler)
docopy = FALSE; docopy = handler (context, SPFILENOTIFY_TARGETNEWER, (UINT_PTR)&filepaths, 0);
else
docopy = FALSE;
} }
else if ((TargetInfo->dwFileVersionMS == SourceInfo->dwFileVersionMS) else if ((TargetInfo->dwFileVersionMS == SourceInfo->dwFileVersionMS)
&& (TargetInfo->dwFileVersionLS > SourceInfo->dwFileVersionLS)) && (TargetInfo->dwFileVersionLS > SourceInfo->dwFileVersionLS))
{ {
FIXME("Notify that target version is greater..\n"); if (handler)
docopy = FALSE; docopy = handler (context, SPFILENOTIFY_TARGETNEWER, (UINT_PTR)&filepaths, 0);
else
docopy = FALSE;
} }
else if ((style & SP_COPY_NEWER_ONLY) && else if ((style & SP_COPY_NEWER_ONLY) &&
(TargetInfo->dwFileVersionMS == (TargetInfo->dwFileVersionMS ==
@ -1051,8 +1075,10 @@ static BOOL do_file_copyW( LPCWSTR source, LPCWSTR target, DWORD style)
&&(TargetInfo->dwFileVersionLS == &&(TargetInfo->dwFileVersionLS ==
SourceInfo->dwFileVersionLS)) SourceInfo->dwFileVersionLS))
{ {
FIXME("Notify that target version is greater..\n"); if (handler)
docopy = FALSE; 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 | 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)) 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) 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) if (!queue->copy_queue.count && !queue->delete_queue.count && !queue->rename_queue.count)
return TRUE; /* nothing to do */ 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 */ /* 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, 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 */ /* try to extract it from the cabinet file */
if (op->src_tag) if (op->src_tag)
{ {
@ -1238,11 +1264,17 @@ BOOL WINAPI SetupCommitFileQueueW( HWND owner, HSPFILEQ handle, PSP_FILE_CALLBAC
/*********************************************************************** /***********************************************************************
* SetupScanFileQueueA (SETUPAPI.@) * SetupScanFileQueueA (SETUPAPI.@)
*/ */
BOOL WINAPI SetupScanFileQueueA( HSPFILEQ queue, DWORD flags, HWND window, BOOL WINAPI SetupScanFileQueueA( HSPFILEQ handle, DWORD flags, HWND window,
PSP_FILE_CALLBACK_A callback, PVOID context, PDWORD result ) PSP_FILE_CALLBACK_A handler, PVOID context, PDWORD result )
{ {
FIXME("stub\n"); struct callback_WtoA_context ctx;
return FALSE;
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.@) * SetupScanFileQueueW (SETUPAPI.@)
*/ */
BOOL WINAPI SetupScanFileQueueW( HSPFILEQ handle, DWORD flags, HWND window, 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_queue *queue = handle;
struct file_op *op; struct file_op *op;
BOOL allnodesprocessed = FALSE;
FILEPATHS_W paths; 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; *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 ); case SPFILENOTIFY_QUEUESCAN:
if (flags & SPQ_SCAN_USE_CALLBACK) /* FIXME: handle delay flag */
{ if (handler( context, notification, (UINT_PTR)paths.Target, 0 )) goto done;
/* FIXME: sometimes set param 2 to SPQ_DELAYED_COPY */ break;
if (NO_ERROR != callback( context, SPFILENOTIFY_QUEUESCAN, (UINT)paths.Target, 0 )) case SPFILENOTIFY_QUEUESCAN_EX:
goto done; if (handler( context, notification, (UINT_PTR)&paths, 0 )) goto done;
} break;
default:
ret = TRUE; goto done;
} }
} }
*result = TRUE; *result = TRUE;
allnodesprocessed = TRUE;
done: done:
HeapFree( GetProcessHeap(), 0, (void *)paths.Source ); HeapFree( GetProcessHeap(), 0, (void *)paths.Source );
HeapFree( GetProcessHeap(), 0, (void *)paths.Target ); 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" ); TRACE( "end queue\n" );
return 0; return 0;
case SPFILENOTIFY_STARTSUBQUEUE: case SPFILENOTIFY_STARTSUBQUEUE:
TRACE( "start subqueue %d count %d\n", param1, param2 ); TRACE( "start subqueue %ld count %ld\n", param1, param2 );
return TRUE; return TRUE;
case SPFILENOTIFY_ENDSUBQUEUE: case SPFILENOTIFY_ENDSUBQUEUE:
TRACE( "end subqueue %d\n", param1 ); TRACE( "end subqueue %ld\n", param1 );
return 0; return 0;
case SPFILENOTIFY_STARTDELETE: case SPFILENOTIFY_STARTDELETE:
TRACE( "start delete %s\n", debugstr_a(paths->Target) ); TRACE( "start delete %s\n", debugstr_a(paths->Target) );
@ -1447,7 +1490,7 @@ UINT WINAPI SetupDefaultQueueCallbackA( PVOID context, UINT notification,
TRACE( "need media\n" ); TRACE( "need media\n" );
return FILEOP_SKIP; return FILEOP_SKIP;
default: default:
FIXME( "notification %d params %x,%x\n", notification, param1, param2 ); FIXME( "notification %d params %lx,%lx\n", notification, param1, param2 );
break; break;
} }
return 0; return 0;
@ -1472,10 +1515,10 @@ UINT WINAPI SetupDefaultQueueCallbackW( PVOID context, UINT notification,
TRACE( "end queue\n" ); TRACE( "end queue\n" );
return 0; return 0;
case SPFILENOTIFY_STARTSUBQUEUE: case SPFILENOTIFY_STARTSUBQUEUE:
TRACE( "start subqueue %d count %d\n", param1, param2 ); TRACE( "start subqueue %ld count %ld\n", param1, param2 );
return TRUE; return TRUE;
case SPFILENOTIFY_ENDSUBQUEUE: case SPFILENOTIFY_ENDSUBQUEUE:
TRACE( "end subqueue %d\n", param1 ); TRACE( "end subqueue %ld\n", param1 );
return 0; return 0;
case SPFILENOTIFY_STARTDELETE: case SPFILENOTIFY_STARTDELETE:
TRACE( "start delete %s\n", debugstr_w(paths->Target) ); TRACE( "start delete %s\n", debugstr_w(paths->Target) );
@ -1512,7 +1555,7 @@ UINT WINAPI SetupDefaultQueueCallbackW( PVOID context, UINT notification,
TRACE( "need media\n" ); TRACE( "need media\n" );
return FILEOP_SKIP; return FILEOP_SKIP;
default: default:
FIXME( "notification %d params %x,%x\n", notification, param1, param2 ); FIXME( "notification %d params %lx,%lx\n", notification, param1, param2 );
break; break;
} }
return 0; return 0;
@ -1594,3 +1637,22 @@ UINT WINAPI SetupCopyErrorW( HWND parent, PCWSTR dialogTitle, PCWSTR diskname,
w32error, debugstr_w(sourcefile), debugstr_w(sourcepath) ,debugstr_w(targetpath)); w32error, debugstr_w(sourcefile), debugstr_w(sourcepath) ,debugstr_w(targetpath));
return DPROMPT_SKIPFILE; 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 SetupDiCreateDevRegKeyA(ptr ptr long long long ptr str)
@ stdcall SetupDiCreateDevRegKeyW(ptr ptr long long long ptr wstr) @ stdcall SetupDiCreateDevRegKeyW(ptr ptr long long long ptr wstr)
@ stdcall SetupDiCreateDeviceInfoA(ptr str ptr str ptr long ptr) @ stdcall SetupDiCreateDeviceInfoA(ptr str ptr str ptr long ptr)
@ stdcall SetupDiCreateDeviceInfoW(ptr wstr ptr wstr ptr long ptr)
@ stdcall SetupDiCreateDeviceInfoList(ptr ptr) @ stdcall SetupDiCreateDeviceInfoList(ptr ptr)
@ stdcall SetupDiCreateDeviceInfoListExA(ptr long str ptr) @ stdcall SetupDiCreateDeviceInfoListExA(ptr long str ptr)
@ stdcall SetupDiCreateDeviceInfoListExW(ptr long wstr 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 SetupDiDeleteDevRegKey(ptr ptr long long long)
@ stdcall SetupDiDeleteDeviceInfo(long ptr) @ stdcall SetupDiDeleteDeviceInfo(long ptr)
@ stub SetupDiDeleteDeviceInterfaceData @ stub SetupDiDeleteDeviceInterfaceData
@ -328,15 +332,15 @@
@ stdcall SetupDiGetDeviceInstallParamsW(ptr ptr ptr) @ stdcall SetupDiGetDeviceInstallParamsW(ptr ptr ptr)
@ stdcall SetupDiGetDeviceInstanceIdA(ptr ptr str long ptr) @ stdcall SetupDiGetDeviceInstanceIdA(ptr ptr str long ptr)
@ stdcall SetupDiGetDeviceInstanceIdW(ptr ptr wstr 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 SetupDiGetDeviceRegistryPropertyA(long ptr long ptr ptr long ptr)
@ stdcall SetupDiGetDeviceRegistryPropertyW(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 SetupDiGetDriverInfoDetailA(ptr ptr ptr ptr long ptr)
@ stdcall SetupDiGetDriverInfoDetailW(ptr ptr ptr ptr long ptr) @ stdcall SetupDiGetDriverInfoDetailW(ptr ptr ptr ptr long ptr)
@ stub SetupDiGetDriverInstallParamsA @ stub SetupDiGetDriverInstallParamsA
@ stdcall SetupDiGetDriverInstallParamsW(ptr ptr ptr ptr) @ 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 SetupDiGetHwProfileFriendlyNameA
@ stub SetupDiGetHwProfileFriendlyNameExA @ stub SetupDiGetHwProfileFriendlyNameExA
@ stub SetupDiGetHwProfileFriendlyNameExW @ stub SetupDiGetHwProfileFriendlyNameExW
@ -548,15 +552,15 @@
@ stub pSetupDestroyRunOnceNodeList @ stub pSetupDestroyRunOnceNodeList
@ stub pSetupDirectoryIdToPath @ stub pSetupDirectoryIdToPath
@ stdcall pSetupGetField(ptr long) @ stdcall pSetupGetField(ptr long)
@ stub pSetupGetGlobalFlags @ stdcall pSetupGetGlobalFlags()
@ stub pSetupGetOsLoaderDriveAndPath @ stub pSetupGetOsLoaderDriveAndPath
@ stub pSetupGetQueueFlags @ stdcall pSetupGetQueueFlags(ptr)
@ stub pSetupGetVersionDatum @ stub pSetupGetVersionDatum
@ stub pSetupGuidFromString @ stub pSetupGuidFromString
@ stub pSetupIsGuidNull @ stub pSetupIsGuidNull
@ stub pSetupMakeSurePathExists @ stub pSetupMakeSurePathExists
@ stub pSetupSetGlobalFlags @ stdcall pSetupSetGlobalFlags(long)
@ stub pSetupSetQueueFlags @ stdcall pSetupSetQueueFlags(ptr long)
@ stub pSetupSetSystemSourceFlags @ stub pSetupSetSystemSourceFlags
@ stub pSetupStringFromGuid @ stub pSetupStringFromGuid
@ stub pSetupVerifyQueuedCatalogs @ stub pSetupVerifyQueuedCatalogs

View file

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

View file

@ -87,12 +87,12 @@ static void UnloadCABINETDll(void)
static void *sc_cb_alloc(ULONG cb) static void *sc_cb_alloc(ULONG cb)
{ {
return malloc(cb); return HeapAlloc(GetProcessHeap(), 0, cb);
} }
static void sc_cb_free(void *pv) 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) static INT_PTR sc_cb_open(char *pszFile, int oflag, int pmode)
@ -523,7 +523,7 @@ BOOL WINAPI SetupIterateCabinetA(PCSTR CabinetFile, DWORD Reserved,
BOOL ret; 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); debugstr_a(CabinetFile), Reserved, MsgHandler, Context);
if (! LoadCABINETDll()) if (! LoadCABINETDll())
@ -588,7 +588,7 @@ BOOL WINAPI SetupIterateCabinetW(PCWSTR CabinetFile, DWORD Reserved,
DWORD fpnsize; DWORD fpnsize;
BOOL ret; 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); debugstr_w(CabinetFile), Reserved, MsgHandler, Context);
if (!LoadCABINETDll()) if (!LoadCABINETDll())

View file

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