[PATCH] advapi32: add initial Perf* stubs (try 2)
Austin English
austinenglish at gmail.com
Fri Nov 17 17:40:06 CST 2017
This time, with missing perflib.h
Signed-off-by: Austin English <austinenglish at gmail.com>
---
dlls/advapi32/Makefile.in | 1 +
dlls/advapi32/advapi32.spec | 14 ++++-----
dlls/advapi32/perf.c | 71 +++++++++++++++++++++++++++++++++++++++++++++
include/perflib.h | 63 ++++++++++++++++++++++++++++++++++++++++
4 files changed, 142 insertions(+), 7 deletions(-)
create mode 100644 dlls/advapi32/perf.c
create mode 100644 include/perflib.h
diff --git a/dlls/advapi32/Makefile.in b/dlls/advapi32/Makefile.in
index ff6452a91b..224286f28c 100644
--- a/dlls/advapi32/Makefile.in
+++ b/dlls/advapi32/Makefile.in
@@ -16,6 +16,7 @@ C_SRCS = \
crypt_sha.c \
eventlog.c \
lsa.c \
+ perf.c \
registry.c \
security.c \
service.c \
diff --git a/dlls/advapi32/advapi32.spec b/dlls/advapi32/advapi32.spec
index 359efc9ad1..4645f3c573 100644
--- a/dlls/advapi32/advapi32.spec
+++ b/dlls/advapi32/advapi32.spec
@@ -553,11 +553,11 @@
# @ stub OperationStart
# @ stub PerfAddCounters
# @ stub PerfCloseQueryHandle
-# @ stub PerfCreateInstance
+@ stdcall PerfCreateInstance(long ptr wstr long)
# @ stub PerfDecrementULongCounterValue
# @ stub PerfDecrementULongLongCounterValue
# @ stub PerfDeleteCounters
-# @ stub PerfDeleteInstance
+@ stdcall PerfDeleteInstance(long ptr)
# @ stub PerfEnumerateCounterSet
# @ stub PerfEnumerateCounterSetInstances
# @ stub PerfIncrementULongCounterValue
@@ -573,13 +573,13 @@
# @ stub PerfRegQueryInfoKey
# @ stub PerfRegQueryValue
# @ stub PerfRegSetValue
-# @ stub PerfSetCounterRefValue
-# @ stub PerfSetCounterSetInfo
+@ stdcall PerfSetCounterRefValue(long ptr long ptr)
+@ stdcall PerfSetCounterSetInfo(long ptr long)
# @ stub PerfSetULongCounterValue
# @ stub PerfSetULongLongCounterValue
-# @ stub PerfStartProvider
-# @ stub PerfStartProviderEx
-# @ stub PerfStopProvider
+@ stdcall PerfStartProvider(ptr ptr ptr)
+@ stdcall PerfStartProviderEx(ptr ptr ptr)
+@ stdcall PerfStopProvider(long)
@ stdcall PrivilegeCheck(ptr ptr ptr)
@ stdcall PrivilegedServiceAuditAlarmA(str str long ptr long)
@ stdcall PrivilegedServiceAuditAlarmW(wstr wstr long ptr long)
diff --git a/dlls/advapi32/perf.c b/dlls/advapi32/perf.c
new file mode 100644
index 0000000000..754af2a89b
--- /dev/null
+++ b/dlls/advapi32/perf.c
@@ -0,0 +1,71 @@
+/*
+ * advapi32 perf functions
+ *
+ * Copyright 2017 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
+ */
+
+#include <stdio.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "perflib.h"
+
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(advapi);
+
+PPERF_COUNTERSET_INSTANCE WINAPI PerfCreateInstance(HANDLE handle, LPCGUID guid, const WCHAR *name, ULONG id)
+{
+ FIXME("%p %s %s %u: stub\n", handle, debugstr_guid(guid), debugstr_w(name), id);
+ return NULL;
+}
+
+ULONG WINAPI PerfDeleteInstance(HANDLE provider, PPERF_COUNTERSET_INSTANCE block)
+{
+ FIXME("%p %p: stub\n", provider, block);
+ return ERROR_CALL_NOT_IMPLEMENTED;
+}
+
+ULONG WINAPI PerfSetCounterSetInfo(HANDLE handle, PPERF_COUNTERSET_INFO template, ULONG size)
+{
+ FIXME("%p %p %u: stub\n", handle, template, size);
+ return ERROR_CALL_NOT_IMPLEMENTED;
+}
+
+ULONG WINAPI PerfSetCounterRefValue(HANDLE provider, PPERF_COUNTERSET_INSTANCE instance, ULONG counterid, void *address)
+{
+ FIXME("%p %p %u %p: stub\n", provider, instance, counterid, address);
+ return ERROR_CALL_NOT_IMPLEMENTED;
+}
+
+ULONG WINAPI PerfStartProvider(GUID *guid, PERFLIBREQUEST callback, HANDLE *provider)
+{
+ FIXME("%s %p %p: stub\n", debugstr_guid(guid), callback, provider);
+ return ERROR_CALL_NOT_IMPLEMENTED;
+}
+
+ULONG WINAPI PerfStartProviderEx(GUID *guid, PPERF_PROVIDER_CONTEXT context, HANDLE *provider)
+{
+ FIXME("%s %p %p: stub\n", debugstr_guid(guid), context, provider);
+ return ERROR_CALL_NOT_IMPLEMENTED;
+}
+
+ULONG WINAPI PerfStopProvider(HANDLE handle)
+{
+ FIXME("%p: stub\n", handle);
+ return ERROR_CALL_NOT_IMPLEMENTED;
+}
diff --git a/include/perflib.h b/include/perflib.h
new file mode 100644
index 0000000000..9a4d8db64b
--- /dev/null
+++ b/include/perflib.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2017 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 _PERFLIB_H_
+#define _PERFLIB_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef LPVOID (* PERF_MEM_ALLOC)(IN SIZE_T AllocSize, IN LPVOID pContext);
+typedef void (* PERF_MEM_FREE)(IN LPVOID pBuffer, IN LPVOID pContext);
+
+typedef ULONG (WINAPI* PERFLIBREQUEST)(
+ IN ULONG RequestCode,
+ IN PVOID Buffer,
+ IN ULONG BufferSize
+);
+
+typedef struct _PERF_COUNTERSET_INFO {
+ GUID CounterSetGuid;
+ GUID ProviderGuid;
+ ULONG NumCounters;
+ ULONG InstanceType;
+} PERF_COUNTERSET_INFO, * PPERF_COUNTERSET_INFO;
+
+typedef struct _PERF_COUNTERSET_INSTANCE {
+ GUID CounterSetGuid;
+ ULONG dwSize;
+ ULONG InstanceId;
+ ULONG InstanceNameOffset;
+ ULONG InstanceNameSize;
+} PERF_COUNTERSET_INSTANCE, * PPERF_COUNTERSET_INSTANCE;
+
+typedef struct _PROVIDER_CONTEXT {
+ DWORD ContextSize;
+ DWORD Reserved;
+ PERFLIBREQUEST ControlCallback;
+ PERF_MEM_ALLOC MemAllocRoutine;
+ PERF_MEM_FREE MemFreeRoutine;
+ LPVOID pMemContext;
+} PERF_PROVIDER_CONTEXT, * PPERF_PROVIDER_CONTEXT;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* _PERFLIB_H_ */
--
2.13.6
More information about the wine-devel
mailing list