On 04.05.2016 06:45, Austin English wrote:
This is from the XP DDK.
For https://bugs.winehq.org/show_bug.cgi?id=37429
-- -Austin
0001-include-add-wmium.h.patch
From 2f6b569db167a01c074d7655b2a285db313a5d83 Mon Sep 17 00:00:00 2001 From: Austin English austinenglish@gmail.com Date: Tue, 3 May 2016 00:59:30 -0500 Subject: [PATCH] include: add wmium.h
Signed-off-by: Austin English austinenglish@gmail.com
include/Makefile.in | 1 + include/wmium.h | 119 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 120 insertions(+) create mode 100644 include/wmium.h
diff --git a/include/Makefile.in b/include/Makefile.in index 250166d..a9e0565 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -666,6 +666,7 @@ HEADER_SRCS = \ winver.h \ wlanapi.h \ wmistr.h \
- wmium.h \ wnaspi32.h \ wownt32.h \ ws2def.h \
diff --git a/include/wmium.h b/include/wmium.h new file mode 100644 index 0000000..b69f205 --- /dev/null +++ b/include/wmium.h @@ -0,0 +1,119 @@ +/*
- Copyright (C) 2016 Austin English
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
+#ifndef _WMIUM_ +#define _WMIUM_
+#define WMIAPI DECLSPEC_IMPORT __stdcall
There should be an #ifdef, DECLSPEC_IMPORT should not be added for the implementation itself.
+#include <guiddef.h> +#include <basetsd.h> +#include <wmistr.h>
+typedef PVOID WMIHANDLE, *PWMIHANDLE, MOFHANDLE, *PMOFHANDLE;
+#define MOFCI_reserved0 0x00000001 +#define MOFCI_reserved1 0x00000002 +#define MOFCI_reserved2 0x00000004
+typedef struct +{
- char *ImagePath;
Shouldn't this be a WCHAR pointer?
- WCHAR *ResourceName;
- ULONG ResourceSize;
- UCHAR *Resourcebuffer;
+} MOFRESOURCEINFOW, *PMOFRESOURCEINFOW;
+typedef struct +{
- char *ImagePath;
- char *ResourceName;
- ULONG ResourceSize;
- UCHAR *Resourcebuffer;
+} MOFRESOURCEINFOA, *PMOFRESOURCEINFOA;
+#ifdef UNICODE +typedef MOFRESOURCEINFOW MOFRESOURCEINFO; +typedef PMOFRESOURCEINFOW PMOFRESOURCEINFO; +#else +typedef MOFRESOURCEINFOA MOFRESOURCEINFO; +typedef PMOFRESOURCEINFOA PMOFRESOURCEINFO; +#endif
+#ifdef __cplusplus +extern "C" { +#endif
+#define NOTIFICATION_TRACE_FLAG 0x00010000 +#define NOTIFICATION_CALLBACK_DIRECT 0x00000004 +#define NOTIFICATION_CHECK_ACCESS 0x00000008
+typedef void (WINAPI *NOTIFICATIONCALLBACK)(WNODE_HEADER *Wnode, UINT_PTR NotificationContext);
There is no need to keep the original parameter names here.
+typedef struct _WMIGUIDINFORMATION +{
- ULONG Size;
- BOOLEAN IsExpensive;
- BOOLEAN IsEventOnly;
+} WMIGUIDINFORMATION, *PWMIGUIDINFORMATION;
+DEFINE_GUID(GUID_REGISTRATION_CHANGE_NOTIFICATION, 0xb48d49a1, 0xe777, 0x11d0, 0xa5, 0xc, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0x10); +DEFINE_GUID(GUID_MOF_RESOURCE_ADDED_NOTIFICATION, 0xb48d49a2, 0xe777, 0x11d0, 0xa5, 0xc, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0x10); +DEFINE_GUID(GUID_MOF_RESOURCE_REMOVED_NOTIFICATION, 0xb48d49a3, 0xe777, 0x11d0, 0xa5, 0xc, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0x10);
+ULONG WMIAPI WmiCloseBlock(WMIHANDLE handle); +ULONG WMIAPI WmiDevInstTonameA(char *instance, ULONG length, char *dev, ULONG index); +ULONG WMIAPI WmiDevInstTonameW(WCHAR *instance, ULONG length, WCHAR *dev, ULONG index);
Those two functions above do not exist in any of my header files. Did you maybe mean WmiDevInstToInstanceNameA/W ?
+ULONG WMIAPI WmiEnumerateGuids(LPGUID list, ULONG *count); +ULONG WMIAPI WmiExecuteMethodA(WMIHANDLE handle, const char *instance, ULONG method, ULONG inputsize,
void *inputbuffer, ULONG *outputsize, void *outputbuffer);
+ULONG WMIAPI WmiExecuteMethodW(WMIHANDLE handle, const WCHAR *instance, ULONG method, ULONG inputsize,
void *inputbuffer, ULONG *outputsize, void *outputbuffer);
+ULONG WMIAPI WmiFileHandleTonameA(WMIHANDLE handle, HANDLE filehandle, ULONG *num, char *names); +ULONG WMIAPI WmiFileHandleTonameW(WMIHANDLE handle, HANDLE filehandle, ULONG *num, WCHAR *names);
Those two functions also not exist. Did you mean WmiFileHandleToInstanceNameA/W?
+void WMIAPI WmiFreeBuffer(void *buffer); +#define WmiInsertTimestamp(WnodeHeader) GetSystemTimeAsFileTime((FILETIME *)&((*WNODE_HEADER)WnodeHeader)->TimeStamp) +ULONG WMIAPI WmiMofEnumerateResourcesA(MOFHANDLE handle, ULONG *count, PMOFRESOURCEINFOA *resource); +ULONG WMIAPI WmiMofEnumerateResourcesW(MOFHANDLE handle, ULONG *count, PMOFRESOURCEINFOW *resource); +ULONG WMIAPI WmiNotificationRegistrationA(LPGUID guid, BOOLEAN enable, void *info, ULONG_PTR context, ULONG flags); +ULONG WMIAPI WmiNotificationRegistrationW(LPGUID guid, BOOLEAN enable, void *info, ULONG_PTR context, ULONG flags); +ULONG WMIAPI WmiOpenBlock(GUID *guid, ULONG access, WMIHANDLE *handle); +ULONG WMIAPI WmiQueryAllDataA(WMIHANDLE handle, ULONG *bufferSize, void *buffer); +ULONG WMIAPI WmiQueryAllDataW(WMIHANDLE handle, ULONG *buffferSize, void *buffer); +ULONG WMIAPI WmiQueryGuidInformation(WMIHANDLE handle, PWMIGUIDINFORMATION guidinfo); +ULONG WMIAPI WmiQuerySingleInstanceA(WMIHANDLE handle, const char *name, ULONG *bufferSize, void *buffer); +ULONG WMIAPI WmiQuerySingleInstanceW(WMIHANDLE handle, const WCHAR *name, ULONG *bufferSize, void *buffer); +ULONG WMIAPI WmiSetSingleInstanceA(WMIHANDLE handle, const char *name, ULONG reserved, ULONG size, void *buffer); +ULONG WMIAPI WmiSetSingleInstanceW(WMIHANDLE handle, const WCHAR *name, ULONG reserved, ULONG size, void *buffer); +ULONG WMIAPI WmiSetSingleItemA(WMIHANDLE handle, const char *name, ULONG id, ULONG reserved, ULONG size, void *buffer); +ULONG WMIAPI WmiSetSingleItemW(WMIHANDLE handle, const WCHAR *name, ULONG id, ULONG reserved, ULONG size, void *buffer);
+DECL_WINELIB_TYPE_AW(WmiDevInstToname) +DECL_WINELIB_TYPE_AW(WmiExecuteMethod) +DECL_WINELIB_TYPE_AW(WmiFileHandleToname) +DECL_WINELIB_TYPE_AW(WmiMofEnumerateResources) +DECL_WINELIB_TYPE_AW(WmiNotificationRegistration) +DECL_WINELIB_TYPE_AW(WmiQueryAllData) +DECL_WINELIB_TYPE_AW(WmiQuerySingleInstance) +DECL_WINELIB_TYPE_AW(WmiSetSingleInstance) +DECL_WINELIB_TYPE_AW(WmiSetSingleItem)
+#ifdef __cplusplus +} +#endif
+#endif /* _WMIUM_ */ -- 2.7.3