From 2b4bf44b793fa1dcf102289b2c789a3284669f07 Mon Sep 17 00:00:00 2001 From: James Hawkins Date: Sat, 21 Apr 2007 06:55:24 -0500 Subject: [PATCH] msi: Add an internal MSI_ViewModify. --- dlls/msi/msipriv.h | 1 + dlls/msi/msiquery.c | 31 +++++++++++++++---------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h index 9a0918a73b4..2a9217c7bd3 100644 --- a/dlls/msi/msipriv.h +++ b/dlls/msi/msipriv.h @@ -619,6 +619,7 @@ extern UINT MSI_ViewExecute( MSIQUERY*, MSIRECORD * ); extern UINT MSI_ViewFetch( MSIQUERY*, MSIRECORD ** ); extern UINT MSI_ViewClose( MSIQUERY* ); extern UINT MSI_ViewGetColumnInfo(MSIQUERY *, MSICOLINFO, MSIRECORD **); +extern UINT MSI_ViewModify( MSIQUERY *, MSIMODIFY, MSIRECORD * ); extern UINT VIEW_find_column( MSIVIEW *, LPCWSTR, UINT * ); diff --git a/dlls/msi/msiquery.c b/dlls/msi/msiquery.c index f91a1236bdc..abec8d8d38a 100644 --- a/dlls/msi/msiquery.c +++ b/dlls/msi/msiquery.c @@ -552,10 +552,23 @@ UINT WINAPI MsiViewGetColumnInfo(MSIHANDLE hView, MSICOLINFO info, MSIHANDLE *hR return r; } +UINT MSI_ViewModify( MSIQUERY *query, MSIMODIFY mode, MSIRECORD *rec ) +{ + MSIVIEW *view = NULL; + + if ( !query || !rec ) + return ERROR_INVALID_HANDLE; + + view = query->view; + if ( !view || !view->ops->modify) + return ERROR_FUNCTION_FAILED; + + return view->ops->modify( view, mode, rec ); +} + UINT WINAPI MsiViewModify( MSIHANDLE hView, MSIMODIFY eModifyMode, MSIHANDLE hRecord) { - MSIVIEW *view = NULL; MSIQUERY *query = NULL; MSIRECORD *rec = NULL; UINT r = ERROR_FUNCTION_FAILED; @@ -566,23 +579,9 @@ UINT WINAPI MsiViewModify( MSIHANDLE hView, MSIMODIFY eModifyMode, if( !query ) return ERROR_INVALID_HANDLE; - view = query->view; - if( !view ) - goto out; - - if( !view->ops->modify ) - goto out; - rec = msihandle2msiinfo( hRecord, MSIHANDLETYPE_RECORD ); - if( !rec ) - { - r = ERROR_INVALID_HANDLE; - goto out; - } + r = MSI_ViewModify( query, eModifyMode, rec ); - r = view->ops->modify( view, eModifyMode, rec ); - -out: msiobj_release( &query->hdr ); if( rec ) msiobj_release( &rec->hdr );