Revert tree-restructure attempt: r66583, r66582, r66581, r66578, sauf ntdll changes...
[reactos.git] / reactos / dll / win32 / advapi32 / misc / msi.c
diff --git a/reactos/dll/win32/advapi32/misc/msi.c b/reactos/dll/win32/advapi32/misc/msi.c
new file mode 100644 (file)
index 0000000..bae86b7
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * 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>
+
+WINE_DEFAULT_DEBUG_CHANNEL(advapi);
+#ifndef _UNICODE
+#define debugstr_aw debugstr_a
+#else
+#define debugstr_aw debugstr_w
+#endif
+
+
+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;
+
+    TRACE("%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 */