2020-10-01 15:48:09 -07:00
|
|
|
From 768f70f18be51fe0a1d92c04fbf3795fd619e127 Mon Sep 17 00:00:00 2001
|
2017-04-09 05:25:13 -07:00
|
|
|
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
|
|
|
Date: Mon, 3 Apr 2017 01:06:26 +0200
|
2018-02-19 13:24:24 -08:00
|
|
|
Subject: [PATCH] ntdll: Add dummy apiset to PEB.
|
2017-04-09 05:25:13 -07:00
|
|
|
|
|
|
|
---
|
2020-06-29 16:56:48 -07:00
|
|
|
dlls/ntdll/loader.c | 2 ++
|
2017-04-09 05:25:13 -07:00
|
|
|
include/Makefile.in | 1 +
|
2019-03-07 15:53:33 -08:00
|
|
|
include/apiset.h | 37 +++++++++++++++++++++++++++++++++++++
|
2017-04-09 05:25:13 -07:00
|
|
|
include/winternl.h | 3 ++-
|
2019-03-07 15:53:33 -08:00
|
|
|
4 files changed, 42 insertions(+), 1 deletion(-)
|
2017-04-09 05:25:13 -07:00
|
|
|
create mode 100644 include/apiset.h
|
|
|
|
|
2020-06-29 16:56:48 -07:00
|
|
|
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
|
2020-10-01 15:48:09 -07:00
|
|
|
index c2187a19397..2fb24737495 100644
|
2020-06-29 16:56:48 -07:00
|
|
|
--- a/dlls/ntdll/loader.c
|
|
|
|
+++ b/dlls/ntdll/loader.c
|
2020-10-01 15:48:09 -07:00
|
|
|
@@ -170,6 +170,7 @@ static PEB_LDR_DATA ldr = { sizeof(ldr), TRUE };
|
2017-04-09 05:25:13 -07:00
|
|
|
static RTL_BITMAP tls_bitmap;
|
|
|
|
static RTL_BITMAP tls_expansion_bitmap;
|
|
|
|
static RTL_BITMAP fls_bitmap;
|
|
|
|
+static API_SET_NAMESPACE_ARRAY apiset_map;
|
|
|
|
|
2020-10-01 15:48:09 -07:00
|
|
|
static WINE_MODREF *cached_modref;
|
|
|
|
static WINE_MODREF *current_modref;
|
|
|
|
@@ -4017,6 +4018,7 @@ static NTSTATUS process_init(void)
|
2020-06-01 20:31:00 -07:00
|
|
|
|
2020-06-29 16:56:48 -07:00
|
|
|
peb->LdrData = &ldr;
|
2017-08-31 14:11:13 -07:00
|
|
|
peb->FastPebLock = &peb_lock;
|
2017-04-09 05:25:13 -07:00
|
|
|
+ peb->ApiSetMap = &apiset_map;
|
|
|
|
peb->TlsBitmap = &tls_bitmap;
|
|
|
|
peb->TlsExpansionBitmap = &tls_expansion_bitmap;
|
|
|
|
peb->FlsBitmap = &fls_bitmap;
|
|
|
|
diff --git a/include/Makefile.in b/include/Makefile.in
|
2020-10-01 15:48:09 -07:00
|
|
|
index 34daad90e78..ad4a131c245 100644
|
2017-04-09 05:25:13 -07:00
|
|
|
--- a/include/Makefile.in
|
|
|
|
+++ b/include/Makefile.in
|
2020-04-30 15:39:18 -07:00
|
|
|
@@ -15,6 +15,7 @@ SOURCES = \
|
2019-03-07 15:53:33 -08:00
|
|
|
amsi.idl \
|
2018-02-19 13:24:24 -08:00
|
|
|
amstream.idl \
|
|
|
|
amvideo.idl \
|
|
|
|
+ apiset.h \
|
2018-10-31 14:08:00 -07:00
|
|
|
appcompatapi.h \
|
2017-04-09 05:25:13 -07:00
|
|
|
appmgmt.h \
|
2017-10-05 14:09:54 -07:00
|
|
|
appmodel.h \
|
2017-04-09 05:25:13 -07:00
|
|
|
diff --git a/include/apiset.h b/include/apiset.h
|
|
|
|
new file mode 100644
|
2020-04-30 15:39:18 -07:00
|
|
|
index 00000000000..6801cd5f509
|
2017-04-09 05:25:13 -07:00
|
|
|
--- /dev/null
|
|
|
|
+++ b/include/apiset.h
|
2019-03-07 15:53:33 -08:00
|
|
|
@@ -0,0 +1,37 @@
|
2017-04-09 05:25:13 -07:00
|
|
|
+/*
|
|
|
|
+ * Copyright (C) 2017 Michael Müller
|
|
|
|
+ *
|
|
|
|
+ * 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
|
|
|
|
+ */
|
2018-10-31 14:08:00 -07:00
|
|
|
+#ifndef _API_SET_H_
|
|
|
|
+#define _API_SET_H_
|
2017-04-09 05:25:13 -07:00
|
|
|
+
|
|
|
|
+#include <windef.h>
|
|
|
|
+
|
|
|
|
+typedef struct _API_SET_NAMESPACE_ENTRY
|
|
|
|
+{
|
|
|
|
+ ULONG NameOffset;
|
|
|
|
+ ULONG NameLength;
|
|
|
|
+ ULONG DataOffset;
|
|
|
|
+} API_SET_NAMESPACE_ENTRY, *PAPI_SET_NAMESPACE_ENTRY;
|
|
|
|
+
|
|
|
|
+typedef struct _API_SET_NAMESPACE_ARRAY
|
|
|
|
+{
|
|
|
|
+ ULONG Version;
|
|
|
|
+ ULONG Count;
|
|
|
|
+ API_SET_NAMESPACE_ENTRY Array[1];
|
|
|
|
+} API_SET_NAMESPACE_ARRAY, *PAPI_SET_NAMESPACE_ARRAY;
|
2018-10-31 14:08:00 -07:00
|
|
|
+
|
|
|
|
+#endif
|
2017-04-09 05:25:13 -07:00
|
|
|
diff --git a/include/winternl.h b/include/winternl.h
|
2020-10-01 15:48:09 -07:00
|
|
|
index 82328167c9e..6c720f7eff6 100644
|
2017-04-09 05:25:13 -07:00
|
|
|
--- a/include/winternl.h
|
|
|
|
+++ b/include/winternl.h
|
|
|
|
@@ -23,6 +23,7 @@
|
|
|
|
|
|
|
|
#include <ntdef.h>
|
|
|
|
#include <windef.h>
|
|
|
|
+#include <apiset.h>
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
2020-10-01 15:48:09 -07:00
|
|
|
@@ -289,7 +290,7 @@ typedef struct _PEB
|
2017-04-09 05:25:13 -07:00
|
|
|
ULONG EnvironmentUpdateCount; /* 028/050 */
|
|
|
|
PVOID KernelCallbackTable; /* 02c/058 */
|
|
|
|
ULONG Reserved[2]; /* 030/060 */
|
|
|
|
- PVOID /*PPEB_FREE_BLOCK*/ FreeList; /* 038/068 */
|
|
|
|
+ PAPI_SET_NAMESPACE_ARRAY ApiSetMap; /* 038/068 */
|
|
|
|
ULONG TlsExpansionCounter; /* 03c/070 */
|
|
|
|
PRTL_BITMAP TlsBitmap; /* 040/078 */
|
|
|
|
ULONG TlsBitmapBits[2]; /* 044/080 */
|
|
|
|
--
|
2020-10-01 15:48:09 -07:00
|
|
|
2.28.0
|
2017-04-09 05:25:13 -07:00
|
|
|
|