Commit fba5a59c authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

Better stub for MsiViewGetError.

parent 0946c42d
...@@ -563,12 +563,16 @@ out: ...@@ -563,12 +563,16 @@ out:
return r; return r;
} }
UINT WINAPI MsiViewGetErrorW( MSIHANDLE handle, LPWSTR szColumnNameBuffer, MSIDBERROR WINAPI MsiViewGetErrorW( MSIHANDLE handle, LPWSTR szColumnNameBuffer,
DWORD *pcchBuf ) DWORD *pcchBuf )
{ {
MSIQUERY *query = NULL; MSIQUERY *query = NULL;
static const WCHAR szError[] = { 0 };
MSIDBERROR r = MSIDBERROR_NOERROR;
int len;
FIXME("%ld %p %p\n", handle, szColumnNameBuffer, pcchBuf ); FIXME("%ld %p %p - returns empty error string\n",
handle, szColumnNameBuffer, pcchBuf );
if( !pcchBuf ) if( !pcchBuf )
return MSIDBERROR_INVALIDARG; return MSIDBERROR_INVALIDARG;
...@@ -577,16 +581,30 @@ UINT WINAPI MsiViewGetErrorW( MSIHANDLE handle, LPWSTR szColumnNameBuffer, ...@@ -577,16 +581,30 @@ UINT WINAPI MsiViewGetErrorW( MSIHANDLE handle, LPWSTR szColumnNameBuffer,
if( !query ) if( !query )
return MSIDBERROR_INVALIDARG; return MSIDBERROR_INVALIDARG;
len = lstrlenW( szError );
if( szColumnNameBuffer )
{
if( *pcchBuf > len )
lstrcpyW( szColumnNameBuffer, szError );
else
r = MSIDBERROR_MOREDATA;
}
*pcchBuf = len;
msiobj_release( &query->hdr ); msiobj_release( &query->hdr );
return MSIDBERROR_NOERROR; return r;
} }
UINT WINAPI MsiViewGetErrorA( MSIHANDLE handle, LPSTR szColumnNameBuffer, MSIDBERROR WINAPI MsiViewGetErrorA( MSIHANDLE handle, LPSTR szColumnNameBuffer,
DWORD *pcchBuf ) DWORD *pcchBuf )
{ {
static const CHAR szError[] = { 0 };
MSIQUERY *query = NULL; MSIQUERY *query = NULL;
MSIDBERROR r = MSIDBERROR_NOERROR;
int len;
FIXME("%ld %p %p\n", handle, szColumnNameBuffer, pcchBuf ); FIXME("%ld %p %p - returns empty error string\n",
handle, szColumnNameBuffer, pcchBuf );
if( !pcchBuf ) if( !pcchBuf )
return MSIDBERROR_INVALIDARG; return MSIDBERROR_INVALIDARG;
...@@ -595,8 +613,18 @@ UINT WINAPI MsiViewGetErrorA( MSIHANDLE handle, LPSTR szColumnNameBuffer, ...@@ -595,8 +613,18 @@ UINT WINAPI MsiViewGetErrorA( MSIHANDLE handle, LPSTR szColumnNameBuffer,
if( !query ) if( !query )
return MSIDBERROR_INVALIDARG; return MSIDBERROR_INVALIDARG;
len = lstrlenA( szError );
if( szColumnNameBuffer )
{
if( *pcchBuf > len )
lstrcpyA( szColumnNameBuffer, szError );
else
r = MSIDBERROR_MOREDATA;
}
*pcchBuf = len;
msiobj_release( &query->hdr ); msiobj_release( &query->hdr );
return MSIDBERROR_NOERROR; return r;
} }
UINT WINAPI MsiDatabaseApplyTransformA( MSIHANDLE hdb, UINT WINAPI MsiDatabaseApplyTransformA( MSIHANDLE hdb,
......
...@@ -126,8 +126,8 @@ UINT WINAPI MsiViewClose(MSIHANDLE); ...@@ -126,8 +126,8 @@ UINT WINAPI MsiViewClose(MSIHANDLE);
UINT WINAPI MsiDatabaseOpenViewA(MSIHANDLE,LPCSTR,MSIHANDLE*); UINT WINAPI MsiDatabaseOpenViewA(MSIHANDLE,LPCSTR,MSIHANDLE*);
UINT WINAPI MsiDatabaseOpenViewW(MSIHANDLE,LPCWSTR,MSIHANDLE*); UINT WINAPI MsiDatabaseOpenViewW(MSIHANDLE,LPCWSTR,MSIHANDLE*);
#define MsiDatabaseOpenView WINELIB_NAME_AW(MsiDatabaseOpenView) #define MsiDatabaseOpenView WINELIB_NAME_AW(MsiDatabaseOpenView)
UINT WINAPI MsiViewGetErrorA(MSIHANDLE,LPSTR,DWORD*); MSIDBERROR WINAPI MsiViewGetErrorA(MSIHANDLE,LPSTR,DWORD*);
UINT WINAPI MsiViewGetErrorW(MSIHANDLE,LPWSTR,DWORD*); MSIDBERROR WINAPI MsiViewGetErrorW(MSIHANDLE,LPWSTR,DWORD*);
#define MsiViewGetError WINELIB_NAME_AW(MsiViewGetError) #define MsiViewGetError WINELIB_NAME_AW(MsiViewGetError)
/* record manipulation */ /* record manipulation */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment