Fix MsiModifyView and MsiViewGetColumnInfo to use MSIRECORD* not MSIHANDLE.

This commit is contained in:
Mike McCormack 2005-02-08 13:44:25 +00:00 committed by Alexandre Julliard
parent cfbffe6909
commit ef1d367bcc
10 changed files with 93 additions and 45 deletions

View file

@ -188,11 +188,12 @@ static UINT CREATE_get_column_info( struct tagMSIVIEW *view,
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;
TRACE("%p %d %ld\n", cv, eModifyMode, hrec );
TRACE("%p %d %p\n", cv, eModifyMode, rec );
return ERROR_FUNCTION_FAILED;
}

View file

@ -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 );
}
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;
TRACE("%p %d %ld\n", dv, eModifyMode, hrec );
TRACE("%p %d %p\n", dv, eModifyMode, rec );
if( !dv->table )
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 )

View file

@ -214,11 +214,11 @@ static UINT INSERT_get_column_info( struct tagMSIVIEW *view,
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;
TRACE("%p %d %ld\n", iv, eModifyMode, hrec );
TRACE("%p %d %p\n", iv, eModifyMode, rec );
return ERROR_FUNCTION_FAILED;
}

View file

@ -161,7 +161,7 @@ typedef struct tagMSIVIEWOPS
/*
* modify - not yet implemented properly
*/
UINT (*modify)( struct tagMSIVIEW *, MSIMODIFY, MSIHANDLE );
UINT (*modify)( struct tagMSIVIEW *, MSIMODIFY, MSIRECORD * );
/*
* delete - destroys the structure completely

View file

@ -430,10 +430,10 @@ out:
UINT WINAPI MsiViewGetColumnInfo(MSIHANDLE hView, MSICOLINFO info, MSIHANDLE *hRec)
{
MSIVIEW *view;
MSIQUERY *query;
MSIHANDLE handle;
UINT ret, i, count = 0, type;
MSIVIEW *view = NULL;
MSIQUERY *query = NULL;
MSIRECORD *rec = NULL;
UINT r = ERROR_FUNCTION_FAILED, i, count = 0, type;
LPWSTR name;
TRACE("%ld %d %p\n", hView, info, hRec);
@ -444,34 +444,82 @@ UINT WINAPI MsiViewGetColumnInfo(MSIHANDLE hView, MSICOLINFO info, MSIHANDLE *hR
view = query->view;
if( !view )
return ERROR_FUNCTION_FAILED;
goto out;
if( !view->ops->get_dimensions )
return ERROR_FUNCTION_FAILED;
goto out;
ret = view->ops->get_dimensions( view, NULL, &count );
if( ret )
return ret;
r = view->ops->get_dimensions( view, NULL, &count );
if( r )
goto out;
if( !count )
return ERROR_INVALID_PARAMETER;
{
r = ERROR_INVALID_PARAMETER;
goto out;
}
handle = MsiCreateRecord( count );
if( !handle )
rec = MSI_CreateRecord( count );
if( !rec )
return ERROR_FUNCTION_FAILED;
for( i=0; i<count; i++ )
{
name = NULL;
ret = view->ops->get_column_info( view, i+1, &name, &type );
if( ret != ERROR_SUCCESS )
r = view->ops->get_column_info( view, i+1, &name, &type );
if( r != ERROR_SUCCESS )
continue;
MsiRecordSetStringW( handle, i+1, name );
MSI_RecordSetStringW( rec, i+1, 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,
@ -540,13 +588,6 @@ UINT WINAPI MsiDatabaseGetPrimaryKeysW(MSIHANDLE hdb,
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(
MSIHANDLE hDatabase, LPSTR szTableName)
{

View file

@ -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 );
}
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;
TRACE("%p %d %ld\n", ov, eModifyMode, hrec );
TRACE("%p %d %p\n", ov, eModifyMode, rec );
if( !ov->table )
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 )

View file

@ -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 );
}
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;
TRACE("%p %d %ld\n", sv, eModifyMode, hrec );
TRACE("%p %d %p\n", sv, eModifyMode, rec );
if( !sv->table )
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 )

View file

@ -1284,9 +1284,10 @@ static UINT TABLE_get_column_info( struct tagMSIVIEW *view,
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;
}

View file

@ -151,11 +151,12 @@ static UINT UPDATE_get_column_info( struct tagMSIVIEW *view,
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;
TRACE("%p %d %ld\n", uv, eModifyMode, hrec );
TRACE("%p %d %p\n", uv, eModifyMode, rec );
return ERROR_FUNCTION_FAILED;
}

View file

@ -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 );
}
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;
TRACE("%p %d %ld\n", wv, eModifyMode, hrec );
TRACE("%p %d %p\n", wv, eModifyMode, rec );
if( !wv->table )
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 )