diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2012-10-22 12:53:54 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2012-12-06 20:25:48 +0100 |
commit | bb3fbded60aa53ffdc281a458dd57af072225f82 (patch) | |
tree | 93fde6cc0284959e02840eaa6443e95a53d5db8e /libmsi | |
parent | b3b026dc2f91b033648a946ba3871c087c1530b8 (diff) | |
download | msitools-bb3fbded60aa53ffdc281a458dd57af072225f82.tar.gz msitools-bb3fbded60aa53ffdc281a458dd57af072225f82.tar.xz msitools-bb3fbded60aa53ffdc281a458dd57af072225f82.zip |
remove some now-unused functions
Diffstat (limited to 'libmsi')
-rw-r--r-- | libmsi/Makefile.am | 1 | ||||
-rw-r--r-- | libmsi/msi.c | 70 | ||||
-rw-r--r-- | libmsi/package.c | 101 |
3 files changed, 3 insertions, 169 deletions
diff --git a/libmsi/Makefile.am b/libmsi/Makefile.am index 9ff3857..565fa48 100644 --- a/libmsi/Makefile.am +++ b/libmsi/Makefile.am @@ -1,6 +1,7 @@ lib_LTLIBRARIES = libmsi.la AM_CPPFLAGS = -I$(srcdir) -I. -D__WINESRC__ -DUNICODE -D_UNICODE +AM_CFLAGS = -Wunused AM_YFLAGS = -d BUILT_SOURCES = sql-parser.c sql-parser.h diff --git a/libmsi/msi.c b/libmsi/msi.c index 74975b8..8738565 100644 --- a/libmsi/msi.c +++ b/libmsi/msi.c @@ -87,76 +87,6 @@ UINT WINAPI MsiAdvertiseProductExW( LPCWSTR szPackagePath, LPCWSTR szScriptfileP return ERROR_CALL_NOT_IMPLEMENTED; } -static UINT get_patch_product_codes( LPCWSTR szPatchPackage, WCHAR ***product_codes ) -{ - MSIHANDLE patch, info = 0; - UINT r, type; - DWORD size; - static WCHAR empty[] = {0}; - WCHAR *codes = NULL; - - r = MsiOpenDatabaseW( szPatchPackage, MSIDBOPEN_READONLY, &patch ); - if (r != ERROR_SUCCESS) - return r; - - r = MsiGetSummaryInformationW( patch, NULL, 0, &info ); - if (r != ERROR_SUCCESS) - goto done; - - size = 0; - r = MsiSummaryInfoGetPropertyW( info, PID_TEMPLATE, &type, NULL, NULL, empty, &size ); - if (r != ERROR_MORE_DATA || !size || type != VT_LPSTR) - { - ERR("Failed to read product codes from patch\n"); - r = ERROR_FUNCTION_FAILED; - goto done; - } - - codes = msi_alloc( ++size * sizeof(WCHAR) ); - if (!codes) - { - r = ERROR_OUTOFMEMORY; - goto done; - } - - r = MsiSummaryInfoGetPropertyW( info, PID_TEMPLATE, &type, NULL, NULL, codes, &size ); - if (r == ERROR_SUCCESS) - *product_codes = msi_split_string( codes, ';' ); - -done: - MsiCloseHandle( info ); - MsiCloseHandle( patch ); - msi_free( codes ); - return r; -} - -static void free_patchinfo( DWORD count, MSIPATCHSEQUENCEINFOW *info ) -{ - DWORD i; - for (i = 0; i < count; i++) msi_free( (WCHAR *)info[i].szPatchData ); - msi_free( info ); -} - -static MSIPATCHSEQUENCEINFOW *patchinfoAtoW( DWORD count, const MSIPATCHSEQUENCEINFOA *info ) -{ - DWORD i; - MSIPATCHSEQUENCEINFOW *ret; - - if (!(ret = msi_alloc( count * sizeof(MSIPATCHSEQUENCEINFOW) ))) return NULL; - for (i = 0; i < count; i++) - { - if (info[i].szPatchData && !(ret[i].szPatchData = strdupAtoW( info[i].szPatchData ))) - { - free_patchinfo( i, ret ); - return NULL; - } - ret[i].ePatchDataType = info[i].ePatchDataType; - ret[i].dwOrder = info[i].dwOrder; - ret[i].uStatus = info[i].uStatus; - } - return ret; -} - UINT msi_strcpy_to_awstring( LPCWSTR str, awstring *awbuf, DWORD *sz ) { UINT len, r = ERROR_SUCCESS; diff --git a/libmsi/package.c b/libmsi/package.c index 43a02f4..0503211 100644 --- a/libmsi/package.c +++ b/libmsi/package.c @@ -397,54 +397,6 @@ static void MSI_FreePackage( MSIOBJECTHDR *arg) msi_free( package->localfile ); } -static UINT set_user_sid_prop( MSIPACKAGE *package ) -{ - SID_NAME_USE use; - LPWSTR user_name; - LPWSTR sid_str = NULL, dom = NULL; - DWORD size, dom_size; - PSID psid = NULL; - UINT r = ERROR_FUNCTION_FAILED; - - size = 0; - GetUserNameW( NULL, &size ); - - user_name = msi_alloc( (size + 1) * sizeof(WCHAR) ); - if (!user_name) - return ERROR_OUTOFMEMORY; - - if (!GetUserNameW( user_name, &size )) - goto done; - - size = 0; - dom_size = 0; - LookupAccountNameW( NULL, user_name, NULL, &size, NULL, &dom_size, &use ); - - psid = msi_alloc( size ); - dom = msi_alloc( dom_size*sizeof (WCHAR) ); - if (!psid || !dom) - { - r = ERROR_OUTOFMEMORY; - goto done; - } - - if (!LookupAccountNameW( NULL, user_name, psid, &size, dom, &dom_size, &use )) - goto done; - - if (!ConvertSidToStringSidW( psid, &sid_str )) - goto done; - - r = msi_set_property( package->db, szUserSID, sid_str ); - -done: - LocalFree( sid_str ); - msi_free( dom ); - msi_free( psid ); - msi_free( user_name ); - - return r; -} - typedef struct tagLANGANDCODEPAGE { WORD wLanguage; @@ -765,63 +717,15 @@ int msi_track_tempfile( MSIPACKAGE *package, const WCHAR *path ) return 0; } -static WCHAR *get_product_code( MSIDATABASE *db ) -{ - static const WCHAR query[] = { - 'S','E','L','E','C','T',' ','`','V','a','l','u','e','`',' ', - 'F','R','O','M',' ','`','P','r','o','p','e','r','t','y','`',' ', - 'W','H','E','R','E',' ','`','P','r','o','p','e','r','t','y','`','=', - '\'','P','r','o','d','u','c','t','C','o','d','e','\'',0}; - MSIQUERY *view; - MSIRECORD *rec; - WCHAR *ret = NULL; - - if (MSI_DatabaseOpenViewW( db, query, &view ) != ERROR_SUCCESS) - { - return NULL; - } - if (MSI_ViewExecute( view, 0 ) != ERROR_SUCCESS) - { - MSI_ViewClose( view ); - msiobj_release( &view->hdr ); - return NULL; - } - if (MSI_ViewFetch( view, &rec ) == ERROR_SUCCESS) - { - ret = strdupW( MSI_RecordGetString( rec, 1 ) ); - msiobj_release( &rec->hdr ); - } - MSI_ViewClose( view ); - msiobj_release( &view->hdr ); - return ret; -} - -static WCHAR *get_package_code( MSIDATABASE *db ) -{ - WCHAR *ret; - MSISUMMARYINFO *si; - - if (!(si = MSI_GetSummaryInformationW( db->storage, 0 ))) - { - WARN("failed to load summary info\n"); - return NULL; - } - ret = msi_suminfo_dup_string( si, PID_REVNUMBER ); - msiobj_release( &si->hdr ); - return ret; -} - UINT MSI_OpenPackageW(LPCWSTR szPackage, MSIPACKAGE **pPackage) { - static const WCHAR dotmsi[] = {'.','m','s','i',0}; MSIDATABASE *db; MSIPACKAGE *package; MSIHANDLE handle; - LPWSTR ptr, base_url = NULL; + LPWSTR base_url = NULL; UINT r; - WCHAR localfile[MAX_PATH], cachefile[MAX_PATH]; + WCHAR localfile[MAX_PATH]; LPCWSTR file = szPackage; - DWORD index = 0; MSISUMMARYINFO *si; BOOL delete_on_close = FALSE; @@ -952,7 +856,6 @@ MSIHANDLE WINAPI MsiGetActiveDatabase(MSIHANDLE hInstall) { MSIPACKAGE *package; MSIHANDLE handle = 0; - IUnknown *remote_unk; TRACE("(%d)\n",hInstall); |