msi: Declare some functions static.
This commit is contained in:
parent
e1fefd57e7
commit
668197a898
|
@ -598,7 +598,7 @@ done:
|
|||
return r;
|
||||
}
|
||||
|
||||
UINT MSI_DatabaseImport(MSIDATABASE *db, LPCWSTR folder, LPCWSTR file)
|
||||
static UINT MSI_DatabaseImport(MSIDATABASE *db, LPCWSTR folder, LPCWSTR file)
|
||||
{
|
||||
UINT r;
|
||||
DWORD len, i;
|
||||
|
@ -812,7 +812,7 @@ static UINT msi_export_forcecodepage( HANDLE handle )
|
|||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
UINT MSI_DatabaseExport( MSIDATABASE *db, LPCWSTR table,
|
||||
static UINT MSI_DatabaseExport( MSIDATABASE *db, LPCWSTR table,
|
||||
LPCWSTR folder, LPCWSTR file )
|
||||
{
|
||||
static const WCHAR query[] = {
|
||||
|
|
|
@ -3478,6 +3478,38 @@ static LRESULT WINAPI MSIHiddenWindowProc( HWND hwnd, UINT msg,
|
|||
return DefWindowProcW( hwnd, msg, wParam, lParam );
|
||||
}
|
||||
|
||||
static BOOL msi_dialog_register_class( void )
|
||||
{
|
||||
WNDCLASSW cls;
|
||||
|
||||
ZeroMemory( &cls, sizeof cls );
|
||||
cls.lpfnWndProc = MSIDialog_WndProc;
|
||||
cls.hInstance = NULL;
|
||||
cls.hIcon = LoadIconW(0, (LPWSTR)IDI_APPLICATION);
|
||||
cls.hCursor = LoadCursorW(0, (LPWSTR)IDC_ARROW);
|
||||
cls.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1);
|
||||
cls.lpszMenuName = NULL;
|
||||
cls.lpszClassName = szMsiDialogClass;
|
||||
|
||||
if( !RegisterClassW( &cls ) )
|
||||
return FALSE;
|
||||
|
||||
cls.lpfnWndProc = MSIHiddenWindowProc;
|
||||
cls.lpszClassName = szMsiHiddenWindow;
|
||||
|
||||
if( !RegisterClassW( &cls ) )
|
||||
return FALSE;
|
||||
|
||||
uiThreadId = GetCurrentThreadId();
|
||||
|
||||
hMsiHiddenWindow = CreateWindowW( szMsiHiddenWindow, NULL, WS_OVERLAPPED,
|
||||
0, 0, 100, 100, NULL, NULL, NULL, NULL );
|
||||
if( !hMsiHiddenWindow )
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* functions that interface to other modules within MSI */
|
||||
|
||||
msi_dialog *msi_dialog_create( MSIPACKAGE* package,
|
||||
|
@ -3661,38 +3693,6 @@ void msi_dialog_destroy( msi_dialog *dialog )
|
|||
msi_free( dialog );
|
||||
}
|
||||
|
||||
BOOL msi_dialog_register_class( void )
|
||||
{
|
||||
WNDCLASSW cls;
|
||||
|
||||
ZeroMemory( &cls, sizeof cls );
|
||||
cls.lpfnWndProc = MSIDialog_WndProc;
|
||||
cls.hInstance = NULL;
|
||||
cls.hIcon = LoadIconW(0, (LPWSTR)IDI_APPLICATION);
|
||||
cls.hCursor = LoadCursorW(0, (LPWSTR)IDC_ARROW);
|
||||
cls.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1);
|
||||
cls.lpszMenuName = NULL;
|
||||
cls.lpszClassName = szMsiDialogClass;
|
||||
|
||||
if( !RegisterClassW( &cls ) )
|
||||
return FALSE;
|
||||
|
||||
cls.lpfnWndProc = MSIHiddenWindowProc;
|
||||
cls.lpszClassName = szMsiHiddenWindow;
|
||||
|
||||
if( !RegisterClassW( &cls ) )
|
||||
return FALSE;
|
||||
|
||||
uiThreadId = GetCurrentThreadId();
|
||||
|
||||
hMsiHiddenWindow = CreateWindowW( szMsiHiddenWindow, NULL, WS_OVERLAPPED,
|
||||
0, 0, 100, 100, NULL, NULL, NULL, NULL );
|
||||
if( !hMsiHiddenWindow )
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void msi_dialog_unregister_class( void )
|
||||
{
|
||||
DestroyWindow( hMsiHiddenWindow );
|
||||
|
|
|
@ -455,7 +455,7 @@ void msi_free_media_info(MSIMEDIAINFO *mi)
|
|||
msi_free(mi);
|
||||
}
|
||||
|
||||
UINT msi_load_media_info(MSIPACKAGE *package, MSIFILE *file, MSIMEDIAINFO *mi)
|
||||
static UINT msi_load_media_info(MSIPACKAGE *package, MSIFILE *file, MSIMEDIAINFO *mi)
|
||||
{
|
||||
MSIRECORD *row;
|
||||
LPWSTR source_dir;
|
||||
|
@ -542,7 +542,7 @@ UINT msi_load_media_info(MSIPACKAGE *package, MSIFILE *file, MSIMEDIAINFO *mi)
|
|||
}
|
||||
|
||||
/* FIXME: search NETWORK and URL sources as well */
|
||||
UINT find_published_source(MSIPACKAGE *package, MSIMEDIAINFO *mi)
|
||||
static UINT find_published_source(MSIPACKAGE *package, MSIMEDIAINFO *mi)
|
||||
{
|
||||
WCHAR source[MAX_PATH];
|
||||
WCHAR volume[MAX_PATH];
|
||||
|
|
|
@ -656,10 +656,8 @@ enum StringPersistence
|
|||
|
||||
extern BOOL msi_addstringW( string_table *st, UINT string_no, const WCHAR *data, int len, UINT refcount, enum StringPersistence persistence );
|
||||
extern UINT msi_id2stringW( const string_table *st, UINT string_no, LPWSTR buffer, UINT *sz );
|
||||
extern UINT msi_id2stringA( const string_table *st, UINT string_no, LPSTR buffer, UINT *sz );
|
||||
|
||||
extern UINT msi_string2idW( const string_table *st, LPCWSTR buffer, UINT *id );
|
||||
extern UINT msi_string2idA( const string_table *st, LPCSTR str, UINT *id );
|
||||
extern VOID msi_destroy_stringtable( string_table *st );
|
||||
extern UINT msi_strcmp( const string_table *st, UINT lval, UINT rval, UINT *res );
|
||||
extern const WCHAR *msi_string_lookup_id( const string_table *st, UINT id );
|
||||
|
@ -700,15 +698,12 @@ extern const WCHAR *MSI_RecordGetString( const MSIRECORD *, UINT );
|
|||
extern MSIRECORD *MSI_CreateRecord( UINT );
|
||||
extern UINT MSI_RecordSetInteger( MSIRECORD *, UINT, int );
|
||||
extern UINT MSI_RecordSetStringW( MSIRECORD *, UINT, LPCWSTR );
|
||||
extern UINT MSI_RecordSetStringA( MSIRECORD *, UINT, LPCSTR );
|
||||
extern BOOL MSI_RecordIsNull( MSIRECORD *, UINT );
|
||||
extern UINT MSI_RecordGetStringW( MSIRECORD * , UINT, LPWSTR, LPDWORD);
|
||||
extern UINT MSI_RecordGetStringA( MSIRECORD *, UINT, LPSTR, LPDWORD);
|
||||
extern int MSI_RecordGetInteger( MSIRECORD *, UINT );
|
||||
extern UINT MSI_RecordReadStream( MSIRECORD *, UINT, char *, LPDWORD);
|
||||
extern UINT MSI_RecordGetFieldCount( const MSIRECORD *rec );
|
||||
extern UINT MSI_RecordSetStream( MSIRECORD *, UINT, IStream * );
|
||||
extern UINT MSI_RecordDataSize( MSIRECORD *, UINT );
|
||||
extern UINT MSI_RecordStreamToFile( MSIRECORD *, UINT, LPCWSTR );
|
||||
extern UINT MSI_RecordCopyField( MSIRECORD *, UINT, MSIRECORD *, UINT );
|
||||
extern MSIRECORD *MSI_CloneRecord( MSIRECORD * );
|
||||
|
@ -716,10 +711,8 @@ extern BOOL MSI_RecordsAreEqual( MSIRECORD *, MSIRECORD * );
|
|||
|
||||
/* stream internals */
|
||||
extern UINT get_raw_stream( MSIHANDLE hdb, LPCWSTR stname, IStream **stm );
|
||||
extern UINT db_get_raw_stream( MSIDATABASE *db, LPCWSTR stname, IStream **stm );
|
||||
extern void enum_stream_names( IStorage *stg );
|
||||
extern BOOL decode_streamname(LPCWSTR in, LPWSTR out);
|
||||
extern LPWSTR encode_streamname(BOOL bTable, LPCWSTR in);
|
||||
|
||||
/* database internals */
|
||||
extern UINT MSI_OpenDatabaseW( LPCWSTR, LPCWSTR, MSIDATABASE ** );
|
||||
|
@ -728,8 +721,6 @@ extern UINT MSI_OpenQuery( MSIDATABASE *, MSIQUERY **, LPCWSTR, ... );
|
|||
typedef UINT (*record_func)( MSIRECORD *, LPVOID );
|
||||
extern UINT MSI_IterateRecords( MSIQUERY *, LPDWORD, record_func, LPVOID );
|
||||
extern MSIRECORD *MSI_QueryGetRecord( MSIDATABASE *db, LPCWSTR query, ... );
|
||||
extern UINT MSI_DatabaseImport( MSIDATABASE *, LPCWSTR, LPCWSTR );
|
||||
extern UINT MSI_DatabaseExport( MSIDATABASE *, LPCWSTR, LPCWSTR, LPCWSTR );
|
||||
extern UINT MSI_DatabaseGetPrimaryKeys( MSIDATABASE *, LPCWSTR, MSIRECORD ** );
|
||||
|
||||
/* view internals */
|
||||
|
@ -776,7 +767,6 @@ extern UINT MSIREG_OpenProductKey(LPCWSTR szProduct, MSIINSTALLCONTEXT context,
|
|||
extern UINT MSIREG_OpenFeaturesKey(LPCWSTR szProduct, MSIINSTALLCONTEXT context,
|
||||
HKEY *key, BOOL create);
|
||||
extern UINT MSIREG_OpenUserPatchesKey(LPCWSTR szPatch, HKEY* key, BOOL create);
|
||||
extern UINT MSIREG_OpenInstallerFeaturesKey(LPCWSTR szProduct, HKEY* key, BOOL create);
|
||||
UINT MSIREG_OpenUserDataFeaturesKey(LPCWSTR szProduct, MSIINSTALLCONTEXT context,
|
||||
HKEY *key, BOOL create);
|
||||
extern UINT MSIREG_OpenUserComponentsKey(LPCWSTR szComponent, HKEY* key, BOOL create);
|
||||
|
@ -820,7 +810,6 @@ extern void msi_dialog_end_dialog( msi_dialog* );
|
|||
extern void msi_dialog_check_messages( HANDLE );
|
||||
extern void msi_dialog_do_preview( msi_dialog* );
|
||||
extern void msi_dialog_destroy( msi_dialog* );
|
||||
extern BOOL msi_dialog_register_class( void );
|
||||
extern void msi_dialog_unregister_class( void );
|
||||
extern void msi_dialog_handle_event( msi_dialog*, LPCWSTR, LPCWSTR, MSIRECORD * );
|
||||
extern UINT msi_dialog_reset( msi_dialog *dialog );
|
||||
|
@ -829,10 +818,6 @@ extern msi_dialog *msi_dialog_get_parent( msi_dialog *dialog );
|
|||
extern LPWSTR msi_dialog_get_name( msi_dialog *dialog );
|
||||
extern UINT msi_spawn_error_dialog( MSIPACKAGE*, LPWSTR, LPWSTR );
|
||||
|
||||
/* preview */
|
||||
extern MSIPREVIEW *MSI_EnableUIPreview( MSIDATABASE * );
|
||||
extern UINT MSI_PreviewDialogW( MSIPREVIEW *, LPCWSTR );
|
||||
|
||||
/* summary information */
|
||||
extern MSISUMMARYINFO *MSI_GetSummaryInformationW( IStorage *stg, UINT uiUpdateCount );
|
||||
extern LPWSTR msi_suminfo_dup_string( MSISUMMARYINFO *si, UINT uiProperty );
|
||||
|
@ -1016,10 +1001,8 @@ typedef struct
|
|||
} MSICABDATA;
|
||||
|
||||
extern UINT ready_media(MSIPACKAGE *package, MSIFILE *file, MSIMEDIAINFO *mi);
|
||||
extern UINT msi_load_media_info(MSIPACKAGE *package, MSIFILE *file, MSIMEDIAINFO *mi);
|
||||
extern void msi_free_media_info(MSIMEDIAINFO *mi);
|
||||
extern BOOL msi_cabextract(MSIPACKAGE* package, MSIMEDIAINFO *mi, LPVOID data);
|
||||
extern UINT find_published_source(MSIPACKAGE *package, MSIMEDIAINFO *mi);
|
||||
|
||||
/* control event stuff */
|
||||
extern VOID ControlEvent_FireSubscribedEvent(MSIPACKAGE *package, LPCWSTR event,
|
||||
|
|
|
@ -41,7 +41,7 @@ static void MSI_ClosePreview( MSIOBJECTHDR *arg )
|
|||
msiobj_release( &preview->package->hdr );
|
||||
}
|
||||
|
||||
MSIPREVIEW *MSI_EnableUIPreview( MSIDATABASE *db )
|
||||
static MSIPREVIEW *MSI_EnableUIPreview( MSIDATABASE *db )
|
||||
{
|
||||
MSIPREVIEW *preview = NULL;
|
||||
MSIPACKAGE *package;
|
||||
|
@ -109,7 +109,7 @@ static UINT preview_event_handler( MSIPACKAGE *package, LPCWSTR event,
|
|||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
UINT MSI_PreviewDialogW( MSIPREVIEW *preview, LPCWSTR szDialogName )
|
||||
static UINT MSI_PreviewDialogW( MSIPREVIEW *preview, LPCWSTR szDialogName )
|
||||
{
|
||||
msi_dialog *dialog = NULL;
|
||||
UINT r = ERROR_SUCCESS;
|
||||
|
|
|
@ -488,7 +488,7 @@ static UINT msi_get_stream_size( IStream *stm )
|
|||
return stat.cbSize.QuadPart;
|
||||
}
|
||||
|
||||
UINT MSI_RecordDataSize(MSIRECORD *rec, UINT iField)
|
||||
static UINT MSI_RecordDataSize(MSIRECORD *rec, UINT iField)
|
||||
{
|
||||
TRACE("%p %d\n", rec, iField);
|
||||
|
||||
|
@ -526,7 +526,7 @@ UINT WINAPI MsiRecordDataSize(MSIHANDLE handle, UINT iField)
|
|||
return ret;
|
||||
}
|
||||
|
||||
UINT MSI_RecordSetStringA( MSIRECORD *rec, UINT iField, LPCSTR szValue )
|
||||
static UINT MSI_RecordSetStringA( MSIRECORD *rec, UINT iField, LPCSTR szValue )
|
||||
{
|
||||
LPWSTR str;
|
||||
|
||||
|
@ -662,7 +662,7 @@ static UINT RECORD_StreamFromFile(LPCWSTR szFile, IStream **pstm)
|
|||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
UINT MSI_RecordSetStream(MSIRECORD *rec, UINT iField, IStream *stream)
|
||||
static UINT MSI_RecordSetStream(MSIRECORD *rec, UINT iField, IStream *stream)
|
||||
{
|
||||
if ( (iField == 0) || (iField > rec->count) )
|
||||
return ERROR_INVALID_PARAMETER;
|
||||
|
|
|
@ -653,7 +653,7 @@ UINT MSIREG_DeleteUserFeaturesKey(LPCWSTR szProduct)
|
|||
return RegDeleteTreeW(HKEY_CURRENT_USER, keypath);
|
||||
}
|
||||
|
||||
UINT MSIREG_OpenInstallerFeaturesKey(LPCWSTR szProduct, HKEY* key, BOOL create)
|
||||
static UINT MSIREG_OpenInstallerFeaturesKey(LPCWSTR szProduct, HKEY* key, BOOL create)
|
||||
{
|
||||
UINT rc;
|
||||
WCHAR squished_pc[GUID_SIZE];
|
||||
|
|
|
@ -179,6 +179,34 @@ static void set_st_entry( string_table *st, UINT n, LPWSTR str, UINT refcount, e
|
|||
st->freeslot = n + 1;
|
||||
}
|
||||
|
||||
static UINT msi_string2idA( const string_table *st, LPCSTR buffer, UINT *id )
|
||||
{
|
||||
DWORD sz;
|
||||
UINT r = ERROR_INVALID_PARAMETER;
|
||||
LPWSTR str;
|
||||
|
||||
TRACE("Finding string %s in string table\n", debugstr_a(buffer) );
|
||||
|
||||
if( buffer[0] == 0 )
|
||||
{
|
||||
*id = 0;
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
sz = MultiByteToWideChar( st->codepage, 0, buffer, -1, NULL, 0 );
|
||||
if( sz <= 0 )
|
||||
return r;
|
||||
str = msi_alloc( sz*sizeof(WCHAR) );
|
||||
if( !str )
|
||||
return ERROR_NOT_ENOUGH_MEMORY;
|
||||
MultiByteToWideChar( st->codepage, 0, buffer, -1, str, sz );
|
||||
|
||||
r = msi_string2idW( st, str, id );
|
||||
msi_free( str );
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
static int msi_addstring( string_table *st, UINT n, const CHAR *data, int len, UINT refcount, enum StringPersistence persistence )
|
||||
{
|
||||
LPWSTR str;
|
||||
|
@ -350,7 +378,7 @@ UINT msi_id2stringW( const string_table *st, UINT id, LPWSTR buffer, UINT *sz )
|
|||
* The size includes the terminating nul character. Short buffers
|
||||
* will be filled, but not nul terminated.
|
||||
*/
|
||||
UINT msi_id2stringA( const string_table *st, UINT id, LPSTR buffer, UINT *sz )
|
||||
static UINT msi_id2stringA( const string_table *st, UINT id, LPSTR buffer, UINT *sz )
|
||||
{
|
||||
UINT len;
|
||||
const WCHAR *str;
|
||||
|
@ -409,34 +437,6 @@ UINT msi_string2idW( const string_table *st, LPCWSTR str, UINT *id )
|
|||
return ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
UINT msi_string2idA( const string_table *st, LPCSTR buffer, UINT *id )
|
||||
{
|
||||
DWORD sz;
|
||||
UINT r = ERROR_INVALID_PARAMETER;
|
||||
LPWSTR str;
|
||||
|
||||
TRACE("Finding string %s in string table\n", debugstr_a(buffer) );
|
||||
|
||||
if( buffer[0] == 0 )
|
||||
{
|
||||
*id = 0;
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
sz = MultiByteToWideChar( st->codepage, 0, buffer, -1, NULL, 0 );
|
||||
if( sz <= 0 )
|
||||
return r;
|
||||
str = msi_alloc( sz*sizeof(WCHAR) );
|
||||
if( !str )
|
||||
return ERROR_NOT_ENOUGH_MEMORY;
|
||||
MultiByteToWideChar( st->codepage, 0, buffer, -1, str, sz );
|
||||
|
||||
r = msi_string2idW( st, str, id );
|
||||
msi_free( str );
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
UINT msi_strcmp( const string_table *st, UINT lval, UINT rval, UINT *res )
|
||||
{
|
||||
const WCHAR *l_str, *r_str;
|
||||
|
|
|
@ -148,7 +148,7 @@ static int utf2mime(int x)
|
|||
return -1;
|
||||
}
|
||||
|
||||
LPWSTR encode_streamname(BOOL bTable, LPCWSTR in)
|
||||
static LPWSTR encode_streamname(BOOL bTable, LPCWSTR in)
|
||||
{
|
||||
DWORD count = MAX_STREAM_NAME;
|
||||
DWORD ch, next;
|
||||
|
@ -326,7 +326,7 @@ end:
|
|||
return ret;
|
||||
}
|
||||
|
||||
UINT db_get_raw_stream( MSIDATABASE *db, LPCWSTR stname, IStream **stm )
|
||||
static UINT db_get_raw_stream( MSIDATABASE *db, LPCWSTR stname, IStream **stm )
|
||||
{
|
||||
LPWSTR encname;
|
||||
HRESULT r;
|
||||
|
|
Loading…
Reference in New Issue