Fix MsiModifyView and MsiViewGetColumnInfo to use MSIRECORD* not MSIHANDLE.
This commit is contained in:
parent
cfbffe6909
commit
ef1d367bcc
|
@ -188,11 +188,12 @@ static UINT CREATE_get_column_info( struct tagMSIVIEW *view,
|
||||||
return ERROR_FUNCTION_FAILED;
|
return ERROR_FUNCTION_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static UINT CREATE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIHANDLE hrec)
|
static UINT CREATE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode,
|
||||||
|
MSIRECORD *rec)
|
||||||
{
|
{
|
||||||
MSICREATEVIEW *cv = (MSICREATEVIEW*)view;
|
MSICREATEVIEW *cv = (MSICREATEVIEW*)view;
|
||||||
|
|
||||||
TRACE("%p %d %ld\n", cv, eModifyMode, hrec );
|
TRACE("%p %d %p\n", cv, eModifyMode, rec );
|
||||||
|
|
||||||
return ERROR_FUNCTION_FAILED;
|
return ERROR_FUNCTION_FAILED;
|
||||||
}
|
}
|
||||||
|
|
|
@ -217,16 +217,17 @@ static UINT DISTINCT_get_column_info( struct tagMSIVIEW *view,
|
||||||
return dv->table->ops->get_column_info( dv->table, n, name, type );
|
return dv->table->ops->get_column_info( dv->table, n, name, type );
|
||||||
}
|
}
|
||||||
|
|
||||||
static UINT DISTINCT_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIHANDLE hrec)
|
static UINT DISTINCT_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode,
|
||||||
|
MSIRECORD *rec )
|
||||||
{
|
{
|
||||||
MSIDISTINCTVIEW *dv = (MSIDISTINCTVIEW*)view;
|
MSIDISTINCTVIEW *dv = (MSIDISTINCTVIEW*)view;
|
||||||
|
|
||||||
TRACE("%p %d %ld\n", dv, eModifyMode, hrec );
|
TRACE("%p %d %p\n", dv, eModifyMode, rec );
|
||||||
|
|
||||||
if( !dv->table )
|
if( !dv->table )
|
||||||
return ERROR_FUNCTION_FAILED;
|
return ERROR_FUNCTION_FAILED;
|
||||||
|
|
||||||
return dv->table->ops->modify( dv->table, eModifyMode, hrec );
|
return dv->table->ops->modify( dv->table, eModifyMode, rec );
|
||||||
}
|
}
|
||||||
|
|
||||||
static UINT DISTINCT_delete( struct tagMSIVIEW *view )
|
static UINT DISTINCT_delete( struct tagMSIVIEW *view )
|
||||||
|
|
|
@ -214,11 +214,11 @@ static UINT INSERT_get_column_info( struct tagMSIVIEW *view,
|
||||||
return sv->ops->get_column_info( sv, n, name, type );
|
return sv->ops->get_column_info( sv, n, name, type );
|
||||||
}
|
}
|
||||||
|
|
||||||
static UINT INSERT_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIHANDLE hrec)
|
static UINT INSERT_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIRECORD *rec)
|
||||||
{
|
{
|
||||||
MSIINSERTVIEW *iv = (MSIINSERTVIEW*)view;
|
MSIINSERTVIEW *iv = (MSIINSERTVIEW*)view;
|
||||||
|
|
||||||
TRACE("%p %d %ld\n", iv, eModifyMode, hrec );
|
TRACE("%p %d %p\n", iv, eModifyMode, rec );
|
||||||
|
|
||||||
return ERROR_FUNCTION_FAILED;
|
return ERROR_FUNCTION_FAILED;
|
||||||
}
|
}
|
||||||
|
|
|
@ -161,7 +161,7 @@ typedef struct tagMSIVIEWOPS
|
||||||
/*
|
/*
|
||||||
* modify - not yet implemented properly
|
* modify - not yet implemented properly
|
||||||
*/
|
*/
|
||||||
UINT (*modify)( struct tagMSIVIEW *, MSIMODIFY, MSIHANDLE );
|
UINT (*modify)( struct tagMSIVIEW *, MSIMODIFY, MSIRECORD * );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* delete - destroys the structure completely
|
* delete - destroys the structure completely
|
||||||
|
|
|
@ -430,10 +430,10 @@ out:
|
||||||
|
|
||||||
UINT WINAPI MsiViewGetColumnInfo(MSIHANDLE hView, MSICOLINFO info, MSIHANDLE *hRec)
|
UINT WINAPI MsiViewGetColumnInfo(MSIHANDLE hView, MSICOLINFO info, MSIHANDLE *hRec)
|
||||||
{
|
{
|
||||||
MSIVIEW *view;
|
MSIVIEW *view = NULL;
|
||||||
MSIQUERY *query;
|
MSIQUERY *query = NULL;
|
||||||
MSIHANDLE handle;
|
MSIRECORD *rec = NULL;
|
||||||
UINT ret, i, count = 0, type;
|
UINT r = ERROR_FUNCTION_FAILED, i, count = 0, type;
|
||||||
LPWSTR name;
|
LPWSTR name;
|
||||||
|
|
||||||
TRACE("%ld %d %p\n", hView, info, hRec);
|
TRACE("%ld %d %p\n", hView, info, hRec);
|
||||||
|
@ -444,34 +444,82 @@ UINT WINAPI MsiViewGetColumnInfo(MSIHANDLE hView, MSICOLINFO info, MSIHANDLE *hR
|
||||||
|
|
||||||
view = query->view;
|
view = query->view;
|
||||||
if( !view )
|
if( !view )
|
||||||
return ERROR_FUNCTION_FAILED;
|
goto out;
|
||||||
|
|
||||||
if( !view->ops->get_dimensions )
|
if( !view->ops->get_dimensions )
|
||||||
return ERROR_FUNCTION_FAILED;
|
goto out;
|
||||||
|
|
||||||
ret = view->ops->get_dimensions( view, NULL, &count );
|
r = view->ops->get_dimensions( view, NULL, &count );
|
||||||
if( ret )
|
if( r )
|
||||||
return ret;
|
goto out;
|
||||||
if( !count )
|
if( !count )
|
||||||
return ERROR_INVALID_PARAMETER;
|
{
|
||||||
|
r = ERROR_INVALID_PARAMETER;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
handle = MsiCreateRecord( count );
|
rec = MSI_CreateRecord( count );
|
||||||
if( !handle )
|
if( !rec )
|
||||||
return ERROR_FUNCTION_FAILED;
|
return ERROR_FUNCTION_FAILED;
|
||||||
|
|
||||||
for( i=0; i<count; i++ )
|
for( i=0; i<count; i++ )
|
||||||
{
|
{
|
||||||
name = NULL;
|
name = NULL;
|
||||||
ret = view->ops->get_column_info( view, i+1, &name, &type );
|
r = view->ops->get_column_info( view, i+1, &name, &type );
|
||||||
if( ret != ERROR_SUCCESS )
|
if( r != ERROR_SUCCESS )
|
||||||
continue;
|
continue;
|
||||||
MsiRecordSetStringW( handle, i+1, name );
|
MSI_RecordSetStringW( rec, i+1, name );
|
||||||
HeapFree( GetProcessHeap(), 0, name );
|
HeapFree( GetProcessHeap(), 0, name );
|
||||||
}
|
}
|
||||||
|
|
||||||
*hRec = handle;
|
*hRec = alloc_msihandle( &rec->hdr );
|
||||||
|
|
||||||
return ERROR_SUCCESS;
|
out:
|
||||||
|
if( query )
|
||||||
|
msiobj_release( &query->hdr );
|
||||||
|
if( rec )
|
||||||
|
msiobj_release( &rec->hdr );
|
||||||
|
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
UINT WINAPI MsiViewModify( MSIHANDLE hView, MSIMODIFY eModifyMode,
|
||||||
|
MSIHANDLE hRecord)
|
||||||
|
{
|
||||||
|
MSIVIEW *view = NULL;
|
||||||
|
MSIQUERY *query = NULL;
|
||||||
|
MSIRECORD *rec = NULL;
|
||||||
|
UINT r = ERROR_FUNCTION_FAILED;
|
||||||
|
|
||||||
|
TRACE("%ld %x %ld\n", hView, eModifyMode, hRecord);
|
||||||
|
|
||||||
|
query = msihandle2msiinfo( hView, MSIHANDLETYPE_VIEW );
|
||||||
|
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 = view->ops->modify( view, eModifyMode, rec );
|
||||||
|
|
||||||
|
out:
|
||||||
|
if( query )
|
||||||
|
msiobj_release( &query->hdr );
|
||||||
|
if( rec )
|
||||||
|
msiobj_release( &rec->hdr );
|
||||||
|
|
||||||
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT WINAPI MsiDatabaseApplyTransformA( MSIHANDLE hdb,
|
UINT WINAPI MsiDatabaseApplyTransformA( MSIHANDLE hdb,
|
||||||
|
@ -540,13 +588,6 @@ UINT WINAPI MsiDatabaseGetPrimaryKeysW(MSIHANDLE hdb,
|
||||||
return ERROR_CALL_NOT_IMPLEMENTED;
|
return ERROR_CALL_NOT_IMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT WINAPI MsiViewModify(MSIHANDLE hView, MSIMODIFY eModifyMode, MSIHANDLE
|
|
||||||
hRecord)
|
|
||||||
{
|
|
||||||
FIXME("%ld %x %ld\n",hView, eModifyMode, hRecord);
|
|
||||||
return ERROR_CALL_NOT_IMPLEMENTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
UINT WINAPI MsiDatabaseIsTablePersistentA(
|
UINT WINAPI MsiDatabaseIsTablePersistentA(
|
||||||
MSIHANDLE hDatabase, LPSTR szTableName)
|
MSIHANDLE hDatabase, LPSTR szTableName)
|
||||||
{
|
{
|
||||||
|
|
|
@ -218,16 +218,17 @@ static UINT ORDER_get_column_info( struct tagMSIVIEW *view,
|
||||||
return ov->table->ops->get_column_info( ov->table, n, name, type );
|
return ov->table->ops->get_column_info( ov->table, n, name, type );
|
||||||
}
|
}
|
||||||
|
|
||||||
static UINT ORDER_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIHANDLE hrec)
|
static UINT ORDER_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode,
|
||||||
|
MSIRECORD *rec )
|
||||||
{
|
{
|
||||||
MSIORDERVIEW *ov = (MSIORDERVIEW*)view;
|
MSIORDERVIEW *ov = (MSIORDERVIEW*)view;
|
||||||
|
|
||||||
TRACE("%p %d %ld\n", ov, eModifyMode, hrec );
|
TRACE("%p %d %p\n", ov, eModifyMode, rec );
|
||||||
|
|
||||||
if( !ov->table )
|
if( !ov->table )
|
||||||
return ERROR_FUNCTION_FAILED;
|
return ERROR_FUNCTION_FAILED;
|
||||||
|
|
||||||
return ov->table->ops->modify( ov->table, eModifyMode, hrec );
|
return ov->table->ops->modify( ov->table, eModifyMode, rec );
|
||||||
}
|
}
|
||||||
|
|
||||||
static UINT ORDER_delete( struct tagMSIVIEW *view )
|
static UINT ORDER_delete( struct tagMSIVIEW *view )
|
||||||
|
|
|
@ -168,16 +168,17 @@ static UINT SELECT_get_column_info( struct tagMSIVIEW *view,
|
||||||
return sv->table->ops->get_column_info( sv->table, n, name, type );
|
return sv->table->ops->get_column_info( sv->table, n, name, type );
|
||||||
}
|
}
|
||||||
|
|
||||||
static UINT SELECT_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIHANDLE hrec)
|
static UINT SELECT_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode,
|
||||||
|
MSIRECORD *rec )
|
||||||
{
|
{
|
||||||
MSISELECTVIEW *sv = (MSISELECTVIEW*)view;
|
MSISELECTVIEW *sv = (MSISELECTVIEW*)view;
|
||||||
|
|
||||||
TRACE("%p %d %ld\n", sv, eModifyMode, hrec );
|
TRACE("%p %d %p\n", sv, eModifyMode, rec );
|
||||||
|
|
||||||
if( !sv->table )
|
if( !sv->table )
|
||||||
return ERROR_FUNCTION_FAILED;
|
return ERROR_FUNCTION_FAILED;
|
||||||
|
|
||||||
return sv->table->ops->modify( sv->table, eModifyMode, hrec );
|
return sv->table->ops->modify( sv->table, eModifyMode, rec );
|
||||||
}
|
}
|
||||||
|
|
||||||
static UINT SELECT_delete( struct tagMSIVIEW *view )
|
static UINT SELECT_delete( struct tagMSIVIEW *view )
|
||||||
|
|
|
@ -1284,9 +1284,10 @@ static UINT TABLE_get_column_info( struct tagMSIVIEW *view,
|
||||||
return ERROR_SUCCESS;
|
return ERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static UINT TABLE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIHANDLE hrec)
|
static UINT TABLE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode,
|
||||||
|
MSIRECORD *rec)
|
||||||
{
|
{
|
||||||
FIXME("%p %d %ld\n", view, eModifyMode, hrec );
|
FIXME("%p %d %p\n", view, eModifyMode, rec );
|
||||||
return ERROR_CALL_NOT_IMPLEMENTED;
|
return ERROR_CALL_NOT_IMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -151,11 +151,12 @@ static UINT UPDATE_get_column_info( struct tagMSIVIEW *view,
|
||||||
return wv->ops->get_column_info( wv, n, name, type );
|
return wv->ops->get_column_info( wv, n, name, type );
|
||||||
}
|
}
|
||||||
|
|
||||||
static UINT UPDATE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIHANDLE hrec)
|
static UINT UPDATE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode,
|
||||||
|
MSIRECORD *rec )
|
||||||
{
|
{
|
||||||
MSIUPDATEVIEW *uv = (MSIUPDATEVIEW*)view;
|
MSIUPDATEVIEW *uv = (MSIUPDATEVIEW*)view;
|
||||||
|
|
||||||
TRACE("%p %d %ld\n", uv, eModifyMode, hrec );
|
TRACE("%p %d %p\n", uv, eModifyMode, rec );
|
||||||
|
|
||||||
return ERROR_FUNCTION_FAILED;
|
return ERROR_FUNCTION_FAILED;
|
||||||
}
|
}
|
||||||
|
|
|
@ -307,16 +307,17 @@ static UINT WHERE_get_column_info( struct tagMSIVIEW *view,
|
||||||
return wv->table->ops->get_column_info( wv->table, n, name, type );
|
return wv->table->ops->get_column_info( wv->table, n, name, type );
|
||||||
}
|
}
|
||||||
|
|
||||||
static UINT WHERE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIHANDLE hrec)
|
static UINT WHERE_modify( struct tagMSIVIEW *view, MSIMODIFY eModifyMode,
|
||||||
|
MSIRECORD *rec )
|
||||||
{
|
{
|
||||||
MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view;
|
MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view;
|
||||||
|
|
||||||
TRACE("%p %d %ld\n", wv, eModifyMode, hrec );
|
TRACE("%p %d %p\n", wv, eModifyMode, rec );
|
||||||
|
|
||||||
if( !wv->table )
|
if( !wv->table )
|
||||||
return ERROR_FUNCTION_FAILED;
|
return ERROR_FUNCTION_FAILED;
|
||||||
|
|
||||||
return wv->table->ops->modify( wv->table, eModifyMode, hrec );
|
return wv->table->ops->modify( wv->table, eModifyMode, rec );
|
||||||
}
|
}
|
||||||
|
|
||||||
static UINT WHERE_delete( struct tagMSIVIEW *view )
|
static UINT WHERE_delete( struct tagMSIVIEW *view )
|
||||||
|
|
Loading…
Reference in New Issue