Added implementation of security.dll.
[wine/hacks.git] / dlls / msi / msiquery.c
blob4824d875473f8a9b7e30f96a428cd381eb4a3522
1 /*
2 * Implementation of the Microsoft Installer (msi.dll)
4 * Copyright 2002-2005 Mike McCormack for CodeWeavers
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #include <stdarg.h>
23 #define COBJMACROS
25 #include "windef.h"
26 #include "winbase.h"
27 #include "winerror.h"
28 #include "wine/debug.h"
29 #include "wine/unicode.h"
30 #include "msi.h"
31 #include "msiquery.h"
32 #include "objbase.h"
33 #include "objidl.h"
34 #include "msipriv.h"
35 #include "winnls.h"
37 #include "query.h"
39 WINE_DEFAULT_DEBUG_CHANNEL(msi);
41 static void MSI_CloseView( MSIOBJECTHDR *arg )
43 MSIQUERY *query = (MSIQUERY*) arg;
44 struct list *ptr, *t;
46 if( query->view && query->view->ops->delete )
47 query->view->ops->delete( query->view );
48 msiobj_release( &query->db->hdr );
50 LIST_FOR_EACH_SAFE( ptr, t, &query->mem )
52 msi_free( ptr );
56 UINT VIEW_find_column( MSIVIEW *table, LPCWSTR name, UINT *n )
58 LPWSTR col_name;
59 UINT i, count, r;
61 r = table->ops->get_dimensions( table, NULL, &count );
62 if( r != ERROR_SUCCESS )
63 return r;
65 for( i=1; i<=count; i++ )
67 INT x;
69 col_name = NULL;
70 r = table->ops->get_column_info( table, i, &col_name, NULL );
71 if( r != ERROR_SUCCESS )
72 return r;
73 x = lstrcmpW( name, col_name );
74 msi_free( col_name );
75 if( !x )
77 *n = i;
78 return ERROR_SUCCESS;
82 return ERROR_INVALID_PARAMETER;
85 UINT WINAPI MsiDatabaseOpenViewA(MSIHANDLE hdb,
86 LPCSTR szQuery, MSIHANDLE *phView)
88 UINT r;
89 LPWSTR szwQuery;
91 TRACE("%ld %s %p\n", hdb, debugstr_a(szQuery), phView);
93 if( szQuery )
95 szwQuery = strdupAtoW( szQuery );
96 if( !szwQuery )
97 return ERROR_FUNCTION_FAILED;
99 else
100 szwQuery = NULL;
102 r = MsiDatabaseOpenViewW( hdb, szwQuery, phView);
104 msi_free( szwQuery );
105 return r;
108 UINT MSI_DatabaseOpenViewW(MSIDATABASE *db,
109 LPCWSTR szQuery, MSIQUERY **pView)
111 MSIQUERY *query;
112 UINT r;
114 TRACE("%s %p\n", debugstr_w(szQuery), pView);
116 if( !szQuery)
117 return ERROR_INVALID_PARAMETER;
119 /* pre allocate a handle to hold a pointer to the view */
120 query = alloc_msiobject( MSIHANDLETYPE_VIEW, sizeof (MSIQUERY),
121 MSI_CloseView );
122 if( !query )
123 return ERROR_FUNCTION_FAILED;
125 msiobj_addref( &db->hdr );
126 query->row = 0;
127 query->db = db;
128 query->view = NULL;
129 list_init( &query->mem );
131 r = MSI_ParseSQL( db, szQuery, &query->view, &query->mem );
132 if( r == ERROR_SUCCESS )
134 msiobj_addref( &query->hdr );
135 *pView = query;
138 msiobj_release( &query->hdr );
139 return r;
142 UINT MSI_OpenQuery( MSIDATABASE *db, MSIQUERY **view, LPCWSTR fmt, ... )
144 UINT r;
145 int size = 100, res;
146 LPWSTR query;
148 /* construct the string */
149 for (;;)
151 va_list va;
152 query = msi_alloc( size*sizeof(WCHAR) );
153 va_start(va, fmt);
154 res = vsnprintfW(query, size, fmt, va);
155 va_end(va);
156 if (res == -1) size *= 2;
157 else if (res >= size) size = res + 1;
158 else break;
159 msi_free( query );
161 /* perform the query */
162 r = MSI_DatabaseOpenViewW(db, query, view);
163 msi_free(query);
164 return r;
167 UINT MSI_IterateRecords( MSIQUERY *view, DWORD *count,
168 record_func func, LPVOID param )
170 MSIRECORD *rec = NULL;
171 UINT r, n = 0, max = 0;
173 r = MSI_ViewExecute( view, NULL );
174 if( r != ERROR_SUCCESS )
175 return r;
177 if( count )
178 max = *count;
180 /* iterate a query */
181 for( n = 0; (max == 0) || (n < max); n++ )
183 r = MSI_ViewFetch( view, &rec );
184 if( r != ERROR_SUCCESS )
185 break;
186 if (func)
187 r = func( rec, param );
188 msiobj_release( &rec->hdr );
189 if( r != ERROR_SUCCESS )
190 break;
193 MSI_ViewClose( view );
195 if( count )
196 *count = n;
198 if( r == ERROR_NO_MORE_ITEMS )
199 r = ERROR_SUCCESS;
201 return r;
204 /* return a single record from a query */
205 MSIRECORD *MSI_QueryGetRecord( MSIDATABASE *db, LPCWSTR fmt, ... )
207 MSIRECORD *rec = NULL;
208 MSIQUERY *view = NULL;
209 UINT r;
210 int size = 100, res;
211 LPWSTR query;
213 /* construct the string */
214 for (;;)
216 va_list va;
217 query = msi_alloc( size*sizeof(WCHAR) );
218 va_start(va, fmt);
219 res = vsnprintfW(query, size, fmt, va);
220 va_end(va);
221 if (res == -1) size *= 2;
222 else if (res >= size) size = res + 1;
223 else break;
224 msi_free( query );
226 /* perform the query */
227 r = MSI_DatabaseOpenViewW(db, query, &view);
228 msi_free(query);
230 if( r == ERROR_SUCCESS )
232 MSI_ViewExecute( view, NULL );
233 MSI_ViewFetch( view, &rec );
234 MSI_ViewClose( view );
235 msiobj_release( &view->hdr );
237 return rec;
240 UINT WINAPI MsiDatabaseOpenViewW(MSIHANDLE hdb,
241 LPCWSTR szQuery, MSIHANDLE *phView)
243 MSIDATABASE *db;
244 MSIQUERY *query = NULL;
245 UINT ret;
247 TRACE("%s %p\n", debugstr_w(szQuery), phView);
249 db = msihandle2msiinfo( hdb, MSIHANDLETYPE_DATABASE );
250 if( !db )
251 return ERROR_INVALID_HANDLE;
253 ret = MSI_DatabaseOpenViewW( db, szQuery, &query );
254 if( ret == ERROR_SUCCESS )
256 *phView = alloc_msihandle( &query->hdr );
257 msiobj_release( &query->hdr );
259 msiobj_release( &db->hdr );
261 return ret;
264 UINT MSI_ViewFetch(MSIQUERY *query, MSIRECORD **prec)
266 MSIVIEW *view;
267 MSIRECORD *rec;
268 UINT row_count = 0, col_count = 0, i, ival, ret, type;
270 TRACE("%p %p\n", query, prec );
272 view = query->view;
273 if( !view )
274 return ERROR_FUNCTION_FAILED;
276 ret = view->ops->get_dimensions( view, &row_count, &col_count );
277 if( ret )
278 return ret;
279 if( !col_count )
280 return ERROR_INVALID_PARAMETER;
282 if( query->row >= row_count )
283 return ERROR_NO_MORE_ITEMS;
285 rec = MSI_CreateRecord( col_count );
286 if( !rec )
287 return ERROR_FUNCTION_FAILED;
289 for( i=1; i<=col_count; i++ )
291 ret = view->ops->get_column_info( view, i, NULL, &type );
292 if( ret )
294 ERR("Error getting column type for %d\n", i );
295 continue;
297 if (!MSITYPE_IS_BINARY(type))
299 ret = view->ops->fetch_int( view, query->row, i, &ival );
300 if( ret )
302 ERR("Error fetching data for %d\n", i );
303 continue;
305 if( ! (type & MSITYPE_VALID ) )
306 ERR("Invalid type!\n");
308 /* check if it's nul (0) - if so, don't set anything */
309 if( !ival )
310 continue;
312 if( type & MSITYPE_STRING )
314 LPWSTR sval;
316 sval = MSI_makestring( query->db, ival );
317 MSI_RecordSetStringW( rec, i, sval );
318 msi_free( sval );
320 else
322 if( (type & MSI_DATASIZEMASK) == 2 )
323 MSI_RecordSetInteger( rec, i, ival - (1<<15) );
324 else
325 MSI_RecordSetInteger( rec, i, ival - (1<<31) );
328 else
330 IStream *stm = NULL;
332 ret = view->ops->fetch_stream( view, query->row, i, &stm );
333 if( ( ret == ERROR_SUCCESS ) && stm )
335 MSI_RecordSetIStream( rec, i, stm );
336 IStream_Release( stm );
338 else
339 ERR("failed to get stream\n");
342 query->row ++;
344 *prec = rec;
346 return ERROR_SUCCESS;
349 UINT WINAPI MsiViewFetch(MSIHANDLE hView, MSIHANDLE *record)
351 MSIQUERY *query;
352 MSIRECORD *rec = NULL;
353 UINT ret;
355 TRACE("%ld %p\n", hView, record);
357 query = msihandle2msiinfo( hView, MSIHANDLETYPE_VIEW );
358 if( !query )
359 return ERROR_INVALID_HANDLE;
360 ret = MSI_ViewFetch( query, &rec );
361 if( ret == ERROR_SUCCESS )
363 *record = alloc_msihandle( &rec->hdr );
364 msiobj_release( &rec->hdr );
366 msiobj_release( &query->hdr );
367 return ret;
370 UINT MSI_ViewClose(MSIQUERY *query)
372 MSIVIEW *view;
374 TRACE("%p\n", query );
376 view = query->view;
377 if( !view )
378 return ERROR_FUNCTION_FAILED;
379 if( !view->ops->close )
380 return ERROR_FUNCTION_FAILED;
382 return view->ops->close( view );
385 UINT WINAPI MsiViewClose(MSIHANDLE hView)
387 MSIQUERY *query;
388 UINT ret;
390 TRACE("%ld\n", hView );
392 query = msihandle2msiinfo( hView, MSIHANDLETYPE_VIEW );
393 if( !query )
394 return ERROR_INVALID_HANDLE;
396 ret = MSI_ViewClose( query );
397 msiobj_release( &query->hdr );
398 return ret;
401 UINT MSI_ViewExecute(MSIQUERY *query, MSIRECORD *rec )
403 MSIVIEW *view;
405 TRACE("%p %p\n", query, rec);
407 view = query->view;
408 if( !view )
409 return ERROR_FUNCTION_FAILED;
410 if( !view->ops->execute )
411 return ERROR_FUNCTION_FAILED;
412 query->row = 0;
414 return view->ops->execute( view, rec );
417 UINT WINAPI MsiViewExecute(MSIHANDLE hView, MSIHANDLE hRec)
419 MSIQUERY *query;
420 MSIRECORD *rec = NULL;
421 UINT ret;
423 TRACE("%ld %ld\n", hView, hRec);
425 query = msihandle2msiinfo( hView, MSIHANDLETYPE_VIEW );
426 if( !query )
427 return ERROR_INVALID_HANDLE;
429 if( hRec )
431 rec = msihandle2msiinfo( hRec, MSIHANDLETYPE_RECORD );
432 if( !rec )
434 ret = ERROR_INVALID_HANDLE;
435 goto out;
439 msiobj_lock( &rec->hdr );
440 ret = MSI_ViewExecute( query, rec );
441 msiobj_unlock( &rec->hdr );
443 out:
444 msiobj_release( &query->hdr );
445 if( rec )
446 msiobj_release( &rec->hdr );
448 return ret;
451 static UINT msi_set_record_type_string( MSIRECORD *rec, UINT field, UINT type )
453 static const WCHAR fmt[] = { '%','d',0 };
454 WCHAR szType[0x10];
456 if (MSITYPE_IS_BINARY(type))
457 szType[0] = 'v';
458 else if (type & MSITYPE_LOCALIZABLE)
459 szType[0] = 'l';
460 else if (type & MSITYPE_STRING)
461 szType[0] = 's';
462 else
463 szType[0] = 'i';
464 if (type & MSITYPE_NULLABLE)
465 szType[0] &= ~0x20;
467 sprintfW( &szType[1], fmt, (type&0xff) );
469 TRACE("type %04x -> %s\n", type, debugstr_w(szType) );
471 return MSI_RecordSetStringW( rec, field, szType );
474 UINT WINAPI MsiViewGetColumnInfo(MSIHANDLE hView, MSICOLINFO info, MSIHANDLE *hRec)
476 MSIVIEW *view = NULL;
477 MSIQUERY *query = NULL;
478 MSIRECORD *rec = NULL;
479 UINT r = ERROR_FUNCTION_FAILED, i, count = 0, type;
480 LPWSTR name;
482 TRACE("%ld %d %p\n", hView, info, hRec);
484 if( !hRec )
485 return ERROR_INVALID_PARAMETER;
487 if( info != MSICOLINFO_NAMES && info != MSICOLINFO_TYPES )
488 return ERROR_INVALID_PARAMETER;
490 query = msihandle2msiinfo( hView, MSIHANDLETYPE_VIEW );
491 if( !query )
492 return ERROR_INVALID_HANDLE;
494 view = query->view;
495 if( !view )
496 goto out;
498 if( !view->ops->get_dimensions )
499 goto out;
501 r = view->ops->get_dimensions( view, NULL, &count );
502 if( r )
503 goto out;
504 if( !count )
506 r = ERROR_INVALID_PARAMETER;
507 goto out;
510 rec = MSI_CreateRecord( count );
511 if( !rec )
513 r = ERROR_FUNCTION_FAILED;
514 goto out;
517 for( i=0; i<count; i++ )
519 name = NULL;
520 r = view->ops->get_column_info( view, i+1, &name, &type );
521 if( r != ERROR_SUCCESS )
522 continue;
523 if (info == MSICOLINFO_NAMES)
524 MSI_RecordSetStringW( rec, i+1, name );
525 else
526 msi_set_record_type_string( rec, i+1, type);
527 msi_free( name );
530 *hRec = alloc_msihandle( &rec->hdr );
532 out:
533 msiobj_release( &query->hdr );
534 if( rec )
535 msiobj_release( &rec->hdr );
537 return r;
540 UINT WINAPI MsiViewModify( MSIHANDLE hView, MSIMODIFY eModifyMode,
541 MSIHANDLE hRecord)
543 MSIVIEW *view = NULL;
544 MSIQUERY *query = NULL;
545 MSIRECORD *rec = NULL;
546 UINT r = ERROR_FUNCTION_FAILED;
548 TRACE("%ld %x %ld\n", hView, eModifyMode, hRecord);
550 query = msihandle2msiinfo( hView, MSIHANDLETYPE_VIEW );
551 if( !query )
552 return ERROR_INVALID_HANDLE;
554 view = query->view;
555 if( !view )
556 goto out;
558 if( !view->ops->modify )
559 goto out;
561 rec = msihandle2msiinfo( hRecord, MSIHANDLETYPE_RECORD );
562 if( !rec )
564 r = ERROR_INVALID_HANDLE;
565 goto out;
568 r = view->ops->modify( view, eModifyMode, rec );
570 out:
571 msiobj_release( &query->hdr );
572 if( rec )
573 msiobj_release( &rec->hdr );
575 return r;
578 MSIDBERROR WINAPI MsiViewGetErrorW( MSIHANDLE handle, LPWSTR szColumnNameBuffer,
579 DWORD *pcchBuf )
581 MSIQUERY *query = NULL;
582 static const WCHAR szError[] = { 0 };
583 MSIDBERROR r = MSIDBERROR_NOERROR;
584 int len;
586 FIXME("%ld %p %p - returns empty error string\n",
587 handle, szColumnNameBuffer, pcchBuf );
589 if( !pcchBuf )
590 return MSIDBERROR_INVALIDARG;
592 query = msihandle2msiinfo( handle, MSIHANDLETYPE_VIEW );
593 if( !query )
594 return MSIDBERROR_INVALIDARG;
596 len = lstrlenW( szError );
597 if( szColumnNameBuffer )
599 if( *pcchBuf > len )
600 lstrcpyW( szColumnNameBuffer, szError );
601 else
602 r = MSIDBERROR_MOREDATA;
604 *pcchBuf = len;
606 msiobj_release( &query->hdr );
607 return r;
610 MSIDBERROR WINAPI MsiViewGetErrorA( MSIHANDLE handle, LPSTR szColumnNameBuffer,
611 DWORD *pcchBuf )
613 static const CHAR szError[] = { 0 };
614 MSIQUERY *query = NULL;
615 MSIDBERROR r = MSIDBERROR_NOERROR;
616 int len;
618 FIXME("%ld %p %p - returns empty error string\n",
619 handle, szColumnNameBuffer, pcchBuf );
621 if( !pcchBuf )
622 return MSIDBERROR_INVALIDARG;
624 query = msihandle2msiinfo( handle, MSIHANDLETYPE_VIEW );
625 if( !query )
626 return MSIDBERROR_INVALIDARG;
628 len = lstrlenA( szError );
629 if( szColumnNameBuffer )
631 if( *pcchBuf > len )
632 lstrcpyA( szColumnNameBuffer, szError );
633 else
634 r = MSIDBERROR_MOREDATA;
636 *pcchBuf = len;
638 msiobj_release( &query->hdr );
639 return r;
642 MSIHANDLE WINAPI MsiGetLastErrorRecord( void )
644 FIXME("\n");
645 return 0;
648 DEFINE_GUID( CLSID_MsiTransform, 0x000c1082, 0x0000, 0x0000, 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
650 UINT MSI_DatabaseApplyTransformW( MSIDATABASE *db,
651 LPCWSTR szTransformFile, int iErrorCond )
653 UINT r;
654 IStorage *stg = NULL;
656 TRACE("%p %s %d\n", db, debugstr_w(szTransformFile), iErrorCond);
658 r = StgOpenStorage( szTransformFile, NULL,
659 STGM_DIRECT|STGM_READ|STGM_SHARE_DENY_WRITE, NULL, 0, &stg);
660 if( r )
661 return r;
663 if( TRACE_ON( msi ) )
664 enum_stream_names( stg );
666 r = msi_table_apply_transform( db, stg );
668 IStorage_Release( stg );
670 return r;
673 UINT WINAPI MsiDatabaseApplyTransformW( MSIHANDLE hdb,
674 LPCWSTR szTransformFile, int iErrorCond)
676 MSIDATABASE *db;
677 UINT r;
679 db = msihandle2msiinfo( hdb, MSIHANDLETYPE_DATABASE );
680 if( !db )
681 return ERROR_INVALID_HANDLE;
683 r = MSI_DatabaseApplyTransformW( db, szTransformFile, iErrorCond );
684 msiobj_release( &db->hdr );
685 return r;
688 UINT WINAPI MsiDatabaseApplyTransformA( MSIHANDLE hdb,
689 LPCSTR szTransformFile, int iErrorCond)
691 LPWSTR wstr;
692 UINT ret;
694 TRACE("%ld %s %d\n", hdb, debugstr_a(szTransformFile), iErrorCond);
696 wstr = strdupAtoW( szTransformFile );
697 if( szTransformFile && !wstr )
698 return ERROR_NOT_ENOUGH_MEMORY;
700 ret = MsiDatabaseApplyTransformW( hdb, wstr, iErrorCond);
702 msi_free( wstr );
704 return ret;
707 UINT WINAPI MsiDatabaseGenerateTransformA( MSIHANDLE hdb, MSIHANDLE hdbref,
708 LPCSTR szTransformFile, int iReserved1, int iReserved2 )
710 FIXME("%ld %ld %s %d %d\n", hdb, hdbref,
711 debugstr_a(szTransformFile), iReserved1, iReserved2);
712 return ERROR_CALL_NOT_IMPLEMENTED;
715 UINT WINAPI MsiDatabaseGenerateTransformW( MSIHANDLE hdb, MSIHANDLE hdbref,
716 LPCWSTR szTransformFile, int iReserved1, int iReserved2 )
718 FIXME("%ld %ld %s %d %d\n", hdb, hdbref,
719 debugstr_w(szTransformFile), iReserved1, iReserved2);
720 return ERROR_CALL_NOT_IMPLEMENTED;
723 UINT WINAPI MsiDatabaseCommit( MSIHANDLE hdb )
725 MSIDATABASE *db;
726 UINT r;
728 TRACE("%ld\n", hdb);
730 db = msihandle2msiinfo( hdb, MSIHANDLETYPE_DATABASE );
731 if( !db )
732 return ERROR_INVALID_HANDLE;
734 /* FIXME: lock the database */
736 r = MSI_CommitTables( db );
738 /* FIXME: unlock the database */
740 msiobj_release( &db->hdr );
742 return r;
745 struct msi_primary_key_record_info
747 DWORD n;
748 MSIRECORD *rec;
751 static UINT msi_primary_key_iterator( MSIRECORD *rec, LPVOID param )
753 struct msi_primary_key_record_info *info = param;
754 LPCWSTR name;
755 DWORD type;
757 type = MSI_RecordGetInteger( rec, 4 );
758 if( type & MSITYPE_KEY )
760 info->n++;
761 if( info->rec )
763 name = MSI_RecordGetString( rec, 3 );
764 MSI_RecordSetStringW( info->rec, info->n, name );
768 return ERROR_SUCCESS;
771 UINT MSI_DatabaseGetPrimaryKeys( MSIDATABASE *db,
772 LPCWSTR table, MSIRECORD **prec )
774 static const WCHAR sql[] = {
775 's','e','l','e','c','t',' ','*',' ',
776 'f','r','o','m',' ','`','_','C','o','l','u','m','n','s','`',' ',
777 'w','h','e','r','e',' ',
778 '`','T','a','b','l','e','`',' ','=',' ','\'','%','s','\'',0 };
779 struct msi_primary_key_record_info info;
780 MSIQUERY *query = NULL;
781 MSIVIEW *view;
782 UINT r;
784 r = MSI_OpenQuery( db, &query, sql, table );
785 if( r != ERROR_SUCCESS )
786 return r;
788 view = query->view;
790 /* count the number of primary key records */
791 info.n = 0;
792 info.rec = 0;
793 r = MSI_IterateRecords( query, 0, msi_primary_key_iterator, &info );
794 if( r == ERROR_SUCCESS )
796 TRACE("Found %ld primary keys\n", info.n );
798 /* allocate a record and fill in the names of the tables */
799 info.rec = MSI_CreateRecord( info.n );
800 info.n = 0;
801 r = MSI_IterateRecords( query, 0, msi_primary_key_iterator, &info );
802 if( r == ERROR_SUCCESS )
803 *prec = info.rec;
804 else
805 msiobj_release( &info.rec->hdr );
807 msiobj_release( &query->hdr );
809 return r;
812 UINT WINAPI MsiDatabaseGetPrimaryKeysW( MSIHANDLE hdb,
813 LPCWSTR table, MSIHANDLE* phRec )
815 MSIRECORD *rec = NULL;
816 MSIDATABASE *db;
817 UINT r;
819 TRACE("%ld %s %p\n", hdb, debugstr_w(table), phRec);
821 db = msihandle2msiinfo( hdb, MSIHANDLETYPE_DATABASE );
822 if( !db )
823 return ERROR_INVALID_HANDLE;
825 r = MSI_DatabaseGetPrimaryKeys( db, table, &rec );
826 if( r == ERROR_SUCCESS )
828 *phRec = alloc_msihandle( &rec->hdr );
829 msiobj_release( &rec->hdr );
831 msiobj_release( &db->hdr );
833 return r;
836 UINT WINAPI MsiDatabaseGetPrimaryKeysA(MSIHANDLE hdb,
837 LPCSTR table, MSIHANDLE* phRec)
839 LPWSTR szwTable = NULL;
840 UINT r;
842 TRACE("%ld %s %p\n", hdb, debugstr_a(table), phRec);
844 if( table )
846 szwTable = strdupAtoW( table );
847 if( !szwTable )
848 return ERROR_OUTOFMEMORY;
850 r = MsiDatabaseGetPrimaryKeysW( hdb, szwTable, phRec );
851 msi_free( szwTable );
853 return r;
856 UINT WINAPI MsiDatabaseIsTablePersistentA(
857 MSIHANDLE hDatabase, LPSTR szTableName)
859 FIXME("%lx %s\n", hDatabase, debugstr_a(szTableName));
860 return ERROR_CALL_NOT_IMPLEMENTED;
863 UINT WINAPI MsiDatabaseIsTablePersistentW(
864 MSIHANDLE hDatabase, LPWSTR szTableName)
866 FIXME("%lx %s\n", hDatabase, debugstr_w(szTableName));
867 return ERROR_CALL_NOT_IMPLEMENTED;