Add CommandLineFromMsiDescriptor
authorGé van Geldorp <ge@gse.nl>
Thu, 17 Nov 2005 23:19:29 +0000 (23:19 +0000)
committerGé van Geldorp <ge@gse.nl>
Thu, 17 Nov 2005 23:19:29 +0000 (23:19 +0000)
svn path=/trunk/; revision=19318

reactos/lib/advapi32/advapi32.def
reactos/lib/advapi32/advapi32.xml
reactos/lib/advapi32/misc/msi.c [new file with mode: 0644]

index 01fc498..22083fc 100644 (file)
@@ -70,7 +70,7 @@ ClearEventLogW@8
 CloseEventLog@4
 CloseServiceHandle@4
 ;CloseTrace@8
-;CommandLineFromMsiDescriptor@12
+CommandLineFromMsiDescriptor@12
 ;ComputeAccessTokenFromCodeAuthzLevel@20
 ControlService@12
 ControlServiceEx@16
index 6241ce8..87da64f 100644 (file)
@@ -24,6 +24,7 @@
                <file>dllmain.c</file>
                <file>hwprofiles.c</file>
                <file>logon.c</file>
+               <file>msi.c</file>
                <file>shutdown.c</file>
                <file>sysfunc.c</file>
        </directory>
diff --git a/reactos/lib/advapi32/misc/msi.c b/reactos/lib/advapi32/misc/msi.c
new file mode 100644 (file)
index 0000000..1d1fa4c
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * COPYRIGHT:       See COPYING in the top level directory
+ * PROJECT:         ReactOS system libraries
+ * FILE:            lib/advapi32/misc/msi.c
+ * PURPOSE:         advapi32.dll MSI interface funcs
+ * NOTES:           Copied from Wine
+ *                  Copyright 1995 Sven Verdoolaege
+ */
+
+#include <advapi32.h>
+
+#define NDEBUG
+#include <debug.h>
+
+typedef UINT (WINAPI *fnMsiProvideComponentFromDescriptor)(LPCWSTR,LPWSTR,DWORD*,DWORD*);
+
+DWORD WINAPI CommandLineFromMsiDescriptor( WCHAR *szDescriptor,
+                    WCHAR *szCommandLine, DWORD *pcchCommandLine )
+{
+    static const WCHAR szMsi[] = { 'm','s','i',0 };
+    fnMsiProvideComponentFromDescriptor mpcfd;
+    HMODULE hmsi;
+    UINT r = ERROR_CALL_NOT_IMPLEMENTED;
+
+    DPRINT("%S %p %p\n", szDescriptor, szCommandLine, pcchCommandLine);
+
+    hmsi = LoadLibraryW( szMsi );
+    if (!hmsi)
+        return r;
+    mpcfd = (void*) GetProcAddress( hmsi, "MsiProvideComponentFromDescriptorW" );
+    if (mpcfd)
+        r = mpcfd( szDescriptor, szCommandLine, pcchCommandLine, NULL );
+    FreeLibrary( hmsi );
+    return r;
+}
+
+/* EOF */