diff -rupN --no-dereference Python-3.8.2/Modules/Setup Python-3.8.2-new/Modules/Setup
--- Python-3.8.2/Modules/Setup 2020-03-02 13:05:24.133235222 +0100
+++ Python-3.8.2-new/Modules/Setup 2020-03-02 13:05:24.892201930 +0100
@@ -117,6 +117,9 @@ _stat _stat.c # stat.h interface
time -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal timemodule.c # -lm # time operations and variables
_thread -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal _threadmodule.c # low-level threading interface
+# build-in modules for windows platform:
+winreg ../PC/winreg.c
+
# access to ISO C locale support
_locale -DPy_BUILD_CORE_BUILTIN _localemodule.c # -lintl
diff -rupN --no-dereference Python-3.8.2/PC/winreg.c Python-3.8.2-new/PC/winreg.c
--- Python-3.8.2/PC/winreg.c 2020-03-02 13:05:21.164367400 +0100
+++ Python-3.8.2-new/PC/winreg.c 2020-03-02 13:05:24.893201886 +0100
@@ -17,6 +17,25 @@
#include "structmember.h"
#include "windows.h"
+#ifndef SIZEOF_HKEY
+/* used only here */
+#if defined(MS_WIN64)
+# define SIZEOF_HKEY 8
+#elif defined(MS_WIN32)
+# define SIZEOF_HKEY 4
+#else
+# error "SIZEOF_HKEY is not defined"
+#endif
+#endif
+
+#ifndef REG_LEGAL_CHANGE_FILTER
+#define REG_LEGAL_CHANGE_FILTER (\
+ REG_NOTIFY_CHANGE_NAME |\
+ REG_NOTIFY_CHANGE_ATTRIBUTES |\
+ REG_NOTIFY_CHANGE_LAST_SET |\
+ REG_NOTIFY_CHANGE_SECURITY )
+#endif
+
static BOOL PyHKEY_AsHKEY(PyObject *ob, HKEY *pRes, BOOL bNoneOK);
static BOOL clinic_HKEY_converter(PyObject *ob, void *p);
static PyObject *PyHKEY_FromHKEY(HKEY h);