On 03.06.2016 03:52, Austin English wrote:
-- -Austin GPG: 14FB D7EA A041 937B
0001-include-add-wmium.h-try-2.patch
From 9e8d9cfd169c5233958ba0f6a1b7ec0a0559ec92 Mon Sep 17 00:00:00 2001 From: Austin English austinenglish@gmail.com Date: Wed, 1 Jun 2016 22:57:12 -0500 Subject: [PATCH 1/2] include: add wmium.h (try 2)
Signed-off-by: Austin English austinenglish@gmail.com
include/Makefile.in | 1 + include/wmium.h | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 117 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..cb75ae0 --- /dev/null +++ b/include/wmium.h @@ -0,0 +1,116 @@ +/*
- 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_
+#ifdef _WMI_SOURCE_ +#define WMIAPI __stdcall +#else +#define WMIAPI DECLSPEC_IMPORT __stdcall +#endif
+#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
Based on my header files, the "reserved" should be uppercase here.
+typedef struct +{
- char *ImagePath;
- char *ResourceName;
- ULONG ResourceSize;
- UCHAR *Resourcebuffer;
Buffer should start with an uppercase letter here.
+} MOFRESOURCEINFOA, *PMOFRESOURCEINFOA;
+typedef struct +{
- WCHAR *ImagePath;
- WCHAR *ResourceName;
- ULONG ResourceSize;
- UCHAR *Resourcebuffer;
Here too.
+} MOFRESOURCEINFOW, *PMOFRESOURCEINFOW;
+DECL_WINELIB_TYPE_AW(MOFRESOURCEINFO); +DECL_WINELIB_TYPE_AW(PMOFRESOURCEINFO);
+#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 *, UINT_PTR);
+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); +ULONG WMIAPI WmiDevInstToInstanceNameA(char *, ULONG, char *, ULONG); +ULONG WMIAPI WmiDevInstToInstanceNameW(WCHAR *, ULONG, WCHAR *, ULONG); +ULONG WMIAPI WmiEnumerateGuids(LPGUID, ULONG *); +ULONG WMIAPI WmiExecuteMethodA(WMIHANDLE, const char *, ULONG, ULONG, void *, ULONG *, void *); +ULONG WMIAPI WmiExecuteMethodW(WMIHANDLE, const WCHAR *, ULONG, ULONG, void *, ULONG *, void *); +ULONG WMIAPI WmiFileHandleToInstanceNameA(WMIHANDLE, HANDLE, ULONG *, char *); +ULONG WMIAPI WmiFileHandleToInstanceNameW(WMIHANDLE, HANDLE, ULONG *, WCHAR *); +void WMIAPI WmiFreeBuffer(void *); +#define WmiInsertTimestamp(WnodeHeader) GetSystemTimeAsFileTime((FILETIME *)&((*WNODE_HEADER)WnodeHeader)->TimeStamp)
I believe you wanted to write "WNODE_HEADER *" instead of "*WNODE_HEADER".
+ULONG WMIAPI WmiMofEnumerateResourcesA(MOFHANDLE, ULONG *, PMOFRESOURCEINFOA *); +ULONG WMIAPI WmiMofEnumerateResourcesW(MOFHANDLE, ULONG *, PMOFRESOURCEINFOW *); +ULONG WMIAPI WmiNotificationRegistrationA(LPGUID, BOOLEAN, void *, ULONG_PTR *, ULONG); +ULONG WMIAPI WmiNotificationRegistrationW(LPGUID, BOOLEAN, void *, ULONG_PTR *, ULONG);
The ULONG_PTR argument is no pointer here.
+ULONG WMIAPI WmiOpenBlock(GUID *, ULONG, WMIHANDLE *); +ULONG WMIAPI WmiQueryAllDataA(WMIHANDLE, ULONG *, void *); +ULONG WMIAPI WmiQueryAllDataW(WMIHANDLE, ULONG *, void *); +ULONG WMIAPI WmiQueryGuidInformation(WMIHANDLE, PWMIGUIDINFORMATION); +ULONG WMIAPI WmiQuerySingleInstanceA(WMIHANDLE, const char *, ULONG *, void *); +ULONG WMIAPI WmiQuerySingleInstanceW(WMIHANDLE, const WCHAR *, ULONG *, void *); +ULONG WMIAPI WmiSetSingleInstanceA(WMIHANDLE, const char *, ULONG, ULONG, void *); +ULONG WMIAPI WmiSetSingleInstanceW(WMIHANDLE, const WCHAR *, ULONG, ULONG, void *); +ULONG WMIAPI WmiSetSingleItemA(WMIHANDLE, const char *, ULONG, ULONG, ULONG, void *); +ULONG WMIAPI WmiSetSingleItemW(WMIHANDLE, const WCHAR *, ULONG, ULONG, ULONG, void *);
+DECL_WINELIB_TYPE_AW(WmiDevInstToInstanceName) +DECL_WINELIB_TYPE_AW(WmiExecuteMethod) +DECL_WINELIB_TYPE_AW(WmiFileHandleToInstanceName) +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