msi: Implemention of MsiSummaryInfoGetPropertyW
Aric Stewart
aric at codeweavers.com
Sat Jan 22 02:14:23 CST 2005
An implementation of MsiSummaryInfoGetPropertyW based off of
MsiSummaryInfoGetPropertyA
-aric
-------------- next part --------------
Index: dlls/msi/suminfo.c
===================================================================
RCS file: /home/wine/wine/dlls/msi/suminfo.c,v
retrieving revision 1.10
diff -u -u -r1.10 suminfo.c
--- dlls/msi/suminfo.c 20 Jan 2005 10:36:35 -0000 1.10
+++ dlls/msi/suminfo.c 22 Jan 2005 08:15:23 -0000
@@ -222,9 +222,53 @@
MSIHANDLE hSummaryInfo, UINT uiProperty, UINT *puiDataType, INT *piValue,
FILETIME *pftValue, LPWSTR szValueBuf, DWORD *pcchValueBuf)
{
- FIXME("%ld %d %p %p %p %p %p\n",
+ MSISUMMARYINFO *suminfo;
+ HRESULT r;
+ PROPSPEC spec;
+ PROPVARIANT var;
+
+ TRACE("%ld %d %p %p %p %p %p\n",
hSummaryInfo, uiProperty, puiDataType, piValue,
pftValue, szValueBuf, pcchValueBuf);
-
- return ERROR_CALL_NOT_IMPLEMENTED;
+
+ suminfo = msihandle2msiinfo( hSummaryInfo, MSIHANDLETYPE_SUMMARYINFO );
+ if( !suminfo )
+ return ERROR_INVALID_HANDLE;
+
+ spec.ulKind = PRSPEC_PROPID;
+ spec.u.propid = uiProperty;
+
+ r = IPropertyStorage_ReadMultiple( suminfo->propstg, 1, &spec, &var);
+ if( FAILED(r) )
+ return ERROR_FUNCTION_FAILED;
+
+ if( puiDataType )
+ *puiDataType = var.vt;
+
+ switch( var.vt )
+ {
+ case VT_I4:
+ if( piValue )
+ *piValue = var.u.lVal;
+ break;
+ case VT_LPSTR:
+ if( pcchValueBuf && szValueBuf )
+ {
+ MultiByteToWideChar(CP_ACP, 0, var.u.pszVal, -1, szValueBuf,
+ *pcchValueBuf );
+ *pcchValueBuf = lstrlenA( var.u.pszVal );
+ }
+ break;
+ case VT_FILETIME:
+ if( pftValue )
+ memcpy(pftValue, &var.u.filetime, sizeof (FILETIME) );
+ break;
+ case VT_EMPTY:
+ break;
+ default:
+ FIXME("Unknown property variant type\n");
+ break;
+ }
+
+ return ERROR_SUCCESS;
}
More information about the wine-patches
mailing list