python-3.6.zip added from Github
README.cosmo contains the necessary links.
16
third_party/python/PC/WinMain.c
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
/* Minimal main program -- everything is loaded from the library. */
|
||||
|
||||
#include "Python.h"
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
int WINAPI wWinMain(
|
||||
HINSTANCE hInstance, /* handle to current instance */
|
||||
HINSTANCE hPrevInstance, /* handle to previous instance */
|
||||
LPWSTR lpCmdLine, /* pointer to command line */
|
||||
int nCmdShow /* show state of window */
|
||||
)
|
||||
{
|
||||
return Py_Main(__argc, __wargv);
|
||||
}
|
259
third_party/python/PC/_findvs.cpp
vendored
Normal file
|
@ -0,0 +1,259 @@
|
|||
//
|
||||
// Helper library for location Visual Studio installations
|
||||
// using the COM-based query API.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// Licensed to PSF under a contributor agreement
|
||||
//
|
||||
|
||||
// Version history
|
||||
// 2017-05: Initial contribution (Steve Dower)
|
||||
|
||||
#include <Windows.h>
|
||||
#include <Strsafe.h>
|
||||
#include "external\include\Setup.Configuration.h"
|
||||
|
||||
#include <Python.h>
|
||||
|
||||
static PyObject *error_from_hr(HRESULT hr)
|
||||
{
|
||||
if (FAILED(hr))
|
||||
PyErr_Format(PyExc_OSError, "Error %08x", hr);
|
||||
assert(PyErr_Occurred());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static PyObject *get_install_name(ISetupInstance2 *inst)
|
||||
{
|
||||
HRESULT hr;
|
||||
BSTR name;
|
||||
PyObject *str = nullptr;
|
||||
if (FAILED(hr = inst->GetDisplayName(LOCALE_USER_DEFAULT, &name)))
|
||||
goto error;
|
||||
str = PyUnicode_FromWideChar(name, SysStringLen(name));
|
||||
SysFreeString(name);
|
||||
return str;
|
||||
error:
|
||||
|
||||
return error_from_hr(hr);
|
||||
}
|
||||
|
||||
static PyObject *get_install_version(ISetupInstance *inst)
|
||||
{
|
||||
HRESULT hr;
|
||||
BSTR ver;
|
||||
PyObject *str = nullptr;
|
||||
if (FAILED(hr = inst->GetInstallationVersion(&ver)))
|
||||
goto error;
|
||||
str = PyUnicode_FromWideChar(ver, SysStringLen(ver));
|
||||
SysFreeString(ver);
|
||||
return str;
|
||||
error:
|
||||
|
||||
return error_from_hr(hr);
|
||||
}
|
||||
|
||||
static PyObject *get_install_path(ISetupInstance *inst)
|
||||
{
|
||||
HRESULT hr;
|
||||
BSTR path;
|
||||
PyObject *str = nullptr;
|
||||
if (FAILED(hr = inst->GetInstallationPath(&path)))
|
||||
goto error;
|
||||
str = PyUnicode_FromWideChar(path, SysStringLen(path));
|
||||
SysFreeString(path);
|
||||
return str;
|
||||
error:
|
||||
|
||||
return error_from_hr(hr);
|
||||
}
|
||||
|
||||
static PyObject *get_installed_packages(ISetupInstance2 *inst)
|
||||
{
|
||||
HRESULT hr;
|
||||
PyObject *res = nullptr;
|
||||
LPSAFEARRAY sa_packages = nullptr;
|
||||
LONG ub = 0;
|
||||
IUnknown **packages = nullptr;
|
||||
PyObject *str = nullptr;
|
||||
|
||||
if (FAILED(hr = inst->GetPackages(&sa_packages)) ||
|
||||
FAILED(hr = SafeArrayAccessData(sa_packages, (void**)&packages)) ||
|
||||
FAILED(SafeArrayGetUBound(sa_packages, 1, &ub)) ||
|
||||
!(res = PyList_New(0)))
|
||||
goto error;
|
||||
|
||||
for (LONG i = 0; i < ub; ++i) {
|
||||
ISetupPackageReference *package = nullptr;
|
||||
BSTR id = nullptr;
|
||||
PyObject *str = nullptr;
|
||||
|
||||
if (FAILED(hr = packages[i]->QueryInterface(&package)) ||
|
||||
FAILED(hr = package->GetId(&id)))
|
||||
goto iter_error;
|
||||
|
||||
str = PyUnicode_FromWideChar(id, SysStringLen(id));
|
||||
SysFreeString(id);
|
||||
|
||||
if (!str || PyList_Append(res, str) < 0)
|
||||
goto iter_error;
|
||||
|
||||
Py_CLEAR(str);
|
||||
package->Release();
|
||||
continue;
|
||||
|
||||
iter_error:
|
||||
if (package) package->Release();
|
||||
Py_XDECREF(str);
|
||||
|
||||
goto error;
|
||||
}
|
||||
|
||||
SafeArrayUnaccessData(sa_packages);
|
||||
SafeArrayDestroy(sa_packages);
|
||||
|
||||
return res;
|
||||
error:
|
||||
if (sa_packages && packages) SafeArrayUnaccessData(sa_packages);
|
||||
if (sa_packages) SafeArrayDestroy(sa_packages);
|
||||
Py_XDECREF(res);
|
||||
|
||||
return error_from_hr(hr);
|
||||
}
|
||||
|
||||
static PyObject *find_all_instances()
|
||||
{
|
||||
ISetupConfiguration *sc = nullptr;
|
||||
ISetupConfiguration2 *sc2 = nullptr;
|
||||
IEnumSetupInstances *enm = nullptr;
|
||||
ISetupInstance *inst = nullptr;
|
||||
ISetupInstance2 *inst2 = nullptr;
|
||||
PyObject *res = nullptr;
|
||||
ULONG fetched;
|
||||
HRESULT hr;
|
||||
|
||||
if (!(res = PyList_New(0)))
|
||||
goto error;
|
||||
|
||||
if (FAILED(hr = CoCreateInstance(
|
||||
__uuidof(SetupConfiguration),
|
||||
NULL,
|
||||
CLSCTX_INPROC_SERVER,
|
||||
__uuidof(ISetupConfiguration),
|
||||
(LPVOID*)&sc
|
||||
)) && hr != REGDB_E_CLASSNOTREG)
|
||||
goto error;
|
||||
|
||||
// If the class is not registered, there are no VS instances installed
|
||||
if (hr == REGDB_E_CLASSNOTREG)
|
||||
return res;
|
||||
|
||||
if (FAILED(hr = sc->QueryInterface(&sc2)) ||
|
||||
FAILED(hr = sc2->EnumAllInstances(&enm)))
|
||||
goto error;
|
||||
|
||||
while (SUCCEEDED(enm->Next(1, &inst, &fetched)) && fetched) {
|
||||
PyObject *name = nullptr;
|
||||
PyObject *version = nullptr;
|
||||
PyObject *path = nullptr;
|
||||
PyObject *packages = nullptr;
|
||||
PyObject *tuple = nullptr;
|
||||
|
||||
if (FAILED(hr = inst->QueryInterface(&inst2)) ||
|
||||
!(name = get_install_name(inst2)) ||
|
||||
!(version = get_install_version(inst)) ||
|
||||
!(path = get_install_path(inst)) ||
|
||||
!(packages = get_installed_packages(inst2)) ||
|
||||
!(tuple = PyTuple_Pack(4, name, version, path, packages)) ||
|
||||
PyList_Append(res, tuple) < 0)
|
||||
goto iter_error;
|
||||
|
||||
Py_DECREF(tuple);
|
||||
Py_DECREF(packages);
|
||||
Py_DECREF(path);
|
||||
Py_DECREF(version);
|
||||
Py_DECREF(name);
|
||||
continue;
|
||||
iter_error:
|
||||
if (inst2) inst2->Release();
|
||||
Py_XDECREF(tuple);
|
||||
Py_XDECREF(packages);
|
||||
Py_XDECREF(path);
|
||||
Py_XDECREF(version);
|
||||
Py_XDECREF(name);
|
||||
goto error;
|
||||
}
|
||||
|
||||
enm->Release();
|
||||
sc2->Release();
|
||||
sc->Release();
|
||||
return res;
|
||||
|
||||
error:
|
||||
if (enm) enm->Release();
|
||||
if (sc2) sc2->Release();
|
||||
if (sc) sc->Release();
|
||||
Py_XDECREF(res);
|
||||
|
||||
return error_from_hr(hr);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(findvs_findall_doc, "findall()\
|
||||
\
|
||||
Finds all installed versions of Visual Studio.\
|
||||
\
|
||||
This function will initialize COM temporarily. To avoid impact on other parts\
|
||||
of your application, use a new thread to make this call.");
|
||||
|
||||
static PyObject *findvs_findall(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
HRESULT hr = CoInitializeEx(nullptr, COINIT_MULTITHREADED);
|
||||
if (hr == RPC_E_CHANGED_MODE)
|
||||
hr = CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
|
||||
if (FAILED(hr))
|
||||
return error_from_hr(hr);
|
||||
PyObject *res = find_all_instances();
|
||||
CoUninitialize();
|
||||
return res;
|
||||
}
|
||||
|
||||
// List of functions to add to findvs in exec_findvs().
|
||||
static PyMethodDef findvs_functions[] = {
|
||||
{ "findall", (PyCFunction)findvs_findall, METH_VARARGS | METH_KEYWORDS, findvs_findall_doc },
|
||||
{ NULL, NULL, 0, NULL }
|
||||
};
|
||||
|
||||
// Initialize findvs. May be called multiple times, so avoid
|
||||
// using static state.
|
||||
static int exec_findvs(PyObject *module)
|
||||
{
|
||||
PyModule_AddFunctions(module, findvs_functions);
|
||||
|
||||
return 0; // success
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(findvs_doc, "The _distutils_findvs helper module");
|
||||
|
||||
static PyModuleDef_Slot findvs_slots[] = {
|
||||
{ Py_mod_exec, exec_findvs },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
static PyModuleDef findvs_def = {
|
||||
PyModuleDef_HEAD_INIT,
|
||||
"_distutils_findvs",
|
||||
findvs_doc,
|
||||
0, // m_size
|
||||
NULL, // m_methods
|
||||
findvs_slots,
|
||||
NULL, // m_traverse
|
||||
NULL, // m_clear
|
||||
NULL, // m_free
|
||||
};
|
||||
|
||||
extern "C" {
|
||||
PyMODINIT_FUNC PyInit__distutils_findvs(void)
|
||||
{
|
||||
return PyModuleDef_Init(&findvs_def);
|
||||
}
|
||||
}
|
1120
third_party/python/PC/_msi.c
vendored
Normal file
131
third_party/python/PC/_testconsole.c
vendored
Normal file
|
@ -0,0 +1,131 @@
|
|||
|
||||
/* Testing module for multi-phase initialization of extension modules (PEP 489)
|
||||
*/
|
||||
|
||||
#include "Python.h"
|
||||
|
||||
#ifdef MS_WINDOWS
|
||||
|
||||
#include "..\modules\_io\_iomodule.h"
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
/* The full definition is in iomodule. We reproduce
|
||||
enough here to get the handle, which is all we want. */
|
||||
typedef struct {
|
||||
PyObject_HEAD
|
||||
HANDLE handle;
|
||||
} winconsoleio;
|
||||
|
||||
|
||||
static int execfunc(PyObject *m)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyModuleDef_Slot testconsole_slots[] = {
|
||||
{Py_mod_exec, execfunc},
|
||||
{0, NULL},
|
||||
};
|
||||
|
||||
/*[clinic input]
|
||||
module _testconsole
|
||||
|
||||
_testconsole.write_input
|
||||
file: object
|
||||
s: PyBytesObject
|
||||
|
||||
Writes UTF-16-LE encoded bytes to the console as if typed by a user.
|
||||
[clinic start generated code]*/
|
||||
|
||||
static PyObject *
|
||||
_testconsole_write_input_impl(PyObject *module, PyObject *file,
|
||||
PyBytesObject *s)
|
||||
/*[clinic end generated code: output=48f9563db34aedb3 input=4c774f2d05770bc6]*/
|
||||
{
|
||||
INPUT_RECORD *rec = NULL;
|
||||
|
||||
if (!PyWindowsConsoleIO_Check(file)) {
|
||||
PyErr_SetString(PyExc_TypeError, "expected raw console object");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const wchar_t *p = (const wchar_t *)PyBytes_AS_STRING(s);
|
||||
DWORD size = (DWORD)PyBytes_GET_SIZE(s) / sizeof(wchar_t);
|
||||
|
||||
rec = (INPUT_RECORD*)PyMem_Malloc(sizeof(INPUT_RECORD) * size);
|
||||
if (!rec)
|
||||
goto error;
|
||||
memset(rec, 0, sizeof(INPUT_RECORD) * size);
|
||||
|
||||
INPUT_RECORD *prec = rec;
|
||||
for (DWORD i = 0; i < size; ++i, ++p, ++prec) {
|
||||
prec->EventType = KEY_EVENT;
|
||||
prec->Event.KeyEvent.bKeyDown = TRUE;
|
||||
prec->Event.KeyEvent.wRepeatCount = 10;
|
||||
prec->Event.KeyEvent.uChar.UnicodeChar = *p;
|
||||
}
|
||||
|
||||
HANDLE hInput = ((winconsoleio*)file)->handle;
|
||||
DWORD total = 0;
|
||||
while (total < size) {
|
||||
DWORD wrote;
|
||||
if (!WriteConsoleInputW(hInput, &rec[total], (size - total), &wrote)) {
|
||||
PyErr_SetFromWindowsErr(0);
|
||||
goto error;
|
||||
}
|
||||
total += wrote;
|
||||
}
|
||||
|
||||
PyMem_Free((void*)rec);
|
||||
|
||||
Py_RETURN_NONE;
|
||||
error:
|
||||
if (rec)
|
||||
PyMem_Free((void*)rec);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
_testconsole.read_output
|
||||
file: object
|
||||
|
||||
Reads a str from the console as written to stdout.
|
||||
[clinic start generated code]*/
|
||||
|
||||
static PyObject *
|
||||
_testconsole_read_output_impl(PyObject *module, PyObject *file)
|
||||
/*[clinic end generated code: output=876310d81a73e6d2 input=b3521f64b1b558e3]*/
|
||||
{
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
#include "clinic\_testconsole.c.h"
|
||||
|
||||
PyMethodDef testconsole_methods[] = {
|
||||
_TESTCONSOLE_WRITE_INPUT_METHODDEF
|
||||
_TESTCONSOLE_READ_OUTPUT_METHODDEF
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
static PyModuleDef testconsole_def = {
|
||||
PyModuleDef_HEAD_INIT, /* m_base */
|
||||
"_testconsole", /* m_name */
|
||||
PyDoc_STR("Test module for the Windows console"), /* m_doc */
|
||||
0, /* m_size */
|
||||
testconsole_methods, /* m_methods */
|
||||
testconsole_slots, /* m_slots */
|
||||
NULL, /* m_traverse */
|
||||
NULL, /* m_clear */
|
||||
NULL, /* m_free */
|
||||
};
|
||||
|
||||
PyMODINIT_FUNC
|
||||
PyInit__testconsole(PyObject *spec)
|
||||
{
|
||||
return PyModuleDef_Init(&testconsole_def);
|
||||
}
|
||||
|
||||
#endif /* MS_WINDOWS */
|
BIN
third_party/python/PC/bdist_wininst/PythonPowered.bmp
vendored
Normal file
After Width: | Height: | Size: 2.5 KiB |
5
third_party/python/PC/bdist_wininst/README.txt
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
|
||||
XXX Write description
|
||||
XXX Dont't forget to mention upx
|
||||
|
||||
XXX Add pointer to this file into PC/README.txt
|
104
third_party/python/PC/bdist_wininst/archive.h
vendored
Normal file
|
@ -0,0 +1,104 @@
|
|||
/*
|
||||
IMPORTANT NOTE: IF THIS FILE IS CHANGED, PCBUILD\BDIST_WININST.VCXPROJ MUST
|
||||
BE REBUILT AS WELL.
|
||||
|
||||
IF CHANGES TO THIS FILE ARE CHECKED IN, THE RECOMPILED BINARIES MUST BE
|
||||
CHECKED IN AS WELL!
|
||||
*/
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
/* zip-archive headers
|
||||
* See: http://www.pkware.com/appnote.html
|
||||
*/
|
||||
|
||||
struct eof_cdir {
|
||||
long tag; /* must be 0x06054b50 */
|
||||
short disknum;
|
||||
short firstdisk;
|
||||
short nTotalCDirThis;
|
||||
short nTotalCDir;
|
||||
long nBytesCDir;
|
||||
long ofsCDir;
|
||||
short commentlen;
|
||||
};
|
||||
|
||||
struct cdir {
|
||||
long tag; /* must be 0x02014b50 */
|
||||
short version_made;
|
||||
short version_extract;
|
||||
short gp_bitflag;
|
||||
short comp_method;
|
||||
short last_mod_file_time;
|
||||
short last_mod_file_date;
|
||||
long crc32;
|
||||
long comp_size;
|
||||
long uncomp_size;
|
||||
short fname_length;
|
||||
short extra_length;
|
||||
short comment_length;
|
||||
short disknum_start;
|
||||
short int_file_attr;
|
||||
long ext_file_attr;
|
||||
long ofs_local_header;
|
||||
};
|
||||
|
||||
struct fhdr {
|
||||
long tag; /* must be 0x04034b50 */
|
||||
short version_needed;
|
||||
short flags;
|
||||
short method;
|
||||
short last_mod_file_time;
|
||||
short last_mod_file_date;
|
||||
long crc32;
|
||||
long comp_size;
|
||||
long uncomp_size;
|
||||
short fname_length;
|
||||
short extra_length;
|
||||
};
|
||||
|
||||
|
||||
struct meta_data_hdr {
|
||||
int tag;
|
||||
int uncomp_size;
|
||||
int bitmap_size;
|
||||
};
|
||||
|
||||
#pragma pack()
|
||||
|
||||
/* installation scheme */
|
||||
|
||||
typedef struct tagSCHEME {
|
||||
char *name;
|
||||
char *prefix;
|
||||
} SCHEME;
|
||||
|
||||
typedef int (*NOTIFYPROC)(int code, LPSTR text, ...);
|
||||
|
||||
extern BOOL
|
||||
extract_file(char *dst, char *src, int method, int comp_size,
|
||||
int uncomp_size, NOTIFYPROC notify);
|
||||
|
||||
extern BOOL
|
||||
unzip_archive(SCHEME *scheme, char *dirname, char *data,
|
||||
DWORD size, NOTIFYPROC notify);
|
||||
|
||||
extern char *
|
||||
map_new_file(DWORD flags, char *filename, char
|
||||
*pathname_part, int size,
|
||||
WORD wFatDate, WORD wFatTime,
|
||||
NOTIFYPROC callback);
|
||||
|
||||
extern BOOL
|
||||
ensure_directory (char *pathname, char *new_part,
|
||||
NOTIFYPROC callback);
|
||||
|
||||
/* codes for NOITIFYPROC */
|
||||
#define DIR_CREATED 1
|
||||
#define CAN_OVERWRITE 2
|
||||
#define FILE_CREATED 3
|
||||
#define ZLIB_ERROR 4
|
||||
#define SYSTEM_ERROR 5
|
||||
#define NUM_FILES 6
|
||||
#define FILE_OVERWRITTEN 7
|
||||
|
108
third_party/python/PC/bdist_wininst/bdist_wininst.vcxproj
vendored
Normal file
|
@ -0,0 +1,108 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="PGInstrument|Win32">
|
||||
<Configuration>PGInstrument</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="PGInstrument|x64">
|
||||
<Configuration>PGInstrument</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="PGUpdate|Win32">
|
||||
<Configuration>PGUpdate</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="PGUpdate|x64">
|
||||
<Configuration>PGUpdate</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{EB1C19C1-1F18-421E-9735-CAEE69DC6A3C}</ProjectGuid>
|
||||
<RootNamespace>wininst</RootNamespace>
|
||||
<SupportPGO>false</SupportPGO>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\..\PCBuild\python.props" />
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<CharacterSet>NotSet</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\PCBuild\pyproject.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir>$(PySourcePath)lib\distutils\command\</OutDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<TargetName>wininst-$(VisualStudioVersion)</TargetName>
|
||||
<TargetName Condition="$(PlatformToolset) == 'v140'">wininst-14.0</TargetName>
|
||||
<TargetName Condition="$(PlatformToolset) == 'v120'">wininst-12.0</TargetName>
|
||||
<TargetName Condition="$(PlatformToolset) == 'v110'">wininst-11.0</TargetName>
|
||||
<TargetName Condition="$(PlatformToolset) == 'v100'">wininst-10.0</TargetName>
|
||||
<TargetName Condition="$(Platform) == 'x64'">$(TargetName)-amd64</TargetName>
|
||||
<TargetExt>.exe</TargetExt>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<Midl>
|
||||
<TypeLibraryName>$(OutDir)wininst.tlb</TypeLibraryName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MinSpace</Optimization>
|
||||
<AdditionalIncludeDirectories>$(PySourcePath)Modules\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary Condition="'$(Configuration)'=='Debug'">MultiThreadedDebug</RuntimeLibrary>
|
||||
<RuntimeLibrary Condition="'$(Configuration)'=='Release'">MultiThreaded</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<AdditionalIncludeDirectories>$(PySourcePath)PC\bdist_wininst;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>comctl32.lib;imagehlp.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="extract.c" />
|
||||
<ClCompile Include="install.c" />
|
||||
<ClCompile Include="..\..\Modules\zlib\adler32.c" />
|
||||
<ClCompile Include="..\..\Modules\zlib\crc32.c" />
|
||||
<ClCompile Include="..\..\Modules\zlib\inffast.c" />
|
||||
<ClCompile Include="..\..\Modules\zlib\inflate.c" />
|
||||
<ClCompile Include="..\..\Modules\zlib\inftrees.c" />
|
||||
<ClCompile Include="..\..\Modules\zlib\zutil.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="archive.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="install.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="PythonPowered.bmp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
61
third_party/python/PC/bdist_wininst/bdist_wininst.vcxproj.filters
vendored
Normal file
|
@ -0,0 +1,61 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{293b1092-03ad-4b7c-acb9-c4ab62e52f55}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\zlib">
|
||||
<UniqueIdentifier>{0edc0406-282f-4dbc-b60e-a867c34a2a31}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{ea0c0f0e-3b73-474e-a999-e9689d032ccc}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{0c77c1cf-3f87-4f87-bd86-b425211c2181}</UniqueIdentifier>
|
||||
<Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\PC\bdist_wininst\extract.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\PC\bdist_wininst\install.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Modules\zlib\adler32.c">
|
||||
<Filter>Source Files\zlib</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Modules\zlib\crc32.c">
|
||||
<Filter>Source Files\zlib</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Modules\zlib\inffast.c">
|
||||
<Filter>Source Files\zlib</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Modules\zlib\inflate.c">
|
||||
<Filter>Source Files\zlib</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Modules\zlib\inftrees.c">
|
||||
<Filter>Source Files\zlib</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Modules\zlib\zutil.c">
|
||||
<Filter>Source Files\zlib</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\PC\bdist_wininst\archive.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="..\PC\bdist_wininst\install.rc">
|
||||
<Filter>Resource Files</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\PC\bdist_wininst\PythonPowered.bmp">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
19
third_party/python/PC/bdist_wininst/build.bat
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
@echo off
|
||||
setlocal
|
||||
|
||||
set D=%~dp0
|
||||
set PCBUILD=%~dp0..\..\PCBuild\
|
||||
|
||||
|
||||
echo Building Lib\distutils\command\wininst-xx.0.exe
|
||||
|
||||
call "%PCBUILD%find_msbuild.bat" %MSBUILD%
|
||||
if ERRORLEVEL 1 (echo Cannot locate MSBuild.exe on PATH or as MSBUILD variable & exit /b 2)
|
||||
|
||||
%MSBUILD% "%D%bdist_wininst.vcxproj" "/p:SolutionDir=%PCBUILD%\" /p:Configuration=Release /p:Platform=Win32
|
||||
if errorlevel 1 goto :eof
|
||||
|
||||
|
||||
echo Building Lib\distutils\command\wininst-xx.0-amd64.exe
|
||||
|
||||
%MSBUILD% "%D%bdist_wininst.vcxproj" "/p:SolutionDir=%PCBUILD%\" /p:Configuration=Release /p:Platform=x64
|
320
third_party/python/PC/bdist_wininst/extract.c
vendored
Normal file
|
@ -0,0 +1,320 @@
|
|||
/*
|
||||
IMPORTANT NOTE: IF THIS FILE IS CHANGED, PCBUILD\BDIST_WININST.VCXPROJ MUST
|
||||
BE REBUILT AS WELL.
|
||||
|
||||
IF CHANGES TO THIS FILE ARE CHECKED IN, THE RECOMPILED BINARIES MUST BE
|
||||
CHECKED IN AS WELL!
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include "zlib.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "archive.h"
|
||||
|
||||
/* Convert unix-path to dos-path */
|
||||
static void normpath(char *path)
|
||||
{
|
||||
while (path && *path) {
|
||||
if (*path == '/')
|
||||
*path = '\\';
|
||||
++path;
|
||||
}
|
||||
}
|
||||
|
||||
BOOL ensure_directory(char *pathname, char *new_part, NOTIFYPROC notify)
|
||||
{
|
||||
while (new_part && *new_part && (new_part = strchr(new_part, '\\'))) {
|
||||
DWORD attr;
|
||||
*new_part = '\0';
|
||||
attr = GetFileAttributes(pathname);
|
||||
if (attr == -1) {
|
||||
/* nothing found */
|
||||
if (!CreateDirectory(pathname, NULL) && notify)
|
||||
notify(SYSTEM_ERROR,
|
||||
"CreateDirectory (%s)", pathname);
|
||||
else
|
||||
notify(DIR_CREATED, pathname);
|
||||
}
|
||||
if (attr & FILE_ATTRIBUTE_DIRECTORY) {
|
||||
;
|
||||
} else {
|
||||
SetLastError(183);
|
||||
if (notify)
|
||||
notify(SYSTEM_ERROR,
|
||||
"CreateDirectory (%s)", pathname);
|
||||
}
|
||||
*new_part = '\\';
|
||||
++new_part;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* XXX Should better explicitly specify
|
||||
* uncomp_size and file_times instead of pfhdr!
|
||||
*/
|
||||
char *map_new_file(DWORD flags, char *filename,
|
||||
char *pathname_part, int size,
|
||||
WORD wFatDate, WORD wFatTime,
|
||||
NOTIFYPROC notify)
|
||||
{
|
||||
HANDLE hFile, hFileMapping;
|
||||
char *dst;
|
||||
FILETIME ft;
|
||||
|
||||
try_again:
|
||||
if (!flags)
|
||||
flags = CREATE_NEW;
|
||||
hFile = CreateFile(filename,
|
||||
GENERIC_WRITE | GENERIC_READ,
|
||||
0, NULL,
|
||||
flags,
|
||||
FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
if (hFile == INVALID_HANDLE_VALUE) {
|
||||
DWORD x = GetLastError();
|
||||
switch (x) {
|
||||
case ERROR_FILE_EXISTS:
|
||||
if (notify && notify(CAN_OVERWRITE, filename))
|
||||
hFile = CreateFile(filename,
|
||||
GENERIC_WRITE|GENERIC_READ,
|
||||
0, NULL,
|
||||
CREATE_ALWAYS,
|
||||
FILE_ATTRIBUTE_NORMAL,
|
||||
NULL);
|
||||
else {
|
||||
if (notify)
|
||||
notify(FILE_OVERWRITTEN, filename);
|
||||
return NULL;
|
||||
}
|
||||
break;
|
||||
case ERROR_PATH_NOT_FOUND:
|
||||
if (ensure_directory(filename, pathname_part, notify))
|
||||
goto try_again;
|
||||
else
|
||||
return FALSE;
|
||||
break;
|
||||
default:
|
||||
SetLastError(x);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (hFile == INVALID_HANDLE_VALUE) {
|
||||
if (notify)
|
||||
notify (SYSTEM_ERROR, "CreateFile (%s)", filename);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (notify)
|
||||
notify(FILE_CREATED, filename);
|
||||
|
||||
DosDateTimeToFileTime(wFatDate, wFatTime, &ft);
|
||||
SetFileTime(hFile, &ft, &ft, &ft);
|
||||
|
||||
|
||||
if (size == 0) {
|
||||
/* We cannot map a zero-length file (Also it makes
|
||||
no sense */
|
||||
CloseHandle(hFile);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
hFileMapping = CreateFileMapping(hFile,
|
||||
NULL, PAGE_READWRITE, 0, size, NULL);
|
||||
|
||||
CloseHandle(hFile);
|
||||
|
||||
if (hFileMapping == NULL) {
|
||||
if (notify)
|
||||
notify(SYSTEM_ERROR,
|
||||
"CreateFileMapping (%s)", filename);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
dst = MapViewOfFile(hFileMapping,
|
||||
FILE_MAP_WRITE, 0, 0, 0);
|
||||
|
||||
CloseHandle(hFileMapping);
|
||||
|
||||
if (!dst) {
|
||||
if (notify)
|
||||
notify(SYSTEM_ERROR, "MapViewOfFile (%s)", filename);
|
||||
return NULL;
|
||||
}
|
||||
return dst;
|
||||
}
|
||||
|
||||
|
||||
BOOL
|
||||
extract_file(char *dst, char *src, int method, int comp_size,
|
||||
int uncomp_size, NOTIFYPROC notify)
|
||||
{
|
||||
z_stream zstream;
|
||||
int result;
|
||||
|
||||
if (method == Z_DEFLATED) {
|
||||
int x;
|
||||
memset(&zstream, 0, sizeof(zstream));
|
||||
zstream.next_in = src;
|
||||
zstream.avail_in = comp_size+1;
|
||||
zstream.next_out = dst;
|
||||
zstream.avail_out = uncomp_size;
|
||||
|
||||
/* Apparently an undocumented feature of zlib: Set windowsize
|
||||
to negative values to suppress the gzip header and be compatible with
|
||||
zip! */
|
||||
result = TRUE;
|
||||
if (Z_OK != (x = inflateInit2(&zstream, -15))) {
|
||||
if (notify)
|
||||
notify(ZLIB_ERROR,
|
||||
"inflateInit2 returns %d", x);
|
||||
result = FALSE;
|
||||
goto cleanup;
|
||||
}
|
||||
if (Z_STREAM_END != (x = inflate(&zstream, Z_FINISH))) {
|
||||
if (notify)
|
||||
notify(ZLIB_ERROR,
|
||||
"inflate returns %d", x);
|
||||
result = FALSE;
|
||||
}
|
||||
cleanup:
|
||||
if (Z_OK != (x = inflateEnd(&zstream))) {
|
||||
if (notify)
|
||||
notify (ZLIB_ERROR,
|
||||
"inflateEnd returns %d", x);
|
||||
result = FALSE;
|
||||
}
|
||||
} else if (method == 0) {
|
||||
memcpy(dst, src, uncomp_size);
|
||||
result = TRUE;
|
||||
} else
|
||||
result = FALSE;
|
||||
UnmapViewOfFile(dst);
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Open a zip-compatible archive and extract all files
|
||||
* into the specified directory (which is assumed to exist)
|
||||
*/
|
||||
BOOL
|
||||
unzip_archive(SCHEME *scheme, char *dirname, char *data, DWORD size,
|
||||
NOTIFYPROC notify)
|
||||
{
|
||||
int n;
|
||||
char pathname[MAX_PATH];
|
||||
char *new_part;
|
||||
|
||||
/* read the end of central directory record */
|
||||
struct eof_cdir *pe = (struct eof_cdir *)&data[size - sizeof
|
||||
(struct eof_cdir)];
|
||||
|
||||
int arc_start = size - sizeof (struct eof_cdir) - pe->nBytesCDir -
|
||||
pe->ofsCDir;
|
||||
|
||||
/* set position to start of central directory */
|
||||
int pos = arc_start + pe->ofsCDir;
|
||||
|
||||
/* make sure this is a zip file */
|
||||
if (pe->tag != 0x06054b50)
|
||||
return FALSE;
|
||||
|
||||
/* Loop through the central directory, reading all entries */
|
||||
for (n = 0; n < pe->nTotalCDir; ++n) {
|
||||
int i;
|
||||
char *fname;
|
||||
char *pcomp;
|
||||
char *dst;
|
||||
struct cdir *pcdir;
|
||||
struct fhdr *pfhdr;
|
||||
|
||||
pcdir = (struct cdir *)&data[pos];
|
||||
pfhdr = (struct fhdr *)&data[pcdir->ofs_local_header +
|
||||
arc_start];
|
||||
|
||||
if (pcdir->tag != 0x02014b50)
|
||||
return FALSE;
|
||||
if (pfhdr->tag != 0x04034b50)
|
||||
return FALSE;
|
||||
pos += sizeof(struct cdir);
|
||||
fname = (char *)&data[pos]; /* This is not null terminated! */
|
||||
pos += pcdir->fname_length + pcdir->extra_length +
|
||||
pcdir->comment_length;
|
||||
|
||||
pcomp = &data[pcdir->ofs_local_header
|
||||
+ sizeof(struct fhdr)
|
||||
+ arc_start
|
||||
+ pfhdr->fname_length
|
||||
+ pfhdr->extra_length];
|
||||
|
||||
/* dirname is the Python home directory (prefix) */
|
||||
strcpy(pathname, dirname);
|
||||
if (pathname[strlen(pathname)-1] != '\\')
|
||||
strcat(pathname, "\\");
|
||||
new_part = &pathname[lstrlen(pathname)];
|
||||
/* we must now match the first part of the pathname
|
||||
* in the archive to a component in the installation
|
||||
* scheme (PURELIB, PLATLIB, HEADERS, SCRIPTS, or DATA)
|
||||
* and replace this part by the one in the scheme to use
|
||||
*/
|
||||
for (i = 0; scheme[i].name; ++i) {
|
||||
if (0 == strnicmp(scheme[i].name, fname,
|
||||
strlen(scheme[i].name))) {
|
||||
char *rest;
|
||||
int len;
|
||||
|
||||
/* length of the replaced part */
|
||||
int namelen = strlen(scheme[i].name);
|
||||
|
||||
strcat(pathname, scheme[i].prefix);
|
||||
|
||||
rest = fname + namelen;
|
||||
len = pfhdr->fname_length - namelen;
|
||||
|
||||
if ((pathname[strlen(pathname)-1] != '\\')
|
||||
&& (pathname[strlen(pathname)-1] != '/'))
|
||||
strcat(pathname, "\\");
|
||||
/* Now that pathname ends with a separator,
|
||||
* we must make sure rest does not start with
|
||||
* an additional one.
|
||||
*/
|
||||
if ((rest[0] == '\\') || (rest[0] == '/')) {
|
||||
++rest;
|
||||
--len;
|
||||
}
|
||||
|
||||
strncat(pathname, rest, len);
|
||||
goto Done;
|
||||
}
|
||||
}
|
||||
/* no prefix to replace found, go unchanged */
|
||||
strncat(pathname, fname, pfhdr->fname_length);
|
||||
Done:
|
||||
normpath(pathname);
|
||||
if (pathname[strlen(pathname)-1] != '\\') {
|
||||
/*
|
||||
* The local file header (pfhdr) does not always
|
||||
* contain the compressed and uncompressed sizes of
|
||||
* the data depending on bit 3 of the flags field. So
|
||||
* it seems better to use the data from the central
|
||||
* directory (pcdir).
|
||||
*/
|
||||
dst = map_new_file(0, pathname, new_part,
|
||||
pcdir->uncomp_size,
|
||||
pcdir->last_mod_file_date,
|
||||
pcdir->last_mod_file_time, notify);
|
||||
if (dst) {
|
||||
if (!extract_file(dst, pcomp, pfhdr->method,
|
||||
pcdir->comp_size,
|
||||
pcdir->uncomp_size,
|
||||
notify))
|
||||
return FALSE;
|
||||
} /* else ??? */
|
||||
}
|
||||
if (notify)
|
||||
notify(NUM_FILES, new_part, (int)pe->nTotalCDir,
|
||||
(int)n+1);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
2700
third_party/python/PC/bdist_wininst/install.c
vendored
Normal file
77
third_party/python/PC/bdist_wininst/install.rc
vendored
Normal file
|
@ -0,0 +1,77 @@
|
|||
/*
|
||||
IMPORTANT NOTE: IF THIS FILE IS CHANGED, PCBUILD\BDIST_WININST.VCXPROJ MUST
|
||||
BE REBUILT AS WELL.
|
||||
|
||||
IF CHANGES TO THIS FILE ARE CHECKED IN, THE RECOMPILED BINARIES MUST BE
|
||||
CHECKED IN AS WELL!
|
||||
*/
|
||||
|
||||
#include <winres.h>
|
||||
#include "resource.h"
|
||||
|
||||
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
||||
#pragma code_page(1252)
|
||||
|
||||
IDB_BITMAP BITMAP DISCARDABLE "PythonPowered.bmp"
|
||||
|
||||
|
||||
IDD_INTRO DIALOGEX 0, 0, 379, 178
|
||||
STYLE WS_CHILD | WS_DISABLED | WS_CAPTION
|
||||
CAPTION "Setup"
|
||||
FONT 8, "MS Sans Serif", 0, 0, 0x1
|
||||
BEGIN
|
||||
LTEXT "This Wizard will install %s on your computer. Click Next to continue or Cancel to exit the Setup Wizard.",
|
||||
IDC_TITLE,125,10,247,20,NOT WS_GROUP
|
||||
EDITTEXT IDC_INTRO_TEXT,125,31,247,131,ES_MULTILINE | ES_READONLY |
|
||||
WS_VSCROLL | WS_HSCROLL | NOT WS_TABSTOP
|
||||
CONTROL 110,IDC_BITMAP,"Static",SS_BITMAP | SS_CENTERIMAGE,6,8,
|
||||
104,163,WS_EX_CLIENTEDGE
|
||||
LTEXT "",IDC_BUILD_INFO,125,163,247,8
|
||||
END
|
||||
|
||||
IDD_SELECTPYTHON DIALOGEX 0, 0, 379, 178
|
||||
STYLE WS_CHILD | WS_DISABLED | WS_CAPTION
|
||||
CAPTION "Setup"
|
||||
FONT 8, "MS Sans Serif", 0, 0, 0x1
|
||||
BEGIN
|
||||
LTEXT "Select python installation to use:",IDC_TITLE,125,10,
|
||||
247,12,NOT WS_GROUP
|
||||
EDITTEXT IDC_PATH,191,136,181,14,ES_AUTOHSCROLL | ES_READONLY
|
||||
LTEXT "Python Directory:",IDC_STATIC,125,137,55,8
|
||||
LISTBOX IDC_VERSIONS_LIST,125,24,247,106,LBS_SORT |
|
||||
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
|
||||
CONTROL 110,IDC_BITMAP,"Static",SS_BITMAP | SS_CENTERIMAGE,6,8,
|
||||
104,163,WS_EX_CLIENTEDGE
|
||||
EDITTEXT IDC_INSTALL_PATH,191,157,181,14,ES_AUTOHSCROLL |
|
||||
ES_READONLY
|
||||
LTEXT "Installation Directory:",IDC_STATIC,125,158,66,8
|
||||
PUSHBUTTON "Find other ...",IDC_OTHERPYTHON,322,7,50,14,NOT
|
||||
WS_VISIBLE
|
||||
END
|
||||
|
||||
IDD_INSTALLFILES DIALOGEX 0, 0, 379, 178
|
||||
STYLE WS_CHILD | WS_DISABLED | WS_CAPTION
|
||||
CAPTION "Setup"
|
||||
FONT 8, "MS Sans Serif", 0, 0, 0x1
|
||||
BEGIN
|
||||
LTEXT "Click Next to begin the installation. If you want to review or change any of your installation settings, click Back. Click Cancel to exit the Wizard.",
|
||||
IDC_TITLE,125,10,246,31,NOT WS_GROUP
|
||||
CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER,
|
||||
125,157,246,14
|
||||
CTEXT "Installation progress:",IDC_INFO,125,137,246,8
|
||||
CONTROL 110,IDC_BITMAP,"Static",SS_BITMAP | SS_CENTERIMAGE,6,8,
|
||||
104,163,WS_EX_CLIENTEDGE
|
||||
END
|
||||
|
||||
IDD_FINISHED DIALOGEX 0, 0, 379, 178
|
||||
STYLE WS_CHILD | WS_DISABLED | WS_CAPTION
|
||||
CAPTION "Setup"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "Click the Finish button to exit the Setup wizard.",
|
||||
IDC_TITLE,125,10,247,31,NOT WS_GROUP
|
||||
CONTROL 110,IDC_BITMAP,"Static",SS_BITMAP | SS_CENTERIMAGE,6,8,
|
||||
104,163,WS_EX_CLIENTEDGE
|
||||
EDITTEXT IDC_INFO,125,40,247,131,ES_MULTILINE | ES_READONLY |
|
||||
WS_VSCROLL | WS_HSCROLL | NOT WS_TABSTOP
|
||||
END
|
31
third_party/python/PC/bdist_wininst/resource.h
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
IMPORTANT NOTE: IF THIS FILE IS CHANGED, PCBUILD\BDIST_WININST.VCXPROJ MUST
|
||||
BE REBUILT AS WELL.
|
||||
|
||||
IF CHANGES TO THIS FILE ARE CHECKED IN, THE RECOMPILED BINARIES MUST BE
|
||||
CHECKED IN AS WELL!
|
||||
*/
|
||||
|
||||
#define IDD_DIALOG1 101
|
||||
#define IDB_BITMAP1 103
|
||||
#define IDD_INTRO 107
|
||||
#define IDD_SELECTPYTHON 108
|
||||
#define IDD_INSTALLFILES 109
|
||||
#define IDD_FINISHED 110
|
||||
#define IDB_BITMAP 110
|
||||
#define IDC_EDIT1 1000
|
||||
#define IDC_TITLE 1000
|
||||
#define IDC_START 1001
|
||||
#define IDC_PROGRESS 1003
|
||||
#define IDC_INFO 1004
|
||||
#define IDC_PYTHON15 1006
|
||||
#define IDC_PATH 1007
|
||||
#define IDC_PYTHON16 1008
|
||||
#define IDC_INSTALL_PATH 1008
|
||||
#define IDC_PYTHON20 1009
|
||||
#define IDC_BROWSE 1010
|
||||
#define IDC_INTRO_TEXT 1021
|
||||
#define IDC_VERSIONS_LIST 1022
|
||||
#define IDC_BUILD_INFO 1024
|
||||
#define IDC_BITMAP 1025
|
||||
#define IDC_OTHERPYTHON 1026
|
82
third_party/python/PC/clinic/_testconsole.c.h
generated
vendored
Normal file
|
@ -0,0 +1,82 @@
|
|||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
#if defined(MS_WINDOWS)
|
||||
|
||||
PyDoc_STRVAR(_testconsole_write_input__doc__,
|
||||
"write_input($module, /, file, s)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Writes UTF-16-LE encoded bytes to the console as if typed by a user.");
|
||||
|
||||
#define _TESTCONSOLE_WRITE_INPUT_METHODDEF \
|
||||
{"write_input", (PyCFunction)_testconsole_write_input, METH_FASTCALL, _testconsole_write_input__doc__},
|
||||
|
||||
static PyObject *
|
||||
_testconsole_write_input_impl(PyObject *module, PyObject *file,
|
||||
PyBytesObject *s);
|
||||
|
||||
static PyObject *
|
||||
_testconsole_write_input(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"file", "s", NULL};
|
||||
static _PyArg_Parser _parser = {"OS:write_input", _keywords, 0};
|
||||
PyObject *file;
|
||||
PyBytesObject *s;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&file, &s)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _testconsole_write_input_impl(module, file, s);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
#endif /* defined(MS_WINDOWS) */
|
||||
|
||||
#if defined(MS_WINDOWS)
|
||||
|
||||
PyDoc_STRVAR(_testconsole_read_output__doc__,
|
||||
"read_output($module, /, file)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Reads a str from the console as written to stdout.");
|
||||
|
||||
#define _TESTCONSOLE_READ_OUTPUT_METHODDEF \
|
||||
{"read_output", (PyCFunction)_testconsole_read_output, METH_FASTCALL, _testconsole_read_output__doc__},
|
||||
|
||||
static PyObject *
|
||||
_testconsole_read_output_impl(PyObject *module, PyObject *file);
|
||||
|
||||
static PyObject *
|
||||
_testconsole_read_output(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"file", NULL};
|
||||
static _PyArg_Parser _parser = {"O:read_output", _keywords, 0};
|
||||
PyObject *file;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&file)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _testconsole_read_output_impl(module, file);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
#endif /* defined(MS_WINDOWS) */
|
||||
|
||||
#ifndef _TESTCONSOLE_WRITE_INPUT_METHODDEF
|
||||
#define _TESTCONSOLE_WRITE_INPUT_METHODDEF
|
||||
#endif /* !defined(_TESTCONSOLE_WRITE_INPUT_METHODDEF) */
|
||||
|
||||
#ifndef _TESTCONSOLE_READ_OUTPUT_METHODDEF
|
||||
#define _TESTCONSOLE_READ_OUTPUT_METHODDEF
|
||||
#endif /* !defined(_TESTCONSOLE_READ_OUTPUT_METHODDEF) */
|
||||
/*[clinic end generated code: output=3a8dc0c421807c41 input=a9049054013a1b77]*/
|
572
third_party/python/PC/clinic/msvcrtmodule.c.h
generated
vendored
Normal file
|
@ -0,0 +1,572 @@
|
|||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
PyDoc_STRVAR(msvcrt_heapmin__doc__,
|
||||
"heapmin($module, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Minimize the malloc() heap.\n"
|
||||
"\n"
|
||||
"Force the malloc() heap to clean itself up and return unused blocks\n"
|
||||
"to the operating system. On failure, this raises OSError.");
|
||||
|
||||
#define MSVCRT_HEAPMIN_METHODDEF \
|
||||
{"heapmin", (PyCFunction)msvcrt_heapmin, METH_NOARGS, msvcrt_heapmin__doc__},
|
||||
|
||||
static PyObject *
|
||||
msvcrt_heapmin_impl(PyObject *module);
|
||||
|
||||
static PyObject *
|
||||
msvcrt_heapmin(PyObject *module, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return msvcrt_heapmin_impl(module);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(msvcrt_locking__doc__,
|
||||
"locking($module, fd, mode, nbytes, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Lock part of a file based on file descriptor fd from the C runtime.\n"
|
||||
"\n"
|
||||
"Raises IOError on failure. The locked region of the file extends from\n"
|
||||
"the current file position for nbytes bytes, and may continue beyond\n"
|
||||
"the end of the file. mode must be one of the LK_* constants listed\n"
|
||||
"below. Multiple regions in a file may be locked at the same time, but\n"
|
||||
"may not overlap. Adjacent regions are not merged; they must be unlocked\n"
|
||||
"individually.");
|
||||
|
||||
#define MSVCRT_LOCKING_METHODDEF \
|
||||
{"locking", (PyCFunction)msvcrt_locking, METH_VARARGS, msvcrt_locking__doc__},
|
||||
|
||||
static PyObject *
|
||||
msvcrt_locking_impl(PyObject *module, int fd, int mode, long nbytes);
|
||||
|
||||
static PyObject *
|
||||
msvcrt_locking(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int fd;
|
||||
int mode;
|
||||
long nbytes;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "iil:locking",
|
||||
&fd, &mode, &nbytes)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = msvcrt_locking_impl(module, fd, mode, nbytes);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(msvcrt_setmode__doc__,
|
||||
"setmode($module, fd, mode, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Set the line-end translation mode for the file descriptor fd.\n"
|
||||
"\n"
|
||||
"To set it to text mode, flags should be os.O_TEXT; for binary, it\n"
|
||||
"should be os.O_BINARY.\n"
|
||||
"\n"
|
||||
"Return value is the previous mode.");
|
||||
|
||||
#define MSVCRT_SETMODE_METHODDEF \
|
||||
{"setmode", (PyCFunction)msvcrt_setmode, METH_VARARGS, msvcrt_setmode__doc__},
|
||||
|
||||
static long
|
||||
msvcrt_setmode_impl(PyObject *module, int fd, int flags);
|
||||
|
||||
static PyObject *
|
||||
msvcrt_setmode(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int fd;
|
||||
int flags;
|
||||
long _return_value;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "ii:setmode",
|
||||
&fd, &flags)) {
|
||||
goto exit;
|
||||
}
|
||||
_return_value = msvcrt_setmode_impl(module, fd, flags);
|
||||
if ((_return_value == -1) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = PyLong_FromLong(_return_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(msvcrt_open_osfhandle__doc__,
|
||||
"open_osfhandle($module, handle, flags, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Create a C runtime file descriptor from the file handle handle.\n"
|
||||
"\n"
|
||||
"The flags parameter should be a bitwise OR of os.O_APPEND, os.O_RDONLY,\n"
|
||||
"and os.O_TEXT. The returned file descriptor may be used as a parameter\n"
|
||||
"to os.fdopen() to create a file object.");
|
||||
|
||||
#define MSVCRT_OPEN_OSFHANDLE_METHODDEF \
|
||||
{"open_osfhandle", (PyCFunction)msvcrt_open_osfhandle, METH_VARARGS, msvcrt_open_osfhandle__doc__},
|
||||
|
||||
static long
|
||||
msvcrt_open_osfhandle_impl(PyObject *module, intptr_t handle, int flags);
|
||||
|
||||
static PyObject *
|
||||
msvcrt_open_osfhandle(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
intptr_t handle;
|
||||
int flags;
|
||||
long _return_value;
|
||||
|
||||
if (!PyArg_ParseTuple(args, ""_Py_PARSE_INTPTR"i:open_osfhandle",
|
||||
&handle, &flags)) {
|
||||
goto exit;
|
||||
}
|
||||
_return_value = msvcrt_open_osfhandle_impl(module, handle, flags);
|
||||
if ((_return_value == -1) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = PyLong_FromLong(_return_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(msvcrt_get_osfhandle__doc__,
|
||||
"get_osfhandle($module, fd, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the file handle for the file descriptor fd.\n"
|
||||
"\n"
|
||||
"Raises IOError if fd is not recognized.");
|
||||
|
||||
#define MSVCRT_GET_OSFHANDLE_METHODDEF \
|
||||
{"get_osfhandle", (PyCFunction)msvcrt_get_osfhandle, METH_O, msvcrt_get_osfhandle__doc__},
|
||||
|
||||
static intptr_t
|
||||
msvcrt_get_osfhandle_impl(PyObject *module, int fd);
|
||||
|
||||
static PyObject *
|
||||
msvcrt_get_osfhandle(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int fd;
|
||||
intptr_t _return_value;
|
||||
|
||||
if (!PyArg_Parse(arg, "i:get_osfhandle", &fd)) {
|
||||
goto exit;
|
||||
}
|
||||
_return_value = msvcrt_get_osfhandle_impl(module, fd);
|
||||
if ((_return_value == -1) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = PyLong_FromVoidPtr((void *)_return_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(msvcrt_kbhit__doc__,
|
||||
"kbhit($module, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return true if a keypress is waiting to be read.");
|
||||
|
||||
#define MSVCRT_KBHIT_METHODDEF \
|
||||
{"kbhit", (PyCFunction)msvcrt_kbhit, METH_NOARGS, msvcrt_kbhit__doc__},
|
||||
|
||||
static long
|
||||
msvcrt_kbhit_impl(PyObject *module);
|
||||
|
||||
static PyObject *
|
||||
msvcrt_kbhit(PyObject *module, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
long _return_value;
|
||||
|
||||
_return_value = msvcrt_kbhit_impl(module);
|
||||
if ((_return_value == -1) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = PyLong_FromLong(_return_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(msvcrt_getch__doc__,
|
||||
"getch($module, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Read a keypress and return the resulting character as a byte string.\n"
|
||||
"\n"
|
||||
"Nothing is echoed to the console. This call will block if a keypress is\n"
|
||||
"not already available, but will not wait for Enter to be pressed. If the\n"
|
||||
"pressed key was a special function key, this will return \'\\000\' or\n"
|
||||
"\'\\xe0\'; the next call will return the keycode. The Control-C keypress\n"
|
||||
"cannot be read with this function.");
|
||||
|
||||
#define MSVCRT_GETCH_METHODDEF \
|
||||
{"getch", (PyCFunction)msvcrt_getch, METH_NOARGS, msvcrt_getch__doc__},
|
||||
|
||||
static int
|
||||
msvcrt_getch_impl(PyObject *module);
|
||||
|
||||
static PyObject *
|
||||
msvcrt_getch(PyObject *module, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
char s[1];
|
||||
|
||||
s[0] = msvcrt_getch_impl(module);
|
||||
return_value = PyBytes_FromStringAndSize(s, 1);
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(msvcrt_getwch__doc__,
|
||||
"getwch($module, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Wide char variant of getch(), returning a Unicode value.");
|
||||
|
||||
#define MSVCRT_GETWCH_METHODDEF \
|
||||
{"getwch", (PyCFunction)msvcrt_getwch, METH_NOARGS, msvcrt_getwch__doc__},
|
||||
|
||||
static wchar_t
|
||||
msvcrt_getwch_impl(PyObject *module);
|
||||
|
||||
static PyObject *
|
||||
msvcrt_getwch(PyObject *module, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
wchar_t _return_value;
|
||||
|
||||
_return_value = msvcrt_getwch_impl(module);
|
||||
return_value = PyUnicode_FromOrdinal(_return_value);
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(msvcrt_getche__doc__,
|
||||
"getche($module, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Similar to getch(), but the keypress will be echoed if possible.");
|
||||
|
||||
#define MSVCRT_GETCHE_METHODDEF \
|
||||
{"getche", (PyCFunction)msvcrt_getche, METH_NOARGS, msvcrt_getche__doc__},
|
||||
|
||||
static int
|
||||
msvcrt_getche_impl(PyObject *module);
|
||||
|
||||
static PyObject *
|
||||
msvcrt_getche(PyObject *module, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
char s[1];
|
||||
|
||||
s[0] = msvcrt_getche_impl(module);
|
||||
return_value = PyBytes_FromStringAndSize(s, 1);
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(msvcrt_getwche__doc__,
|
||||
"getwche($module, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Wide char variant of getche(), returning a Unicode value.");
|
||||
|
||||
#define MSVCRT_GETWCHE_METHODDEF \
|
||||
{"getwche", (PyCFunction)msvcrt_getwche, METH_NOARGS, msvcrt_getwche__doc__},
|
||||
|
||||
static wchar_t
|
||||
msvcrt_getwche_impl(PyObject *module);
|
||||
|
||||
static PyObject *
|
||||
msvcrt_getwche(PyObject *module, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
wchar_t _return_value;
|
||||
|
||||
_return_value = msvcrt_getwche_impl(module);
|
||||
return_value = PyUnicode_FromOrdinal(_return_value);
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(msvcrt_putch__doc__,
|
||||
"putch($module, char, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Print the byte string char to the console without buffering.");
|
||||
|
||||
#define MSVCRT_PUTCH_METHODDEF \
|
||||
{"putch", (PyCFunction)msvcrt_putch, METH_O, msvcrt_putch__doc__},
|
||||
|
||||
static PyObject *
|
||||
msvcrt_putch_impl(PyObject *module, char char_value);
|
||||
|
||||
static PyObject *
|
||||
msvcrt_putch(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
char char_value;
|
||||
|
||||
if (!PyArg_Parse(arg, "c:putch", &char_value)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = msvcrt_putch_impl(module, char_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(msvcrt_putwch__doc__,
|
||||
"putwch($module, unicode_char, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Wide char variant of putch(), accepting a Unicode value.");
|
||||
|
||||
#define MSVCRT_PUTWCH_METHODDEF \
|
||||
{"putwch", (PyCFunction)msvcrt_putwch, METH_O, msvcrt_putwch__doc__},
|
||||
|
||||
static PyObject *
|
||||
msvcrt_putwch_impl(PyObject *module, int unicode_char);
|
||||
|
||||
static PyObject *
|
||||
msvcrt_putwch(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int unicode_char;
|
||||
|
||||
if (!PyArg_Parse(arg, "C:putwch", &unicode_char)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = msvcrt_putwch_impl(module, unicode_char);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(msvcrt_ungetch__doc__,
|
||||
"ungetch($module, char, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Opposite of getch.\n"
|
||||
"\n"
|
||||
"Cause the byte string char to be \"pushed back\" into the\n"
|
||||
"console buffer; it will be the next character read by\n"
|
||||
"getch() or getche().");
|
||||
|
||||
#define MSVCRT_UNGETCH_METHODDEF \
|
||||
{"ungetch", (PyCFunction)msvcrt_ungetch, METH_O, msvcrt_ungetch__doc__},
|
||||
|
||||
static PyObject *
|
||||
msvcrt_ungetch_impl(PyObject *module, char char_value);
|
||||
|
||||
static PyObject *
|
||||
msvcrt_ungetch(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
char char_value;
|
||||
|
||||
if (!PyArg_Parse(arg, "c:ungetch", &char_value)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = msvcrt_ungetch_impl(module, char_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(msvcrt_ungetwch__doc__,
|
||||
"ungetwch($module, unicode_char, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Wide char variant of ungetch(), accepting a Unicode value.");
|
||||
|
||||
#define MSVCRT_UNGETWCH_METHODDEF \
|
||||
{"ungetwch", (PyCFunction)msvcrt_ungetwch, METH_O, msvcrt_ungetwch__doc__},
|
||||
|
||||
static PyObject *
|
||||
msvcrt_ungetwch_impl(PyObject *module, int unicode_char);
|
||||
|
||||
static PyObject *
|
||||
msvcrt_ungetwch(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int unicode_char;
|
||||
|
||||
if (!PyArg_Parse(arg, "C:ungetwch", &unicode_char)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = msvcrt_ungetwch_impl(module, unicode_char);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
#if defined(_DEBUG)
|
||||
|
||||
PyDoc_STRVAR(msvcrt_CrtSetReportFile__doc__,
|
||||
"CrtSetReportFile($module, type, file, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Wrapper around _CrtSetReportFile.\n"
|
||||
"\n"
|
||||
"Only available on Debug builds.");
|
||||
|
||||
#define MSVCRT_CRTSETREPORTFILE_METHODDEF \
|
||||
{"CrtSetReportFile", (PyCFunction)msvcrt_CrtSetReportFile, METH_VARARGS, msvcrt_CrtSetReportFile__doc__},
|
||||
|
||||
static long
|
||||
msvcrt_CrtSetReportFile_impl(PyObject *module, int type, int file);
|
||||
|
||||
static PyObject *
|
||||
msvcrt_CrtSetReportFile(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int type;
|
||||
int file;
|
||||
long _return_value;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "ii:CrtSetReportFile",
|
||||
&type, &file)) {
|
||||
goto exit;
|
||||
}
|
||||
_return_value = msvcrt_CrtSetReportFile_impl(module, type, file);
|
||||
if ((_return_value == -1) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = PyLong_FromLong(_return_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
#endif /* defined(_DEBUG) */
|
||||
|
||||
#if defined(_DEBUG)
|
||||
|
||||
PyDoc_STRVAR(msvcrt_CrtSetReportMode__doc__,
|
||||
"CrtSetReportMode($module, type, mode, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Wrapper around _CrtSetReportMode.\n"
|
||||
"\n"
|
||||
"Only available on Debug builds.");
|
||||
|
||||
#define MSVCRT_CRTSETREPORTMODE_METHODDEF \
|
||||
{"CrtSetReportMode", (PyCFunction)msvcrt_CrtSetReportMode, METH_VARARGS, msvcrt_CrtSetReportMode__doc__},
|
||||
|
||||
static long
|
||||
msvcrt_CrtSetReportMode_impl(PyObject *module, int type, int mode);
|
||||
|
||||
static PyObject *
|
||||
msvcrt_CrtSetReportMode(PyObject *module, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int type;
|
||||
int mode;
|
||||
long _return_value;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "ii:CrtSetReportMode",
|
||||
&type, &mode)) {
|
||||
goto exit;
|
||||
}
|
||||
_return_value = msvcrt_CrtSetReportMode_impl(module, type, mode);
|
||||
if ((_return_value == -1) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = PyLong_FromLong(_return_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
#endif /* defined(_DEBUG) */
|
||||
|
||||
#if defined(_DEBUG)
|
||||
|
||||
PyDoc_STRVAR(msvcrt_set_error_mode__doc__,
|
||||
"set_error_mode($module, mode, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Wrapper around _set_error_mode.\n"
|
||||
"\n"
|
||||
"Only available on Debug builds.");
|
||||
|
||||
#define MSVCRT_SET_ERROR_MODE_METHODDEF \
|
||||
{"set_error_mode", (PyCFunction)msvcrt_set_error_mode, METH_O, msvcrt_set_error_mode__doc__},
|
||||
|
||||
static long
|
||||
msvcrt_set_error_mode_impl(PyObject *module, int mode);
|
||||
|
||||
static PyObject *
|
||||
msvcrt_set_error_mode(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int mode;
|
||||
long _return_value;
|
||||
|
||||
if (!PyArg_Parse(arg, "i:set_error_mode", &mode)) {
|
||||
goto exit;
|
||||
}
|
||||
_return_value = msvcrt_set_error_mode_impl(module, mode);
|
||||
if ((_return_value == -1) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = PyLong_FromLong(_return_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
#endif /* defined(_DEBUG) */
|
||||
|
||||
PyDoc_STRVAR(msvcrt_SetErrorMode__doc__,
|
||||
"SetErrorMode($module, mode, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Wrapper around SetErrorMode.");
|
||||
|
||||
#define MSVCRT_SETERRORMODE_METHODDEF \
|
||||
{"SetErrorMode", (PyCFunction)msvcrt_SetErrorMode, METH_O, msvcrt_SetErrorMode__doc__},
|
||||
|
||||
static PyObject *
|
||||
msvcrt_SetErrorMode_impl(PyObject *module, unsigned int mode);
|
||||
|
||||
static PyObject *
|
||||
msvcrt_SetErrorMode(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
unsigned int mode;
|
||||
|
||||
if (!PyArg_Parse(arg, "I:SetErrorMode", &mode)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = msvcrt_SetErrorMode_impl(module, mode);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
#ifndef MSVCRT_CRTSETREPORTFILE_METHODDEF
|
||||
#define MSVCRT_CRTSETREPORTFILE_METHODDEF
|
||||
#endif /* !defined(MSVCRT_CRTSETREPORTFILE_METHODDEF) */
|
||||
|
||||
#ifndef MSVCRT_CRTSETREPORTMODE_METHODDEF
|
||||
#define MSVCRT_CRTSETREPORTMODE_METHODDEF
|
||||
#endif /* !defined(MSVCRT_CRTSETREPORTMODE_METHODDEF) */
|
||||
|
||||
#ifndef MSVCRT_SET_ERROR_MODE_METHODDEF
|
||||
#define MSVCRT_SET_ERROR_MODE_METHODDEF
|
||||
#endif /* !defined(MSVCRT_SET_ERROR_MODE_METHODDEF) */
|
||||
/*[clinic end generated code: output=ae04e2b50eef8b63 input=a9049054013a1b77]*/
|
1094
third_party/python/PC/clinic/winreg.c.h
generated
vendored
Normal file
109
third_party/python/PC/clinic/winsound.c.h
generated
vendored
Normal file
|
@ -0,0 +1,109 @@
|
|||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
PyDoc_STRVAR(winsound_PlaySound__doc__,
|
||||
"PlaySound($module, /, sound, flags)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"A wrapper around the Windows PlaySound API.\n"
|
||||
"\n"
|
||||
" sound\n"
|
||||
" The sound to play; a filename, data, or None.\n"
|
||||
" flags\n"
|
||||
" Flag values, ored together. See module documentation.");
|
||||
|
||||
#define WINSOUND_PLAYSOUND_METHODDEF \
|
||||
{"PlaySound", (PyCFunction)winsound_PlaySound, METH_FASTCALL, winsound_PlaySound__doc__},
|
||||
|
||||
static PyObject *
|
||||
winsound_PlaySound_impl(PyObject *module, PyObject *sound, int flags);
|
||||
|
||||
static PyObject *
|
||||
winsound_PlaySound(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"sound", "flags", NULL};
|
||||
static _PyArg_Parser _parser = {"Oi:PlaySound", _keywords, 0};
|
||||
PyObject *sound;
|
||||
int flags;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&sound, &flags)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = winsound_PlaySound_impl(module, sound, flags);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(winsound_Beep__doc__,
|
||||
"Beep($module, /, frequency, duration)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"A wrapper around the Windows Beep API.\n"
|
||||
"\n"
|
||||
" frequency\n"
|
||||
" Frequency of the sound in hertz.\n"
|
||||
" Must be in the range 37 through 32,767.\n"
|
||||
" duration\n"
|
||||
" How long the sound should play, in milliseconds.");
|
||||
|
||||
#define WINSOUND_BEEP_METHODDEF \
|
||||
{"Beep", (PyCFunction)winsound_Beep, METH_FASTCALL, winsound_Beep__doc__},
|
||||
|
||||
static PyObject *
|
||||
winsound_Beep_impl(PyObject *module, int frequency, int duration);
|
||||
|
||||
static PyObject *
|
||||
winsound_Beep(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"frequency", "duration", NULL};
|
||||
static _PyArg_Parser _parser = {"ii:Beep", _keywords, 0};
|
||||
int frequency;
|
||||
int duration;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&frequency, &duration)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = winsound_Beep_impl(module, frequency, duration);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(winsound_MessageBeep__doc__,
|
||||
"MessageBeep($module, /, type=MB_OK)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Call Windows MessageBeep(x).\n"
|
||||
"\n"
|
||||
"x defaults to MB_OK.");
|
||||
|
||||
#define WINSOUND_MESSAGEBEEP_METHODDEF \
|
||||
{"MessageBeep", (PyCFunction)winsound_MessageBeep, METH_FASTCALL, winsound_MessageBeep__doc__},
|
||||
|
||||
static PyObject *
|
||||
winsound_MessageBeep_impl(PyObject *module, int type);
|
||||
|
||||
static PyObject *
|
||||
winsound_MessageBeep(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static const char * const _keywords[] = {"type", NULL};
|
||||
static _PyArg_Parser _parser = {"|i:MessageBeep", _keywords, 0};
|
||||
int type = MB_OK;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
|
||||
&type)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = winsound_MessageBeep_impl(module, type);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=bfe16b2b8b490cb1 input=a9049054013a1b77]*/
|
170
third_party/python/PC/config.c
vendored
Normal file
|
@ -0,0 +1,170 @@
|
|||
/* Module configuration */
|
||||
|
||||
/* This file contains the table of built-in modules.
|
||||
See create_builtin() in import.c. */
|
||||
|
||||
#include "Python.h"
|
||||
|
||||
extern PyObject* PyInit_array(void);
|
||||
#ifndef MS_WINI64
|
||||
extern PyObject* PyInit_audioop(void);
|
||||
#endif
|
||||
extern PyObject* PyInit_binascii(void);
|
||||
extern PyObject* PyInit_cmath(void);
|
||||
extern PyObject* PyInit_errno(void);
|
||||
extern PyObject* PyInit_faulthandler(void);
|
||||
extern PyObject* PyInit__tracemalloc(void);
|
||||
extern PyObject* PyInit_gc(void);
|
||||
extern PyObject* PyInit_math(void);
|
||||
extern PyObject* PyInit__md5(void);
|
||||
extern PyObject* PyInit_nt(void);
|
||||
extern PyObject* PyInit__operator(void);
|
||||
extern PyObject* PyInit__signal(void);
|
||||
extern PyObject* PyInit__sha1(void);
|
||||
extern PyObject* PyInit__sha256(void);
|
||||
extern PyObject* PyInit__sha512(void);
|
||||
extern PyObject* PyInit__sha3(void);
|
||||
extern PyObject* PyInit__blake2(void);
|
||||
extern PyObject* PyInit_time(void);
|
||||
extern PyObject* PyInit__thread(void);
|
||||
#ifdef WIN32
|
||||
extern PyObject* PyInit_msvcrt(void);
|
||||
extern PyObject* PyInit__locale(void);
|
||||
#endif
|
||||
extern PyObject* PyInit__codecs(void);
|
||||
extern PyObject* PyInit__weakref(void);
|
||||
extern PyObject* PyInit_xxsubtype(void);
|
||||
extern PyObject* PyInit_zipimport(void);
|
||||
extern PyObject* PyInit__random(void);
|
||||
extern PyObject* PyInit_itertools(void);
|
||||
extern PyObject* PyInit__collections(void);
|
||||
extern PyObject* PyInit__heapq(void);
|
||||
extern PyObject* PyInit__bisect(void);
|
||||
extern PyObject* PyInit__symtable(void);
|
||||
extern PyObject* PyInit_mmap(void);
|
||||
extern PyObject* PyInit__csv(void);
|
||||
extern PyObject* PyInit__sre(void);
|
||||
extern PyObject* PyInit_parser(void);
|
||||
extern PyObject* PyInit_winreg(void);
|
||||
extern PyObject* PyInit__struct(void);
|
||||
extern PyObject* PyInit__datetime(void);
|
||||
extern PyObject* PyInit__functools(void);
|
||||
extern PyObject* PyInit__json(void);
|
||||
extern PyObject* PyInit_zlib(void);
|
||||
|
||||
extern PyObject* PyInit__multibytecodec(void);
|
||||
extern PyObject* PyInit__codecs_cn(void);
|
||||
extern PyObject* PyInit__codecs_hk(void);
|
||||
extern PyObject* PyInit__codecs_iso2022(void);
|
||||
extern PyObject* PyInit__codecs_jp(void);
|
||||
extern PyObject* PyInit__codecs_kr(void);
|
||||
extern PyObject* PyInit__codecs_tw(void);
|
||||
extern PyObject* PyInit__winapi(void);
|
||||
extern PyObject* PyInit__lsprof(void);
|
||||
extern PyObject* PyInit__ast(void);
|
||||
extern PyObject* PyInit__io(void);
|
||||
extern PyObject* PyInit__pickle(void);
|
||||
extern PyObject* PyInit_atexit(void);
|
||||
extern PyObject* _PyWarnings_Init(void);
|
||||
extern PyObject* PyInit__string(void);
|
||||
extern PyObject* PyInit__stat(void);
|
||||
extern PyObject* PyInit__opcode(void);
|
||||
|
||||
/* tools/freeze/makeconfig.py marker for additional "extern" */
|
||||
/* -- ADDMODULE MARKER 1 -- */
|
||||
|
||||
extern PyObject* PyMarshal_Init(void);
|
||||
extern PyObject* PyInit_imp(void);
|
||||
|
||||
struct _inittab _PyImport_Inittab[] = {
|
||||
|
||||
{"array", PyInit_array},
|
||||
{"_ast", PyInit__ast},
|
||||
#ifdef MS_WINDOWS
|
||||
#ifndef MS_WINI64
|
||||
{"audioop", PyInit_audioop},
|
||||
#endif
|
||||
#endif
|
||||
{"binascii", PyInit_binascii},
|
||||
{"cmath", PyInit_cmath},
|
||||
{"errno", PyInit_errno},
|
||||
{"faulthandler", PyInit_faulthandler},
|
||||
{"gc", PyInit_gc},
|
||||
{"math", PyInit_math},
|
||||
{"nt", PyInit_nt}, /* Use the NT os functions, not posix */
|
||||
{"_operator", PyInit__operator},
|
||||
{"_signal", PyInit__signal},
|
||||
{"_md5", PyInit__md5},
|
||||
{"_sha1", PyInit__sha1},
|
||||
{"_sha256", PyInit__sha256},
|
||||
{"_sha512", PyInit__sha512},
|
||||
{"_sha3", PyInit__sha3},
|
||||
{"_blake2", PyInit__blake2},
|
||||
{"time", PyInit_time},
|
||||
#ifdef WITH_THREAD
|
||||
{"_thread", PyInit__thread},
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
{"msvcrt", PyInit_msvcrt},
|
||||
{"_locale", PyInit__locale},
|
||||
#endif
|
||||
{"_tracemalloc", PyInit__tracemalloc},
|
||||
/* XXX Should _winapi go in a WIN32 block? not WIN64? */
|
||||
{"_winapi", PyInit__winapi},
|
||||
|
||||
{"_codecs", PyInit__codecs},
|
||||
{"_weakref", PyInit__weakref},
|
||||
{"_random", PyInit__random},
|
||||
{"_bisect", PyInit__bisect},
|
||||
{"_heapq", PyInit__heapq},
|
||||
{"_lsprof", PyInit__lsprof},
|
||||
{"itertools", PyInit_itertools},
|
||||
{"_collections", PyInit__collections},
|
||||
{"_symtable", PyInit__symtable},
|
||||
{"mmap", PyInit_mmap},
|
||||
{"_csv", PyInit__csv},
|
||||
{"_sre", PyInit__sre},
|
||||
{"parser", PyInit_parser},
|
||||
{"winreg", PyInit_winreg},
|
||||
{"_struct", PyInit__struct},
|
||||
{"_datetime", PyInit__datetime},
|
||||
{"_functools", PyInit__functools},
|
||||
{"_json", PyInit__json},
|
||||
|
||||
{"xxsubtype", PyInit_xxsubtype},
|
||||
{"zipimport", PyInit_zipimport},
|
||||
{"zlib", PyInit_zlib},
|
||||
|
||||
/* CJK codecs */
|
||||
{"_multibytecodec", PyInit__multibytecodec},
|
||||
{"_codecs_cn", PyInit__codecs_cn},
|
||||
{"_codecs_hk", PyInit__codecs_hk},
|
||||
{"_codecs_iso2022", PyInit__codecs_iso2022},
|
||||
{"_codecs_jp", PyInit__codecs_jp},
|
||||
{"_codecs_kr", PyInit__codecs_kr},
|
||||
{"_codecs_tw", PyInit__codecs_tw},
|
||||
|
||||
/* tools/freeze/makeconfig.py marker for additional "_inittab" entries */
|
||||
/* -- ADDMODULE MARKER 2 -- */
|
||||
|
||||
/* This module "lives in" with marshal.c */
|
||||
{"marshal", PyMarshal_Init},
|
||||
|
||||
/* This lives it with import.c */
|
||||
{"_imp", PyInit_imp},
|
||||
|
||||
/* These entries are here for sys.builtin_module_names */
|
||||
{"builtins", NULL},
|
||||
{"sys", NULL},
|
||||
{"_warnings", _PyWarnings_Init},
|
||||
{"_string", PyInit__string},
|
||||
|
||||
{"_io", PyInit__io},
|
||||
{"_pickle", PyInit__pickle},
|
||||
{"atexit", PyInit_atexit},
|
||||
{"_stat", PyInit__stat},
|
||||
{"_opcode", PyInit__opcode},
|
||||
|
||||
/* Sentinel */
|
||||
{0, 0}
|
||||
};
|
122
third_party/python/PC/dl_nt.c
vendored
Normal file
|
@ -0,0 +1,122 @@
|
|||
/*
|
||||
|
||||
Entry point for the Windows NT DLL.
|
||||
|
||||
About the only reason for having this, is so initall() can automatically
|
||||
be called, removing that burden (and possible source of frustration if
|
||||
forgotten) from the programmer.
|
||||
|
||||
*/
|
||||
|
||||
#include "Python.h"
|
||||
#include "windows.h"
|
||||
|
||||
#ifdef Py_ENABLE_SHARED
|
||||
#ifdef MS_DLL_ID
|
||||
// The string is available at build, so fill the buffer immediately
|
||||
char dllVersionBuffer[16] = MS_DLL_ID;
|
||||
#else
|
||||
char dllVersionBuffer[16] = ""; // a private buffer
|
||||
#endif
|
||||
|
||||
// Python Globals
|
||||
HMODULE PyWin_DLLhModule = NULL;
|
||||
const char *PyWin_DLLVersionString = dllVersionBuffer;
|
||||
|
||||
#if HAVE_SXS
|
||||
// Windows "Activation Context" work.
|
||||
// Our .pyd extension modules are generally built without a manifest (ie,
|
||||
// those included with Python and those built with a default distutils.
|
||||
// This requires we perform some "activation context" magic when loading our
|
||||
// extensions. In summary:
|
||||
// * As our DLL loads we save the context being used.
|
||||
// * Before loading our extensions we re-activate our saved context.
|
||||
// * After extension load is complete we restore the old context.
|
||||
// As an added complication, this magic only works on XP or later - we simply
|
||||
// use the existence (or not) of the relevant function pointers from kernel32.
|
||||
// See bug 4566 (http://python.org/sf/4566) for more details.
|
||||
// In Visual Studio 2010, side by side assemblies are no longer used by
|
||||
// default.
|
||||
|
||||
typedef BOOL (WINAPI * PFN_GETCURRENTACTCTX)(HANDLE *);
|
||||
typedef BOOL (WINAPI * PFN_ACTIVATEACTCTX)(HANDLE, ULONG_PTR *);
|
||||
typedef BOOL (WINAPI * PFN_DEACTIVATEACTCTX)(DWORD, ULONG_PTR);
|
||||
typedef BOOL (WINAPI * PFN_ADDREFACTCTX)(HANDLE);
|
||||
typedef BOOL (WINAPI * PFN_RELEASEACTCTX)(HANDLE);
|
||||
|
||||
// locals and function pointers for this activation context magic.
|
||||
static HANDLE PyWin_DLLhActivationContext = NULL; // one day it might be public
|
||||
static PFN_GETCURRENTACTCTX pfnGetCurrentActCtx = NULL;
|
||||
static PFN_ACTIVATEACTCTX pfnActivateActCtx = NULL;
|
||||
static PFN_DEACTIVATEACTCTX pfnDeactivateActCtx = NULL;
|
||||
static PFN_ADDREFACTCTX pfnAddRefActCtx = NULL;
|
||||
static PFN_RELEASEACTCTX pfnReleaseActCtx = NULL;
|
||||
|
||||
void _LoadActCtxPointers()
|
||||
{
|
||||
HINSTANCE hKernel32 = GetModuleHandleW(L"kernel32.dll");
|
||||
if (hKernel32)
|
||||
pfnGetCurrentActCtx = (PFN_GETCURRENTACTCTX) GetProcAddress(hKernel32, "GetCurrentActCtx");
|
||||
// If we can't load GetCurrentActCtx (ie, pre XP) , don't bother with the rest.
|
||||
if (pfnGetCurrentActCtx) {
|
||||
pfnActivateActCtx = (PFN_ACTIVATEACTCTX) GetProcAddress(hKernel32, "ActivateActCtx");
|
||||
pfnDeactivateActCtx = (PFN_DEACTIVATEACTCTX) GetProcAddress(hKernel32, "DeactivateActCtx");
|
||||
pfnAddRefActCtx = (PFN_ADDREFACTCTX) GetProcAddress(hKernel32, "AddRefActCtx");
|
||||
pfnReleaseActCtx = (PFN_RELEASEACTCTX) GetProcAddress(hKernel32, "ReleaseActCtx");
|
||||
}
|
||||
}
|
||||
|
||||
ULONG_PTR _Py_ActivateActCtx()
|
||||
{
|
||||
ULONG_PTR ret = 0;
|
||||
if (PyWin_DLLhActivationContext && pfnActivateActCtx)
|
||||
if (!(*pfnActivateActCtx)(PyWin_DLLhActivationContext, &ret)) {
|
||||
OutputDebugString("Python failed to activate the activation context before loading a DLL\n");
|
||||
ret = 0; // no promise the failing function didn't change it!
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
void _Py_DeactivateActCtx(ULONG_PTR cookie)
|
||||
{
|
||||
if (cookie && pfnDeactivateActCtx)
|
||||
if (!(*pfnDeactivateActCtx)(0, cookie))
|
||||
OutputDebugString("Python failed to de-activate the activation context\n");
|
||||
}
|
||||
#endif /* HAVE_SXS */
|
||||
|
||||
BOOL WINAPI DllMain (HANDLE hInst,
|
||||
ULONG ul_reason_for_call,
|
||||
LPVOID lpReserved)
|
||||
{
|
||||
switch (ul_reason_for_call)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
PyWin_DLLhModule = hInst;
|
||||
#ifndef MS_DLL_ID
|
||||
// If we have MS_DLL_ID, we don't need to load the string.
|
||||
// 1000 is a magic number I picked out of the air. Could do with a #define, I spose...
|
||||
LoadString(hInst, 1000, dllVersionBuffer, sizeof(dllVersionBuffer));
|
||||
#endif
|
||||
|
||||
#if HAVE_SXS
|
||||
// and capture our activation context for use when loading extensions.
|
||||
_LoadActCtxPointers();
|
||||
if (pfnGetCurrentActCtx && pfnAddRefActCtx)
|
||||
if ((*pfnGetCurrentActCtx)(&PyWin_DLLhActivationContext))
|
||||
if (!(*pfnAddRefActCtx)(PyWin_DLLhActivationContext))
|
||||
OutputDebugString("Python failed to load the default activation context\n");
|
||||
#endif
|
||||
break;
|
||||
|
||||
case DLL_PROCESS_DETACH:
|
||||
#if HAVE_SXS
|
||||
if (pfnReleaseActCtx)
|
||||
(*pfnReleaseActCtx)(PyWin_DLLhActivationContext);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#endif /* Py_ENABLE_SHARED */
|
77
third_party/python/PC/dllbase_nt.txt
vendored
Normal file
|
@ -0,0 +1,77 @@
|
|||
In Win32, DLL's are "pre-linked" using a specified base address.
|
||||
When the DLL is loaded, an attempt is made to place it at
|
||||
that address. If that address is already in use, a new base address
|
||||
is selected, and the DLL subject to fixups. Apparently, these
|
||||
fixups are very slow, and significant performance gains can be
|
||||
made by selecting a good base address.
|
||||
|
||||
This document is to allocate base addresses to core Python
|
||||
and Python .PYD files, to give a better change of optimal performance.
|
||||
This base address is passed to the linker using the /BASE
|
||||
command line switch.
|
||||
|
||||
|
||||
Python.exe/Pythonw.exe - 1d000000 - 1e000000 (-1)
|
||||
Python.dll - 1e000000 - 1e100000 (-1)
|
||||
|
||||
Standard Extension Modules 1e100000 - 1e200000 ""
|
||||
- _symtable 1e100000 - 1e110000 pyd removed in 2.4
|
||||
- bsddb 1e180000 - 1e188000 pyd removed in 3.0
|
||||
- _tkinter 1e190000 - 1e1A0000
|
||||
- parser 1e1A0000 - 1e1B0000 pyd removed in 2.4
|
||||
- zlib 1e1B0000 - 1e1C0000
|
||||
- winreg 1e1C0000 - 1e1D0000 pyd removed in 2.4
|
||||
- _socket 1e1D0000 - 1e1E0000
|
||||
- _sre 1e1E0000 - 1e1F0000 pyd removed in 2.4
|
||||
- mmap 1e1F0000 - 1e1FFFFF pyd removed in 2.4
|
||||
|
||||
More standard extensions 1D100000 - 1e000000
|
||||
- pyexpat 1D100000 - 1D110000
|
||||
- select 1D110000 - 1D120000
|
||||
- unicodedata 1D120000 - 1D160000
|
||||
- winsound 1D160000 - 1D170000
|
||||
- bZ2 1D170000 - 1D180000
|
||||
- datetime 1D180000 - 1D190000 pyd removed in 2.4
|
||||
- _csv 1D190000 - 1D1A0000 pyd removed in 2.4
|
||||
- _ctypes 1D1A0000 - 1D1B0000
|
||||
|
||||
Other extension modules
|
||||
- win32api 1e200000 - 1e220000
|
||||
- win32ras 1e220000 - 1e230000
|
||||
- win32lz 1e230000 - 1e240000
|
||||
- timer 1e240000 - 1e250000
|
||||
- mmapfile 1e250000 - 1e260000
|
||||
- win32pipe 1e260000 - 1e270000
|
||||
- avl 1e270000 - 1e270000
|
||||
- dbhash 1e280000 - 1e290000
|
||||
- win32net 1e290000 - 1e2A0000
|
||||
- win32security 1e2A0000 - 1e2B0000
|
||||
- win32print 1e2B0000 - 1e2c0000
|
||||
- <unused> 1e2d0000 - 1e2e0000
|
||||
- win32gui 1e2e0000 - 1e2f0000
|
||||
- _imaging 1e2f0000 - 1e300000
|
||||
- multiarray 1e300000 - 1e310000
|
||||
- win32help 1e310000 - 1e320000
|
||||
- win32clipboard 1e320000 - 1e330000
|
||||
- win2kras 1e330000 - 1e340000
|
||||
- pythoncom 1e340000 - 1e400000
|
||||
- win32ui 1e400000 - 1e500000
|
||||
- win32uiole 1e500000 - 1e600000
|
||||
- pywintypes 1e600000 - 1e700000
|
||||
- win32process 1e700000 - 1e800000
|
||||
- odbc 1e710000 - 1e720000
|
||||
- dbi 1e720000 - 1e730000
|
||||
- win32file 1e730000 - 1e740000
|
||||
- win32wnet 1e740000 - 1e750000
|
||||
- win32com.shell 1e750000 - 1e760000
|
||||
- win32com.internet 1e760000 - 1e770000
|
||||
- win32com.exchange 1e770000 - 1e780000
|
||||
- win32com.exchdapi 1e780000 - 1e790000
|
||||
- win32com.axscript 1e790000 - 1e7a0000
|
||||
- win32com.axdebug 1e7b0000 - 1e7c0000
|
||||
- win32com.adsi 1e7f0000 - 1e800000
|
||||
- win32event 1e810000 - 1e820000
|
||||
- win32evtlog 1e820000 - 1e830000
|
||||
- win32com.axcontrol 1e830000 - 1e840000
|
||||
|
||||
|
6
third_party/python/PC/empty.c
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
#include <windows.h>
|
||||
int __stdcall
|
||||
WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
|
||||
{
|
||||
return 0;
|
||||
}
|
80
third_party/python/PC/errmap.h
vendored
Normal file
|
@ -0,0 +1,80 @@
|
|||
/* Generated file. Do not edit. */
|
||||
int winerror_to_errno(int winerror)
|
||||
{
|
||||
switch(winerror) {
|
||||
case 2: return 2;
|
||||
case 3: return 2;
|
||||
case 4: return 24;
|
||||
case 5: return 13;
|
||||
case 6: return 9;
|
||||
case 7: return 12;
|
||||
case 8: return 12;
|
||||
case 9: return 12;
|
||||
case 10: return 7;
|
||||
case 11: return 8;
|
||||
case 15: return 2;
|
||||
case 16: return 13;
|
||||
case 17: return 18;
|
||||
case 18: return 2;
|
||||
case 19: return 13;
|
||||
case 20: return 13;
|
||||
case 21: return 13;
|
||||
case 22: return 13;
|
||||
case 23: return 13;
|
||||
case 24: return 13;
|
||||
case 25: return 13;
|
||||
case 26: return 13;
|
||||
case 27: return 13;
|
||||
case 28: return 13;
|
||||
case 29: return 13;
|
||||
case 30: return 13;
|
||||
case 31: return 13;
|
||||
case 32: return 13;
|
||||
case 33: return 13;
|
||||
case 34: return 13;
|
||||
case 35: return 13;
|
||||
case 36: return 13;
|
||||
case 53: return 2;
|
||||
case 65: return 13;
|
||||
case 67: return 2;
|
||||
case 80: return 17;
|
||||
case 82: return 13;
|
||||
case 83: return 13;
|
||||
case 89: return 11;
|
||||
case 108: return 13;
|
||||
case 109: return 32;
|
||||
case 112: return 28;
|
||||
case 114: return 9;
|
||||
case 128: return 10;
|
||||
case 129: return 10;
|
||||
case 130: return 9;
|
||||
case 132: return 13;
|
||||
case 145: return 41;
|
||||
case 158: return 13;
|
||||
case 161: return 2;
|
||||
case 164: return 11;
|
||||
case 167: return 13;
|
||||
case 183: return 17;
|
||||
case 188: return 8;
|
||||
case 189: return 8;
|
||||
case 190: return 8;
|
||||
case 191: return 8;
|
||||
case 192: return 8;
|
||||
case 193: return 8;
|
||||
case 194: return 8;
|
||||
case 195: return 8;
|
||||
case 196: return 8;
|
||||
case 197: return 8;
|
||||
case 198: return 8;
|
||||
case 199: return 8;
|
||||
case 200: return 8;
|
||||
case 201: return 8;
|
||||
case 202: return 8;
|
||||
case 206: return 2;
|
||||
case 215: return 11;
|
||||
case 232: return 32;
|
||||
case 267: return 20;
|
||||
case 1816: return 12;
|
||||
default: return EINVAL;
|
||||
}
|
||||
}
|
5
third_party/python/PC/errmap.mak
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
errmap.h: generrmap.exe
|
||||
.\generrmap.exe > errmap.h
|
||||
|
||||
genermap.exe: generrmap.c
|
||||
cl generrmap.c
|
3
third_party/python/PC/external/Externals.txt
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
The files in this folder are from the Microsoft.VisualStudio.Setup.Configuration.Native package on Nuget.
|
||||
|
||||
They are licensed under the MIT license.
|
827
third_party/python/PC/external/include/Setup.Configuration.h
vendored
Normal file
|
@ -0,0 +1,827 @@
|
|||
// The MIT License(MIT)
|
||||
// Copyright(C) Microsoft Corporation.All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files(the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions :
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
// Constants
|
||||
//
|
||||
#ifndef E_NOTFOUND
|
||||
#define E_NOTFOUND HRESULT_FROM_WIN32(ERROR_NOT_FOUND)
|
||||
#endif
|
||||
|
||||
#ifndef E_FILENOTFOUND
|
||||
#define E_FILENOTFOUND HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)
|
||||
#endif
|
||||
|
||||
#ifndef E_NOTSUPPORTED
|
||||
#define E_NOTSUPPORTED HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED)
|
||||
#endif
|
||||
|
||||
// Enumerations
|
||||
//
|
||||
/// <summary>
|
||||
/// The state of an instance.
|
||||
/// </summary>
|
||||
enum InstanceState
|
||||
{
|
||||
/// <summary>
|
||||
/// The instance state has not been determined.
|
||||
/// </summary>
|
||||
eNone = 0,
|
||||
|
||||
/// <summary>
|
||||
/// The instance installation path exists.
|
||||
/// </summary>
|
||||
eLocal = 1,
|
||||
|
||||
/// <summary>
|
||||
/// A product is registered to the instance.
|
||||
/// </summary>
|
||||
eRegistered = 2,
|
||||
|
||||
/// <summary>
|
||||
/// No reboot is required for the instance.
|
||||
/// </summary>
|
||||
eNoRebootRequired = 4,
|
||||
|
||||
/// <summary>
|
||||
/// No errors were reported for the instance.
|
||||
/// </summary>
|
||||
eNoErrors = 8,
|
||||
|
||||
/// <summary>
|
||||
/// The instance represents a complete install.
|
||||
/// </summary>
|
||||
eComplete = MAXUINT,
|
||||
};
|
||||
|
||||
// Forward interface declarations
|
||||
//
|
||||
#ifndef __ISetupInstance_FWD_DEFINED__
|
||||
#define __ISetupInstance_FWD_DEFINED__
|
||||
typedef struct ISetupInstance ISetupInstance;
|
||||
#endif
|
||||
|
||||
#ifndef __ISetupInstance2_FWD_DEFINED__
|
||||
#define __ISetupInstance2_FWD_DEFINED__
|
||||
typedef struct ISetupInstance2 ISetupInstance2;
|
||||
#endif
|
||||
|
||||
#ifndef __ISetupLocalizedProperties_FWD_DEFINED__
|
||||
#define __ISetupLocalizedProperties_FWD_DEFINED__
|
||||
typedef struct ISetupLocalizedProperties ISetupLocalizedProperties;
|
||||
#endif
|
||||
|
||||
#ifndef __IEnumSetupInstances_FWD_DEFINED__
|
||||
#define __IEnumSetupInstances_FWD_DEFINED__
|
||||
typedef struct IEnumSetupInstances IEnumSetupInstances;
|
||||
#endif
|
||||
|
||||
#ifndef __ISetupConfiguration_FWD_DEFINED__
|
||||
#define __ISetupConfiguration_FWD_DEFINED__
|
||||
typedef struct ISetupConfiguration ISetupConfiguration;
|
||||
#endif
|
||||
|
||||
#ifndef __ISetupConfiguration2_FWD_DEFINED__
|
||||
#define __ISetupConfiguration2_FWD_DEFINED__
|
||||
typedef struct ISetupConfiguration2 ISetupConfiguration2;
|
||||
#endif
|
||||
|
||||
#ifndef __ISetupPackageReference_FWD_DEFINED__
|
||||
#define __ISetupPackageReference_FWD_DEFINED__
|
||||
typedef struct ISetupPackageReference ISetupPackageReference;
|
||||
#endif
|
||||
|
||||
#ifndef __ISetupHelper_FWD_DEFINED__
|
||||
#define __ISetupHelper_FWD_DEFINED__
|
||||
typedef struct ISetupHelper ISetupHelper;
|
||||
#endif
|
||||
|
||||
#ifndef __ISetupErrorState_FWD_DEFINED__
|
||||
#define __ISetupErrorState_FWD_DEFINED__
|
||||
typedef struct ISetupErrorState ISetupErrorState;
|
||||
#endif
|
||||
|
||||
#ifndef __ISetupErrorState2_FWD_DEFINED__
|
||||
#define __ISetupErrorState2_FWD_DEFINED__
|
||||
typedef struct ISetupErrorState2 ISetupErrorState2;
|
||||
#endif
|
||||
|
||||
#ifndef __ISetupFailedPackageReference_FWD_DEFINED__
|
||||
#define __ISetupFailedPackageReference_FWD_DEFINED__
|
||||
typedef struct ISetupFailedPackageReference ISetupFailedPackageReference;
|
||||
#endif
|
||||
|
||||
#ifndef __ISetupFailedPackageReference2_FWD_DEFINED__
|
||||
#define __ISetupFailedPackageReference2_FWD_DEFINED__
|
||||
typedef struct ISetupFailedPackageReference2 ISetupFailedPackageReference2;
|
||||
#endif
|
||||
|
||||
#ifndef __ISetupPropertyStore_FWD_DEFINED__
|
||||
#define __ISetupPropertyStore_FWD_DEFINED__
|
||||
typedef struct ISetupPropertyStore ISetupPropertyStore;
|
||||
#endif
|
||||
|
||||
#ifndef __ISetupLocalizedPropertyStore_FWD_DEFINED__
|
||||
#define __ISetupLocalizedPropertyStore_FWD_DEFINED__
|
||||
typedef struct ISetupLocalizedPropertyStore ISetupLocalizedPropertyStore;
|
||||
#endif
|
||||
|
||||
// Forward class declarations
|
||||
//
|
||||
#ifndef __SetupConfiguration_FWD_DEFINED__
|
||||
#define __SetupConfiguration_FWD_DEFINED__
|
||||
|
||||
#ifdef __cplusplus
|
||||
typedef class SetupConfiguration SetupConfiguration;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Interface definitions
|
||||
//
|
||||
EXTERN_C const IID IID_ISetupInstance;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
/// <summary>
|
||||
/// Information about an instance of a product.
|
||||
/// </summary>
|
||||
struct DECLSPEC_UUID("B41463C3-8866-43B5-BC33-2B0676F7F42E") DECLSPEC_NOVTABLE ISetupInstance : public IUnknown
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the instance identifier (should match the name of the parent instance directory).
|
||||
/// </summary>
|
||||
/// <param name="pbstrInstanceId">The instance identifier.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist.</returns>
|
||||
STDMETHOD(GetInstanceId)(
|
||||
_Out_ BSTR* pbstrInstanceId
|
||||
) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the local date and time when the installation was originally installed.
|
||||
/// </summary>
|
||||
/// <param name="pInstallDate">The local date and time when the installation was originally installed.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined.</returns>
|
||||
STDMETHOD(GetInstallDate)(
|
||||
_Out_ LPFILETIME pInstallDate
|
||||
) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the unique name of the installation, often indicating the branch and other information used for telemetry.
|
||||
/// </summary>
|
||||
/// <param name="pbstrInstallationName">The unique name of the installation, often indicating the branch and other information used for telemetry.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined.</returns>
|
||||
STDMETHOD(GetInstallationName)(
|
||||
_Out_ BSTR* pbstrInstallationName
|
||||
) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the path to the installation root of the product.
|
||||
/// </summary>
|
||||
/// <param name="pbstrInstallationPath">The path to the installation root of the product.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined.</returns>
|
||||
STDMETHOD(GetInstallationPath)(
|
||||
_Out_ BSTR* pbstrInstallationPath
|
||||
) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the version of the product installed in this instance.
|
||||
/// </summary>
|
||||
/// <param name="pbstrInstallationVersion">The version of the product installed in this instance.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined.</returns>
|
||||
STDMETHOD(GetInstallationVersion)(
|
||||
_Out_ BSTR* pbstrInstallationVersion
|
||||
) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the display name (title) of the product installed in this instance.
|
||||
/// </summary>
|
||||
/// <param name="lcid">The LCID for the display name.</param>
|
||||
/// <param name="pbstrDisplayName">The display name (title) of the product installed in this instance.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined.</returns>
|
||||
STDMETHOD(GetDisplayName)(
|
||||
_In_ LCID lcid,
|
||||
_Out_ BSTR* pbstrDisplayName
|
||||
) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the description of the product installed in this instance.
|
||||
/// </summary>
|
||||
/// <param name="lcid">The LCID for the description.</param>
|
||||
/// <param name="pbstrDescription">The description of the product installed in this instance.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined.</returns>
|
||||
STDMETHOD(GetDescription)(
|
||||
_In_ LCID lcid,
|
||||
_Out_ BSTR* pbstrDescription
|
||||
) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Resolves the optional relative path to the root path of the instance.
|
||||
/// </summary>
|
||||
/// <param name="pwszRelativePath">A relative path within the instance to resolve, or NULL to get the root path.</param>
|
||||
/// <param name="pbstrAbsolutePath">The full path to the optional relative path within the instance. If the relative path is NULL, the root path will always terminate in a backslash.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined.</returns>
|
||||
STDMETHOD(ResolvePath)(
|
||||
_In_opt_z_ LPCOLESTR pwszRelativePath,
|
||||
_Out_ BSTR* pbstrAbsolutePath
|
||||
) = 0;
|
||||
};
|
||||
#endif
|
||||
|
||||
EXTERN_C const IID IID_ISetupInstance2;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
/// <summary>
|
||||
/// Information about an instance of a product.
|
||||
/// </summary>
|
||||
struct DECLSPEC_UUID("89143C9A-05AF-49B0-B717-72E218A2185C") DECLSPEC_NOVTABLE ISetupInstance2 : public ISetupInstance
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the state of the instance.
|
||||
/// </summary>
|
||||
/// <param name="pState">The state of the instance.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist.</returns>
|
||||
STDMETHOD(GetState)(
|
||||
_Out_ InstanceState* pState
|
||||
) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets an array of package references registered to the instance.
|
||||
/// </summary>
|
||||
/// <param name="ppsaPackages">Pointer to an array of <see cref="ISetupPackageReference"/>.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the packages property is not defined.</returns>
|
||||
STDMETHOD(GetPackages)(
|
||||
_Out_ LPSAFEARRAY* ppsaPackages
|
||||
) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a pointer to the <see cref="ISetupPackageReference"/> that represents the registered product.
|
||||
/// </summary>
|
||||
/// <param name="ppPackage">Pointer to an instance of <see cref="ISetupPackageReference"/>. This may be NULL if <see cref="GetState"/> does not return <see cref="eComplete"/>.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the packages property is not defined.</returns>
|
||||
STDMETHOD(GetProduct)(
|
||||
_Outptr_result_maybenull_ ISetupPackageReference** ppPackage
|
||||
) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the relative path to the product application, if available.
|
||||
/// </summary>
|
||||
/// <param name="pbstrProductPath">The relative path to the product application, if available.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist.</returns>
|
||||
STDMETHOD(GetProductPath)(
|
||||
_Outptr_result_maybenull_ BSTR* pbstrProductPath
|
||||
) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the error state of the instance, if available.
|
||||
/// </summary>
|
||||
/// <param name="pErrorState">The error state of the instance, if available.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist.</returns>
|
||||
STDMETHOD(GetErrors)(
|
||||
_Outptr_result_maybenull_ ISetupErrorState** ppErrorState
|
||||
) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the instance can be launched.
|
||||
/// </summary>
|
||||
/// <param name="pfIsLaunchable">Whether the instance can be launched.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure.</returns>
|
||||
/// <remarks>
|
||||
/// An instance could have had errors during install but still be launched. Some features may not work correctly, but others will.
|
||||
/// </remarks>
|
||||
STDMETHOD(IsLaunchable)(
|
||||
_Out_ VARIANT_BOOL* pfIsLaunchable
|
||||
) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the instance is complete.
|
||||
/// </summary>
|
||||
/// <param name="pfIsLaunchable">Whether the instance is complete.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure.</returns>
|
||||
/// <remarks>
|
||||
/// An instance is complete if it had no errors during install, resume, or repair.
|
||||
/// </remarks>
|
||||
STDMETHOD(IsComplete)(
|
||||
_Out_ VARIANT_BOOL* pfIsComplete
|
||||
) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets product-specific properties.
|
||||
/// </summary>
|
||||
/// <param name="ppPropeties">A pointer to an instance of <see cref="ISetupPropertyStore"/>. This may be NULL if no properties are defined.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist.</returns>
|
||||
STDMETHOD(GetProperties)(
|
||||
_Outptr_result_maybenull_ ISetupPropertyStore** ppProperties
|
||||
) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the directory path to the setup engine that installed the instance.
|
||||
/// </summary>
|
||||
/// <param name="pbstrEnginePath">The directory path to the setup engine that installed the instance.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist.</returns>
|
||||
STDMETHOD(GetEnginePath)(
|
||||
_Outptr_result_maybenull_ BSTR* pbstrEnginePath
|
||||
) = 0;
|
||||
};
|
||||
#endif
|
||||
|
||||
EXTERN_C const IID IID_ISetupLocalizedProperties;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
/// <summary>
|
||||
/// Provides localized properties of an instance of a product.
|
||||
/// </summary>
|
||||
struct DECLSPEC_UUID("F4BD7382-FE27-4AB4-B974-9905B2A148B0") DECLSPEC_NOVTABLE ISetupLocalizedProperties : public IUnknown
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets localized product-specific properties.
|
||||
/// </summary>
|
||||
/// <param name="ppLocalizedProperties">A pointer to an instance of <see cref="ISetupLocalizedPropertyStore"/>. This may be NULL if no properties are defined.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure.</returns>
|
||||
STDMETHOD(GetLocalizedProperties)(
|
||||
_Outptr_result_maybenull_ ISetupLocalizedPropertyStore** ppLocalizedProperties
|
||||
) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets localized channel-specific properties.
|
||||
/// </summary>
|
||||
/// <param name="ppLocalizedChannelProperties">A pointer to an instance of <see cref="ISetupLocalizedPropertyStore"/>. This may be NULL if no channel properties are defined.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure.</returns>
|
||||
STDMETHOD(GetLocalizedChannelProperties)(
|
||||
_Outptr_result_maybenull_ ISetupLocalizedPropertyStore** ppLocalizedChannelProperties
|
||||
) = 0;
|
||||
};
|
||||
#endif
|
||||
|
||||
EXTERN_C const IID IID_IEnumSetupInstances;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
/// <summary>
|
||||
/// An enumerator of installed <see cref="ISetupInstance"/> objects.
|
||||
/// </summary>
|
||||
struct DECLSPEC_UUID("6380BCFF-41D3-4B2E-8B2E-BF8A6810C848") DECLSPEC_NOVTABLE IEnumSetupInstances : public IUnknown
|
||||
{
|
||||
/// <summary>
|
||||
/// Retrieves the next set of product instances in the enumeration sequence.
|
||||
/// </summary>
|
||||
/// <param name="celt">The number of product instances to retrieve.</param>
|
||||
/// <param name="rgelt">A pointer to an array of <see cref="ISetupInstance"/>.</param>
|
||||
/// <param name="pceltFetched">A pointer to the number of product instances retrieved. If <paramref name="celt"/> is 1 this parameter may be NULL.</param>
|
||||
/// <returns>S_OK if the number of elements were fetched, S_FALSE if nothing was fetched (at end of enumeration), E_INVALIDARG if <paramref name="celt"/> is greater than 1 and pceltFetched is NULL, or E_OUTOFMEMORY if an <see cref="ISetupInstance"/> could not be allocated.</returns>
|
||||
STDMETHOD(Next)(
|
||||
_In_ ULONG celt,
|
||||
_Out_writes_to_(celt, *pceltFetched) ISetupInstance** rgelt,
|
||||
_Out_opt_ _Deref_out_range_(0, celt) ULONG* pceltFetched
|
||||
) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Skips the next set of product instances in the enumeration sequence.
|
||||
/// </summary>
|
||||
/// <param name="celt">The number of product instances to skip.</param>
|
||||
/// <returns>S_OK if the number of elements could be skipped; otherwise, S_FALSE;</returns>
|
||||
STDMETHOD(Skip)(
|
||||
_In_ ULONG celt
|
||||
) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Resets the enumeration sequence to the beginning.
|
||||
/// </summary>
|
||||
/// <returns>Always returns S_OK;</returns>
|
||||
STDMETHOD(Reset)(void) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new enumeration object in the same state as the current enumeration object: the new object points to the same place in the enumeration sequence.
|
||||
/// </summary>
|
||||
/// <param name="ppenum">A pointer to a pointer to a new <see cref="IEnumSetupInstances"/> interface. If the method fails, this parameter is undefined.</param>
|
||||
/// <returns>S_OK if a clone was returned; otherwise, E_OUTOFMEMORY.</returns>
|
||||
STDMETHOD(Clone)(
|
||||
_Deref_out_opt_ IEnumSetupInstances** ppenum
|
||||
) = 0;
|
||||
};
|
||||
#endif
|
||||
|
||||
EXTERN_C const IID IID_ISetupConfiguration;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
/// <summary>
|
||||
/// Gets information about product instances installed on the machine.
|
||||
/// </summary>
|
||||
struct DECLSPEC_UUID("42843719-DB4C-46C2-8E7C-64F1816EFD5B") DECLSPEC_NOVTABLE ISetupConfiguration : public IUnknown
|
||||
{
|
||||
/// <summary>
|
||||
/// Enumerates all launchable product instances installed.
|
||||
/// </summary>
|
||||
/// <param name="ppEnumInstances">An enumeration of completed, installed product instances.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure.</returns>
|
||||
STDMETHOD(EnumInstances)(
|
||||
_Out_ IEnumSetupInstances** ppEnumInstances
|
||||
) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the instance for the current process path.
|
||||
/// </summary>
|
||||
/// <param name="ppInstance">The instance for the current process path.</param>
|
||||
/// <returns>
|
||||
/// The instance for the current process path, or E_NOTFOUND if not found.
|
||||
/// The <see cref="ISetupInstance::GetState"/> may indicate the instance is invalid.
|
||||
/// </returns>
|
||||
/// <remarks>
|
||||
/// The returned instance may not be launchable.
|
||||
/// </remarks>
|
||||
STDMETHOD(GetInstanceForCurrentProcess)(
|
||||
_Out_ ISetupInstance** ppInstance
|
||||
) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the instance for the given path.
|
||||
/// </summary>
|
||||
/// <param name="ppInstance">The instance for the given path.</param>
|
||||
/// <returns>
|
||||
/// The instance for the given path, or E_NOTFOUND if not found.
|
||||
/// The <see cref="ISetupInstance::GetState"/> may indicate the instance is invalid.
|
||||
/// </returns>
|
||||
/// <remarks>
|
||||
/// The returned instance may not be launchable.
|
||||
/// </remarks>
|
||||
STDMETHOD(GetInstanceForPath)(
|
||||
_In_z_ LPCWSTR wzPath,
|
||||
_Out_ ISetupInstance** ppInstance
|
||||
) = 0;
|
||||
};
|
||||
#endif
|
||||
|
||||
EXTERN_C const IID IID_ISetupConfiguration2;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
/// <summary>
|
||||
/// Gets information about product instances.
|
||||
/// </summary>
|
||||
struct DECLSPEC_UUID("26AAB78C-4A60-49D6-AF3B-3C35BC93365D") DECLSPEC_NOVTABLE ISetupConfiguration2 : public ISetupConfiguration
|
||||
{
|
||||
/// <summary>
|
||||
/// Enumerates all product instances.
|
||||
/// </summary>
|
||||
/// <param name="ppEnumInstances">An enumeration of all product instances.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure.</returns>
|
||||
STDMETHOD(EnumAllInstances)(
|
||||
_Out_ IEnumSetupInstances** ppEnumInstances
|
||||
) = 0;
|
||||
};
|
||||
#endif
|
||||
|
||||
EXTERN_C const IID IID_ISetupPackageReference;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
/// <summary>
|
||||
/// A reference to a package.
|
||||
/// </summary>
|
||||
struct DECLSPEC_UUID("da8d8a16-b2b6-4487-a2f1-594ccccd6bf5") DECLSPEC_NOVTABLE ISetupPackageReference : public IUnknown
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the general package identifier.
|
||||
/// </summary>
|
||||
/// <param name="pbstrId">The general package identifier.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure.</returns>
|
||||
STDMETHOD(GetId)(
|
||||
_Out_ BSTR* pbstrId
|
||||
) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the version of the package.
|
||||
/// </summary>
|
||||
/// <param name="pbstrVersion">The version of the package.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure.</returns>
|
||||
STDMETHOD(GetVersion)(
|
||||
_Out_ BSTR* pbstrVersion
|
||||
) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the target process architecture of the package.
|
||||
/// </summary>
|
||||
/// <param name="pbstrChip">The target process architecture of the package.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure.</returns>
|
||||
STDMETHOD(GetChip)(
|
||||
_Out_ BSTR* pbstrChip
|
||||
) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the language and optional region identifier.
|
||||
/// </summary>
|
||||
/// <param name="pbstrLanguage">The language and optional region identifier.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure.</returns>
|
||||
STDMETHOD(GetLanguage)(
|
||||
_Out_ BSTR* pbstrLanguage
|
||||
) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the build branch of the package.
|
||||
/// </summary>
|
||||
/// <param name="pbstrBranch">The build branch of the package.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure.</returns>
|
||||
STDMETHOD(GetBranch)(
|
||||
_Out_ BSTR* pbstrBranch
|
||||
) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the package.
|
||||
/// </summary>
|
||||
/// <param name="pbstrType">The type of the package.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure.</returns>
|
||||
STDMETHOD(GetType)(
|
||||
_Out_ BSTR* pbstrType
|
||||
) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the unique identifier consisting of all defined tokens.
|
||||
/// </summary>
|
||||
/// <param name="pbstrUniqueId">The unique identifier consisting of all defined tokens.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure, including E_UNEXPECTED if no Id was defined (required).</returns>
|
||||
STDMETHOD(GetUniqueId)(
|
||||
_Out_ BSTR* pbstrUniqueId
|
||||
) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the package refers to an external extension.
|
||||
/// </summary>
|
||||
/// <param name="pfIsExtension">A value indicating whether the package refers to an external extension.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure, including E_UNEXPECTED if no Id was defined (required).</returns>
|
||||
STDMETHOD(GetIsExtension)(
|
||||
_Out_ VARIANT_BOOL* pfIsExtension
|
||||
) = 0;
|
||||
};
|
||||
#endif
|
||||
|
||||
EXTERN_C const IID IID_ISetupHelper;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
/// <summary>
|
||||
/// Helper functions.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// You can query for this interface from the <see cref="SetupConfiguration"/> class.
|
||||
/// </remarks>
|
||||
struct DECLSPEC_UUID("42b21b78-6192-463e-87bf-d577838f1d5c") DECLSPEC_NOVTABLE ISetupHelper : public IUnknown
|
||||
{
|
||||
/// <summary>
|
||||
/// Parses a dotted quad version string into a 64-bit unsigned integer.
|
||||
/// </summary>
|
||||
/// <param name="pwszVersion">The dotted quad version string to parse, e.g. 1.2.3.4.</param>
|
||||
/// <param name="pullVersion">A 64-bit unsigned integer representing the version. You can compare this to other versions.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure, including E_INVALIDARG if the version is not valid.</returns>
|
||||
STDMETHOD(ParseVersion)(
|
||||
_In_ LPCOLESTR pwszVersion,
|
||||
_Out_ PULONGLONG pullVersion
|
||||
) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Parses a dotted quad version string into a 64-bit unsigned integer.
|
||||
/// </summary>
|
||||
/// <param name="pwszVersionRange">The string containing 1 or 2 dotted quad version strings to parse, e.g. [1.0,) that means 1.0.0.0 or newer.</param>
|
||||
/// <param name="pullMinVersion">A 64-bit unsigned integer representing the minimum version, which may be 0. You can compare this to other versions.</param>
|
||||
/// <param name="pullMaxVersion">A 64-bit unsigned integer representing the maximum version, which may be MAXULONGLONG. You can compare this to other versions.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure, including E_INVALIDARG if the version range is not valid.</returns>
|
||||
STDMETHOD(ParseVersionRange)(
|
||||
_In_ LPCOLESTR pwszVersionRange,
|
||||
_Out_ PULONGLONG pullMinVersion,
|
||||
_Out_ PULONGLONG pullMaxVersion
|
||||
) = 0;
|
||||
};
|
||||
#endif
|
||||
|
||||
EXTERN_C const IID IID_ISetupErrorState;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
/// <summary>
|
||||
/// Information about the error state of an instance.
|
||||
/// </summary>
|
||||
struct DECLSPEC_UUID("46DCCD94-A287-476A-851E-DFBC2FFDBC20") DECLSPEC_NOVTABLE ISetupErrorState : public IUnknown
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets an array of failed package references.
|
||||
/// </summary>
|
||||
/// <param name="ppsaPackages">Pointer to an array of <see cref="ISetupFailedPackageReference"/>, if packages have failed.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure.</returns>
|
||||
STDMETHOD(GetFailedPackages)(
|
||||
_Outptr_result_maybenull_ LPSAFEARRAY* ppsaFailedPackages
|
||||
) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets an array of skipped package references.
|
||||
/// </summary>
|
||||
/// <param name="ppsaPackages">Pointer to an array of <see cref="ISetupPackageReference"/>, if packages have been skipped.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure.</returns>
|
||||
STDMETHOD(GetSkippedPackages)(
|
||||
_Outptr_result_maybenull_ LPSAFEARRAY* ppsaSkippedPackages
|
||||
) = 0;
|
||||
};
|
||||
#endif
|
||||
|
||||
EXTERN_C const IID IID_ISetupErrorState2;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
/// <summary>
|
||||
/// Information about the error state of an instance.
|
||||
/// </summary>
|
||||
struct DECLSPEC_UUID("9871385B-CA69-48F2-BC1F-7A37CBF0B1EF") DECLSPEC_NOVTABLE ISetupErrorState2 : public ISetupErrorState
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the path to the error log.
|
||||
/// </summary>
|
||||
/// <param name="pbstrChip">The path to the error log.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure.</returns>
|
||||
STDMETHOD(GetErrorLogFilePath)(
|
||||
_Outptr_result_maybenull_ BSTR* pbstrErrorLogFilePath
|
||||
) = 0;
|
||||
};
|
||||
#endif
|
||||
|
||||
EXTERN_C const IID IID_ISetupFailedPackageReference;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
/// <summary>
|
||||
/// A reference to a failed package.
|
||||
/// </summary>
|
||||
struct DECLSPEC_UUID("E73559CD-7003-4022-B134-27DC650B280F") DECLSPEC_NOVTABLE ISetupFailedPackageReference : public ISetupPackageReference
|
||||
{
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
EXTERN_C const IID IID_ISetupFailedPackageReference2;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
/// <summary>
|
||||
/// A reference to a failed package.
|
||||
/// </summary>
|
||||
struct DECLSPEC_UUID("0FAD873E-E874-42E3-B268-4FE2F096B9CA") DECLSPEC_NOVTABLE ISetupFailedPackageReference2 : public ISetupFailedPackageReference
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the path to the optional package log.
|
||||
/// </summary>
|
||||
/// <param name="pbstrId">The path to the optional package log.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure.</returns>
|
||||
STDMETHOD(GetLogFilePath)(
|
||||
_Outptr_result_maybenull_ BSTR* pbstrLogFilePath
|
||||
) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the description of the package failure.
|
||||
/// </summary>
|
||||
/// <param name="pbstrId">The description of the package failure.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure.</returns>
|
||||
STDMETHOD(GetDescription)(
|
||||
_Outptr_result_maybenull_ BSTR* pbstrDescription
|
||||
) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the signature to use for feedback reporting.
|
||||
/// </summary>
|
||||
/// <param name="pbstrId">The signature to use for feedback reporting.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure.</returns>
|
||||
STDMETHOD(GetSignature)(
|
||||
_Outptr_result_maybenull_ BSTR* pbstrSignature
|
||||
) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the array of details for this package failure.
|
||||
/// </summary>
|
||||
/// <param name="ppsaDetails">Pointer to an array of details as BSTRs.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure.</returns>
|
||||
STDMETHOD(GetDetails)(
|
||||
_Out_ LPSAFEARRAY* ppsaDetails
|
||||
) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets an array of packages affected by this package failure.
|
||||
/// </summary>
|
||||
/// <param name="ppsaPackages">Pointer to an array of <see cref="ISetupPackageReference"/> for packages affected by this package failure. This may be NULL.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure.</returns>
|
||||
STDMETHOD(GetAffectedPackages)(
|
||||
_Out_ LPSAFEARRAY* ppsaAffectedPackages
|
||||
) = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
EXTERN_C const IID IID_ISetupPropertyStore;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
/// <summary>
|
||||
/// Provides named properties.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// You can get this from an <see cref="ISetupInstance"/>, <see cref="ISetupPackageReference"/>, or derivative.
|
||||
/// </remarks>
|
||||
struct DECLSPEC_UUID("C601C175-A3BE-44BC-91F6-4568D230FC83") DECLSPEC_NOVTABLE ISetupPropertyStore : public IUnknown
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets an array of property names in this property store.
|
||||
/// </summary>
|
||||
/// <param name="ppsaNames">Pointer to an array of property names as BSTRs.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure.</returns>
|
||||
STDMETHOD(GetNames)(
|
||||
_Out_ LPSAFEARRAY* ppsaNames
|
||||
) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value of a named property in this property store.
|
||||
/// </summary>
|
||||
/// <param name="pwszName">The name of the property to get.</param>
|
||||
/// <param name="pvtValue">The value of the property.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure, including E_NOTFOUND if the property is not defined or E_NOTSUPPORTED if the property type is not supported.</returns>
|
||||
STDMETHOD(GetValue)(
|
||||
_In_ LPCOLESTR pwszName,
|
||||
_Out_ LPVARIANT pvtValue
|
||||
) = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
EXTERN_C const IID IID_ISetupLocalizedPropertyStore;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
/// <summary>
|
||||
/// Provides localized named properties.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// You can get this from an <see cref="ISetupLocalizedProperties"/>.
|
||||
/// </remarks>
|
||||
struct DECLSPEC_UUID("5BB53126-E0D5-43DF-80F1-6B161E5C6F6C") DECLSPEC_NOVTABLE ISetupLocalizedPropertyStore : public IUnknown
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets an array of property names in this property store.
|
||||
/// </summary>
|
||||
/// <param name="lcid">The LCID for the property names.</param>
|
||||
/// <param name="ppsaNames">Pointer to an array of property names as BSTRs.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure.</returns>
|
||||
STDMETHOD(GetNames)(
|
||||
_In_ LCID lcid,
|
||||
_Out_ LPSAFEARRAY* ppsaNames
|
||||
) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value of a named property in this property store.
|
||||
/// </summary>
|
||||
/// <param name="pwszName">The name of the property to get.</param>
|
||||
/// <param name="lcid">The LCID for the property.</param>
|
||||
/// <param name="pvtValue">The value of the property.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure, including E_NOTFOUND if the property is not defined or E_NOTSUPPORTED if the property type is not supported.</returns>
|
||||
STDMETHOD(GetValue)(
|
||||
_In_ LPCOLESTR pwszName,
|
||||
_In_ LCID lcid,
|
||||
_Out_ LPVARIANT pvtValue
|
||||
) = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
// Class declarations
|
||||
//
|
||||
EXTERN_C const CLSID CLSID_SetupConfiguration;
|
||||
|
||||
#ifdef __cplusplus
|
||||
/// <summary>
|
||||
/// This class implements <see cref="ISetupConfiguration"/>, <see cref="ISetupConfiguration2"/>, and <see cref="ISetupHelper"/>.
|
||||
/// </summary>
|
||||
class DECLSPEC_UUID("177F0C4A-1CD3-4DE7-A32C-71DBBB9FA36D") SetupConfiguration;
|
||||
#endif
|
||||
|
||||
// Function declarations
|
||||
//
|
||||
/// <summary>
|
||||
/// Gets an <see cref="ISetupConfiguration"/> that provides information about product instances installed on the machine.
|
||||
/// </summary>
|
||||
/// <param name="ppConfiguration">The <see cref="ISetupConfiguration"/> that provides information about product instances installed on the machine.</param>
|
||||
/// <param name="pReserved">Reserved for future use.</param>
|
||||
/// <returns>Standard HRESULT indicating success or failure.</returns>
|
||||
STDMETHODIMP GetSetupConfiguration(
|
||||
_Out_ ISetupConfiguration** ppConfiguration,
|
||||
_Reserved_ LPVOID pReserved
|
||||
);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
BIN
third_party/python/PC/external/v140/amd64/Microsoft.VisualStudio.Setup.Configuration.Native.lib
vendored
Normal file
BIN
third_party/python/PC/external/v140/win32/Microsoft.VisualStudio.Setup.Configuration.Native.lib
vendored
Normal file
BIN
third_party/python/PC/external/v141/amd64/Microsoft.VisualStudio.Setup.Configuration.Native.lib
vendored
Normal file
BIN
third_party/python/PC/external/v141/win32/Microsoft.VisualStudio.Setup.Configuration.Native.lib
vendored
Normal file
134
third_party/python/PC/frozen_dllmain.c
vendored
Normal file
|
@ -0,0 +1,134 @@
|
|||
/* FreezeDLLMain.cpp
|
||||
|
||||
This is a DLLMain suitable for frozen applications/DLLs on
|
||||
a Windows platform.
|
||||
|
||||
The general problem is that many Python extension modules may define
|
||||
DLL main functions, but when statically linked together to form
|
||||
a frozen application, this DLLMain symbol exists multiple times.
|
||||
|
||||
The solution is:
|
||||
* Each module checks for a frozen build, and if so, defines its DLLMain
|
||||
function as "__declspec(dllexport) DllMain%module%"
|
||||
(eg, DllMainpythoncom, or DllMainpywintypes)
|
||||
|
||||
* The frozen .EXE/.DLL links against this module, which provides
|
||||
the single DllMain.
|
||||
|
||||
* This DllMain attempts to locate and call the DllMain for each
|
||||
of the extension modules.
|
||||
|
||||
* This code also has hooks to "simulate" DllMain when used from
|
||||
a frozen .EXE.
|
||||
|
||||
At this stage, there is a static table of "possibly embedded modules".
|
||||
This should change to something better, but it will work OK for now.
|
||||
|
||||
Note that this scheme does not handle dependencies in the order
|
||||
of DllMain calls - except it does call pywintypes first :-)
|
||||
|
||||
As an example of how an extension module with a DllMain should be
|
||||
changed, here is a snippet from the pythoncom extension module.
|
||||
|
||||
// end of example code from pythoncom's DllMain.cpp
|
||||
#ifndef BUILD_FREEZE
|
||||
#define DLLMAIN DllMain
|
||||
#define DLLMAIN_DECL
|
||||
#else
|
||||
#define DLLMAIN DllMainpythoncom
|
||||
#define DLLMAIN_DECL __declspec(dllexport)
|
||||
#endif
|
||||
|
||||
extern "C" DLLMAIN_DECL
|
||||
BOOL WINAPI DLLMAIN(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
|
||||
// end of example code from pythoncom's DllMain.cpp
|
||||
|
||||
***************************************************************************/
|
||||
#include "windows.h"
|
||||
|
||||
static char *possibleModules[] = {
|
||||
"pywintypes",
|
||||
"pythoncom",
|
||||
"win32ui",
|
||||
NULL,
|
||||
};
|
||||
|
||||
BOOL CallModuleDllMain(char *modName, DWORD dwReason);
|
||||
|
||||
|
||||
/*
|
||||
Called by a frozen .EXE only, so that built-in extension
|
||||
modules are initialized correctly
|
||||
*/
|
||||
void PyWinFreeze_ExeInit(void)
|
||||
{
|
||||
char **modName;
|
||||
for (modName = possibleModules;*modName;*modName++) {
|
||||
/* printf("Initialising '%s'\n", *modName); */
|
||||
CallModuleDllMain(*modName, DLL_PROCESS_ATTACH);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Called by a frozen .EXE only, so that built-in extension
|
||||
modules are cleaned up
|
||||
*/
|
||||
void PyWinFreeze_ExeTerm(void)
|
||||
{
|
||||
// Must go backwards
|
||||
char **modName;
|
||||
for (modName = possibleModules+Py_ARRAY_LENGTH(possibleModules)-2;
|
||||
modName >= possibleModules;
|
||||
*modName--) {
|
||||
/* printf("Terminating '%s'\n", *modName);*/
|
||||
CallModuleDllMain(*modName, DLL_PROCESS_DETACH);
|
||||
}
|
||||
}
|
||||
|
||||
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
|
||||
{
|
||||
BOOL ret = TRUE;
|
||||
switch (dwReason) {
|
||||
case DLL_PROCESS_ATTACH:
|
||||
{
|
||||
char **modName;
|
||||
for (modName = possibleModules;*modName;*modName++) {
|
||||
BOOL ok = CallModuleDllMain(*modName, dwReason);
|
||||
if (!ok)
|
||||
ret = FALSE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DLL_PROCESS_DETACH:
|
||||
{
|
||||
// Must go backwards
|
||||
char **modName;
|
||||
for (modName = possibleModules+Py_ARRAY_LENGTH(possibleModules)-2;
|
||||
modName >= possibleModules;
|
||||
*modName--)
|
||||
CallModuleDllMain(*modName, DLL_PROCESS_DETACH);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
BOOL CallModuleDllMain(char *modName, DWORD dwReason)
|
||||
{
|
||||
BOOL (WINAPI * pfndllmain)(HINSTANCE, DWORD, LPVOID);
|
||||
|
||||
char funcName[255];
|
||||
HMODULE hmod = GetModuleHandleW(NULL);
|
||||
strcpy(funcName, "_DllMain");
|
||||
strcat(funcName, modName);
|
||||
strcat(funcName, "@12"); // stdcall convention.
|
||||
pfndllmain = (BOOL (WINAPI *)(HINSTANCE, DWORD, LPVOID))GetProcAddress(hmod, funcName);
|
||||
if (pfndllmain==NULL) {
|
||||
/* No function by that name exported - then that module does
|
||||
not appear in our frozen program - return OK
|
||||
*/
|
||||
return TRUE;
|
||||
}
|
||||
return (*pfndllmain)(hmod, dwReason, NULL);
|
||||
}
|
||||
|
32
third_party/python/PC/generrmap.c
vendored
Normal file
|
@ -0,0 +1,32 @@
|
|||
#include <windows.h>
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
/* Extract the mapping of Win32 error codes to errno */
|
||||
|
||||
int main()
|
||||
{
|
||||
int i;
|
||||
_setmode(fileno(stdout), O_BINARY);
|
||||
printf("/* Generated file. Do not edit. */\n");
|
||||
printf("int winerror_to_errno(int winerror)\n");
|
||||
printf("{\n switch(winerror) {\n");
|
||||
for(i=1; i < 65000; i++) {
|
||||
_dosmaperr(i);
|
||||
if (errno == EINVAL) {
|
||||
/* Issue #12802 */
|
||||
if (i == ERROR_DIRECTORY)
|
||||
errno = ENOTDIR;
|
||||
/* Issue #13063 */
|
||||
else if (i == ERROR_NO_DATA)
|
||||
errno = EPIPE;
|
||||
else
|
||||
continue;
|
||||
}
|
||||
printf(" case %d: return %d;\n", i, errno);
|
||||
}
|
||||
printf(" default: return EINVAL;\n");
|
||||
printf(" }\n}\n");
|
||||
}
|
1038
third_party/python/PC/getpathp.c
vendored
Normal file
BIN
third_party/python/PC/icons/launcher.icns
vendored
Normal file
BIN
third_party/python/PC/icons/launcher.ico
vendored
Normal file
After Width: | Height: | Size: 85 KiB |
1
third_party/python/PC/icons/launcher.svg
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><style>.icon-canvas-transparent{opacity:0;fill:#f6f6f6}.icon-vs-out{fill:#f6f6f6}.icon-white{fill:#fff}.icon-vso-bg{fill:#656565}.icon-visualstudio-online{fill:#007acc}.graph-lightgrey{fill:#dfdfdf}.st0{fill:#0078d7}.st1{fill:#fff}.st2{fill:url(#path1948_1_)}.st3{fill:url(#path1950_1_)}</style><path class="icon-canvas-transparent" d="M32 32H0V0h32v32z" id="canvas"/><g id="iconBg"><path class="icon-visualstudio-online" d="M30 5H5V3h25v2z"/><path class="icon-vso-bg" d="M29.972 26.972H5.029V5h.942v21.028h23.057V5h.943v21.972z"/><path class="icon-vs-out" d="M29 5v21H6V5h23z"/><path class="icon-white" d="M29.141 4l.429.429-.14.142-.43-.43-.43.43-.14-.142.429-.429-.429-.429.141-.142.429.43.43-.43.141.142-.43.429zM27.6 3.4h-1.2v1.2h1.2V3.4zm-1 .2h.8v.8h-.8v-.8zm-1.139.8h-1v.2h1v-.2z"/><path class="graph-lightgrey" d="M6 5h23v2H6z"/></g><g id="iconFg"><path class="st0" d="M4.5 23v6"/><path class="st1" d="M11.429 13.019a19.88 19.88 0 0 0 .071-1.645c0-4.223-1.329-8.165-3.556-10.545L7.17 0H5.83l-.774.829C2.829 3.209 1.5 7.151 1.5 11.374c0 .453.023.9.053 1.345C.887 13.472.357 14.438 0 15.533v6.603L.229 23H3v7h2v2h3v-1h2v-8h2.772l.394-1.488c.222-.842.335-1.714.335-2.592-.001-2.419-.803-4.534-2.072-5.901z"/><path class="st0" d="M6.5 22v9M8.5 23v7"/><path class="icon-visualstudio-online" d="M5 29H4v-6h1v6zm2-6H6v8h1v-8zm2 0H8v7h1v-7z"/><path class="icon-vso-bg" d="M10.381 13.38c.07-.658.119-1.325.119-2.006 0-3.975-1.229-7.662-3.286-9.862L6.5.748l-.714.763C3.729 3.712 2.5 7.399 2.5 11.374c0 .681.049 1.348.119 2.006C1.339 14.521.5 16.552.5 18.92c0 .793.102 1.578.302 2.336L.999 22h1.966l.072-.922c.081-1.046.471-1.966.993-2.503.487 1.019 1.07 1.929 1.756 2.662L6.5 22l.714-.763c.686-.733 1.269-1.643 1.756-2.662.522.537.912 1.457.993 2.503l.072.922h1.966l.197-.744c.2-.758.302-1.543.302-2.336 0-2.368-.839-4.399-2.119-5.54z"/><path class="icon-vs-out" d="M3.619 17.615c-.854.672-1.464 1.913-1.579 3.385h-.272a8.184 8.184 0 0 1-.268-2.08c0-1.722.505-3.259 1.297-4.272.187 1.05.465 2.045.822 2.967zm6.585-2.967a16.145 16.145 0 0 1-.822 2.967c.854.671 1.464 1.913 1.579 3.385h.272a8.184 8.184 0 0 0 .268-2.08c-.001-1.722-.506-3.259-1.297-4.272zM3.5 11.374c0 3.837 1.198 7.2 3 9.128 1.802-1.927 3-5.291 3-9.128s-1.198-7.2-3-9.128c-1.802 1.928-3 5.291-3 9.128z"/><path class="icon-visualstudio-online" d="M7.5 7a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"/></g><g id="colorImportance"><path class="icon-white" d="M31.596 23.961c-.35 1.053-1.001 3.015-3.247 3.015h-1.3v1.337c0 .905-.392 2.537-3.021 3.298a9.213 9.213 0 0 1-2.59.39c-.83 0-1.668-.128-2.564-.392-1.918-.563-3.017-1.765-3.017-3.296v-1.337h-1.155c-1.698 0-2.943-1.129-3.416-3.098-.469-1.946-.469-3.195 0-5.141.451-1.881 1.96-3.098 3.845-3.098h.726v-1.337c0-2.005.905-2.982 3.126-3.374.729-.13 1.549-.2 2.367-.203h.004c.925 0 1.761.067 2.56.201 1.816.303 3.134 1.723 3.134 3.376v1.337h1.3c1.142 0 2.636.536 3.27 3.092.516 2.073.51 3.637-.022 5.23z"/><linearGradient id="path1948_1_" gradientUnits="userSpaceOnUse" x1="522.205" y1="-288.668" x2="540.902" y2="-304.754" gradientTransform="matrix(.5625 0 0 -.568 -282.272 -151.69)"><stop offset="0" stop-color="#5a9fd4"/><stop offset="1" stop-color="#306998"/></linearGradient><path id="path1948_7_" class="st2" d="M21.354 11.725c-.786.004-1.537.071-2.197.188-1.946.344-2.299 1.063-2.299 2.39v1.753h4.598v.584h-6.324c-1.336 0-2.507.803-2.873 2.331-.422 1.751-.441 2.844 0 4.673.327 1.361 1.107 2.331 2.444 2.331h1.581v-2.101c0-1.518 1.313-2.857 2.873-2.857h4.593c1.279 0 2.299-1.053 2.299-2.337v-4.379c0-1.246-1.051-2.182-2.299-2.39-.79-.13-1.61-.189-2.396-.186zm-2.486 1.41c.475 0 .863.394.863.879a.87.87 0 0 1-.863.874.868.868 0 0 1-.863-.874c0-.485.386-.879.863-.879z"/><linearGradient id="path1950_1_" gradientUnits="userSpaceOnUse" x1="548.13" y1="-314.489" x2="541.454" y2="-305.043" gradientTransform="matrix(.5625 0 0 -.568 -282.272 -151.69)"><stop offset="0" stop-color="#ffd43b"/><stop offset="1" stop-color="#ffe873"/></linearGradient><path id="path1950_7_" class="st3" d="M26.623 16.64v2.042c0 1.583-1.342 2.915-2.873 2.915h-4.593c-1.258 0-2.299 1.077-2.299 2.337v4.379c0 1.246 1.084 1.979 2.299 2.337 1.456.428 2.851.505 4.593 0 1.158-.335 2.299-1.01 2.299-2.337V26.56h-4.593v-.584H28.348c1.336 0 1.834-.932 2.299-2.331.48-1.44.46-2.826 0-4.673-.33-1.33-.961-2.331-2.299-2.331h-1.725zm-2.584 11.089c.477 0 .863.391.863.874a.871.871 0 0 1-.863.879.872.872 0 0 1-.863-.879.87.87 0 0 1 .863-.874z"/></g></svg>
|
After Width: | Height: | Size: 4.4 KiB |
BIN
third_party/python/PC/icons/py.icns
vendored
Normal file
BIN
third_party/python/PC/icons/py.ico
vendored
Normal file
After Width: | Height: | Size: 74 KiB |
1
third_party/python/PC/icons/py.svg
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><style>.icon-canvas-transparent{opacity:0;fill:#f6f6f6}.icon-vs-out{fill:#f6f6f6}.icon-vso-bg{fill:#656565}.icon-vso-lightgrey{fill:#bfbfbf}.icon-white{fill:#fff}.st0{fill:url(#path1948_1_)}.st1{fill:url(#path1950_1_)}</style><path class="icon-canvas-transparent" d="M32 32H0V0h32v32z" id="canvas"/><g id="iconBg"><path class="icon-vs-out" d="M26 8.009V29H7V3h14.053L26 8.009z"/><path class="icon-vso-bg" d="M21.471 2H6v28h21V7.599L21.471 2zM21 3h.053l4.939 5H21V3zm5 26H7V3h13v6h6v20z"/></g><path class="icon-vso-lightgrey" d="M17 7H9V6h8v1zm0 2H9v1h8V9zm7 3H9v1h15v-1zm0 3H9v1h15v-1zm0 3H9v1h15v-1zm0 3H9v1h15v-1zm0 3H9v1h15v-1z" id="iconFg"/><g id="colorImportance"><path class="icon-white" d="M31.66 24.063C31.312 25.116 30.661 27 28.413 27H27v1.313c0 .905-.335 2.537-2.965 3.298-.904.261-1.694.389-2.531.389-.83 0-1.63-.128-2.526-.392C17.061 31.045 16 29.844 16 28.313V27h-1.232c-1.699 0-2.944-1.141-3.416-3.11-.469-1.946-.469-3.021 0-4.967.451-1.881 1.96-2.923 3.845-2.923H16v-1.697c0-2.005.866-2.845 3.087-3.238.727-.128 1.506-.065 2.327-.065h.003c.921 0 1.703-.07 2.504.064 1.818.302 3.079 1.585 3.079 3.239V16h1.413c1.142 0 2.636.356 3.27 2.912.515 2.072.509 3.559-.023 5.151z"/><linearGradient id="path1948_1_" gradientUnits="userSpaceOnUse" x1="522.32" y1="-288.668" x2="541.017" y2="-304.754" gradientTransform="matrix(.5625 0 0 -.568 -282.272 -151.69)"><stop offset="0" stop-color="#5a9fd4"/><stop offset="1" stop-color="#306998"/></linearGradient><path id="path1948_2_" class="st0" d="M21.419 11.725c-.786.004-1.537.071-2.197.188-1.946.344-2.299 1.063-2.299 2.39v1.753h4.598v.584h-6.324c-1.336 0-2.507.803-2.873 2.331-.422 1.751-.441 2.844 0 4.673.327 1.361 1.108 2.331 2.444 2.331h1.581v-2.101c0-1.518 1.313-2.857 2.873-2.857h4.593c1.278 0 2.299-1.053 2.299-2.337v-4.379c0-1.246-1.051-2.182-2.299-2.39-.79-.13-1.61-.189-2.396-.186zm-2.487 1.41c.475 0 .863.394.863.879a.87.87 0 0 1-.863.874.868.868 0 0 1-.863-.874c0-.485.387-.879.863-.879z"/><linearGradient id="path1950_1_" gradientUnits="userSpaceOnUse" x1="548.245" y1="-314.489" x2="541.569" y2="-305.043" gradientTransform="matrix(.5625 0 0 -.568 -282.272 -151.69)"><stop offset="0" stop-color="#ffd43b"/><stop offset="1" stop-color="#ffe873"/></linearGradient><path id="path1950_2_" class="st1" d="M26.687 16.64v2.042c0 1.583-1.342 2.915-2.873 2.915h-4.593c-1.258 0-2.299 1.077-2.299 2.337v4.379c0 1.246 1.084 1.979 2.299 2.337 1.456.428 2.851.505 4.593 0 1.158-.335 2.299-1.01 2.299-2.337V26.56H21.52v-.584H28.412c1.336 0 1.834-.932 2.299-2.331.48-1.44.46-2.826 0-4.673-.33-1.33-.961-2.331-2.299-2.331h-1.725zm-2.583 11.089c.477 0 .863.391.863.874a.871.871 0 0 1-.863.879.872.872 0 0 1-.863-.879c0-.484.388-.874.863-.874z"/></g></svg>
|
After Width: | Height: | Size: 2.7 KiB |
BIN
third_party/python/PC/icons/pyc.icns
vendored
Normal file
BIN
third_party/python/PC/icons/pyc.ico
vendored
Normal file
After Width: | Height: | Size: 77 KiB |
1
third_party/python/PC/icons/pyc.svg
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><style>.icon-canvas-transparent{opacity:0;fill:#f6f6f6}.icon-vso-bg{fill:#656565}.icon-vs-bg{fill:#424242}.icon-vs-green{fill:#393}.icon-white{fill:#fff}.st0{fill:url(#path1948_1_)}.st1{fill:url(#path1950_1_)}</style><path class="icon-canvas-transparent" d="M32 32H0V0h32v32z" id="canvas"/><g id="iconBg"><path class="icon-vs-bg" d="M21.053 3H7v26h19V8.009z"/><path class="icon-vso-bg" d="M21.471 2H6v28h21V7.599L21.471 2zM21 3h.053l4.939 5H21V3zm5 26H7V3h13v6h6v20z"/></g><path class="icon-vs-green" d="M10 16H9v-1h1v1zm1.011 5H9v1h2.032a8.368 8.368 0 0 1-.021-1zM14 10h2V9h-2v1zm-3-4H9v1h2V6zm0 6H9v1h2v-1zm2-3H9v1h4V9zm4-3v1h1V6h-1zm-3 6h-2v1h2v-1zm1-6h-2v1h2V6zm-4 10h1v-1h-1v1zm4-4v1h2v-1h-2zm-2 4h3v-1h-3v1zm-4 2v1h3v-1H9zm0 6v1h3v-1H9z" id="iconFg"/><g id="colorImportance"><path class="icon-white" d="M31.66 24.063C31.312 25.116 30.661 27 28.413 27H27v1.313c0 .905-.335 2.537-2.965 3.298-.904.261-1.694.389-2.531.389-.83 0-1.63-.128-2.526-.392C17.061 31.045 16 29.844 16 28.313V27h-1.232c-1.699 0-2.944-1.141-3.416-3.11-.469-1.946-.469-3.021 0-4.967.451-1.881 1.96-2.923 3.845-2.923H16v-1.697c0-2.005.866-2.845 3.087-3.238.727-.128 1.506-.065 2.327-.065h.003c.921 0 1.703-.07 2.504.064 1.818.302 3.079 1.585 3.079 3.239V16h1.413c1.142 0 2.636.356 3.27 2.912.515 2.072.509 3.558-.023 5.151z"/><linearGradient id="path1948_1_" gradientUnits="userSpaceOnUse" x1="522.32" y1="-288.668" x2="541.017" y2="-304.754" gradientTransform="matrix(.5625 0 0 -.568 -282.272 -151.69)"><stop offset="0" stop-color="#5a9fd4"/><stop offset="1" stop-color="#306998"/></linearGradient><path id="path1948_4_" class="st0" d="M21.419 11.725c-.786.004-1.537.071-2.197.188-1.946.344-2.299 1.063-2.299 2.39v1.753h4.598v.584h-6.324c-1.336 0-2.507.803-2.873 2.331-.422 1.751-.441 2.844 0 4.673.327 1.361 1.108 2.331 2.444 2.331h1.581v-2.101c0-1.518 1.313-2.857 2.873-2.857h4.593c1.278 0 2.299-1.053 2.299-2.337v-4.379c0-1.246-1.051-2.182-2.299-2.39-.79-.13-1.61-.189-2.396-.186zm-2.487 1.41c.475 0 .863.394.863.879a.87.87 0 0 1-.863.874.868.868 0 0 1-.863-.874c0-.485.387-.879.863-.879z"/><linearGradient id="path1950_1_" gradientUnits="userSpaceOnUse" x1="548.245" y1="-314.489" x2="541.569" y2="-305.043" gradientTransform="matrix(.5625 0 0 -.568 -282.272 -151.69)"><stop offset="0" stop-color="#ffd43b"/><stop offset="1" stop-color="#ffe873"/></linearGradient><path id="path1950_4_" class="st1" d="M26.687 16.64v2.042c0 1.583-1.342 2.915-2.873 2.915h-4.593c-1.258 0-2.299 1.077-2.299 2.337v4.379c0 1.246 1.084 1.979 2.299 2.337 1.456.428 2.851.505 4.593 0 1.158-.335 2.299-1.01 2.299-2.337V26.56H21.52v-.584H28.412c1.336 0 1.834-.932 2.299-2.331.48-1.44.46-2.826 0-4.673-.33-1.33-.961-2.331-2.299-2.331h-1.725zm-2.583 11.089c.477 0 .863.391.863.874a.871.871 0 0 1-.863.879.872.872 0 0 1-.863-.879c0-.484.388-.874.863-.874z"/></g></svg>
|
After Width: | Height: | Size: 2.8 KiB |
BIN
third_party/python/PC/icons/pyd.icns
vendored
Normal file
BIN
third_party/python/PC/icons/pyd.ico
vendored
Normal file
After Width: | Height: | Size: 81 KiB |
1
third_party/python/PC/icons/pyd.svg
vendored
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
third_party/python/PC/icons/python.icns
vendored
Normal file
BIN
third_party/python/PC/icons/python.ico
vendored
Normal file
After Width: | Height: | Size: 76 KiB |
1
third_party/python/PC/icons/python.svg
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><style>.icon-canvas-transparent{opacity:0;fill:#f6f6f6}.icon-white{fill:#fff}.icon-vso-bg{fill:#656565}.icon-visualstudio-online{fill:#007acc}.icon-vs-bg{fill:#424242}.icon-vs-green{fill:#393}.st0{fill:url(#path1948_1_)}.st1{fill:url(#path1950_1_)}</style><path class="icon-canvas-transparent" d="M32 32H0V0h32v32z" id="canvas"/><g id="iconBg"><path class="icon-visualstudio-online" d="M30 4H2V2h28v2z"/><path class="icon-vso-bg" d="M29 4v21H3V4H2v22h28V4z"/><path class="icon-vs-bg" d="M10 4H3v21h26V4z"/></g><g id="iconFg"><path class="icon-white" d="M29.141 3l.429.429-.14.142-.43-.43-.43.43-.14-.142.429-.429-.429-.429.141-.142.429.43.43-.43.141.142-.43.429zM27.6 2.4h-1.2v1.2h1.2V2.4zm-1 .2h.8v.8h-.8v-.8zm-1.139.8h-1v.2h1v-.2z"/><path class="icon-vs-green" d="M16 14H5v-1h11.031c-.014.044-.031 1-.031 1zm-4-5H5v1h7V9zm-7 8v1h8v-1H5z"/></g><g id="colorImportance"><path class="icon-white" d="M31.596 24.063C31.246 25.116 30.595 27 28.349 27H27v1.313c0 .905-.368 2.537-2.996 3.298-.904.261-1.728.389-2.566.389-.83 0-1.597-.128-2.492-.392C17.029 31.045 16 29.844 16 28.313V27h-1.297c-1.698 0-2.943-1.141-3.416-3.11-.469-1.946-.469-3.021 0-4.967.451-1.881 1.96-2.923 3.845-2.923H16v-1.697c0-2.005.834-2.845 3.054-3.238.728-.128 1.474-.065 2.296-.065h.003c.921 0 1.735-.07 2.537.064 1.816.303 3.11 1.585 3.11 3.24V16h1.349c1.142 0 2.636.356 3.27 2.912.515 2.072.509 3.558-.023 5.151z"/><linearGradient id="path1948_1_" gradientUnits="userSpaceOnUse" x1="522.205" y1="-288.668" x2="540.902" y2="-304.754" gradientTransform="matrix(.5625 0 0 -.568 -282.272 -151.69)"><stop offset="0" stop-color="#5a9fd4"/><stop offset="1" stop-color="#306998"/></linearGradient><path id="path1948_3_" class="st0" d="M21.354 11.725c-.786.004-1.537.071-2.197.188-1.946.344-2.299 1.063-2.299 2.39v1.753h4.598v.584h-6.324c-1.336 0-2.507.803-2.873 2.331-.422 1.751-.441 2.844 0 4.673.327 1.361 1.107 2.331 2.444 2.331h1.581v-2.101c0-1.518 1.313-2.857 2.873-2.857h4.593c1.279 0 2.299-1.053 2.299-2.337v-4.379c0-1.246-1.051-2.182-2.299-2.39-.79-.13-1.61-.189-2.396-.186zm-2.486 1.41c.475 0 .863.394.863.879a.87.87 0 0 1-.863.874.868.868 0 0 1-.863-.874c0-.485.386-.879.863-.879z"/><linearGradient id="path1950_1_" gradientUnits="userSpaceOnUse" x1="548.13" y1="-314.489" x2="541.454" y2="-305.043" gradientTransform="matrix(.5625 0 0 -.568 -282.272 -151.69)"><stop offset="0" stop-color="#ffd43b"/><stop offset="1" stop-color="#ffe873"/></linearGradient><path id="path1950_3_" class="st1" d="M26.623 16.64v2.042c0 1.583-1.342 2.915-2.873 2.915h-4.593c-1.258 0-2.299 1.077-2.299 2.337v4.379c0 1.246 1.084 1.979 2.299 2.337 1.456.428 2.851.505 4.593 0 1.158-.335 2.299-1.01 2.299-2.337V26.56h-4.593v-.584h6.892c1.336 0 1.834-.932 2.299-2.331.48-1.44.46-2.826 0-4.673-.33-1.33-.961-2.331-2.299-2.331h-1.725zm-2.584 11.089c.477 0 .863.391.863.874a.871.871 0 0 1-.863.879.872.872 0 0 1-.863-.879.87.87 0 0 1 .863-.874z"/></g></svg>
|
After Width: | Height: | Size: 2.9 KiB |
BIN
third_party/python/PC/icons/pythonw.icns
vendored
Normal file
BIN
third_party/python/PC/icons/pythonw.ico
vendored
Normal file
After Width: | Height: | Size: 74 KiB |
1
third_party/python/PC/icons/pythonw.svg
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><style>.icon-canvas-transparent{opacity:0;fill:#f6f6f6}.icon-white{fill:#fff}.icon-visualstudio-online{fill:#007acc}.graph-lightgrey{fill:#dfdfdf}.st0{fill:#f6f6f6}.st1{fill:#656565}.st2{fill:#bfbfbf}.st3{fill:#fff}.st4{fill:url(#path1948_1_)}.st5{fill:url(#path1950_1_)}</style><path class="icon-canvas-transparent" d="M32 32H0V0h32v32z" id="canvas"/><g id="iconBg"><path class="graph-lightgrey" d="M29 7H3V5h26v2z"/><path class="icon-visualstudio-online" d="M30 5H2V3h28v2z"/><path class="icon-white" d="M29.141 4l.429.429-.14.142-.43-.43-.43.43-.14-.142.429-.429-.429-.429.141-.142.429.43.43-.43.141.142-.43.429zM27.6 3.4h-1.2v1.2h1.2V3.4zm-1 .2h.8v.8h-.8v-.8zm-1.139.8h-1v.2h1v-.2z"/><path class="st0" d="M3 7h26v19H3z"/><path class="st1" d="M29 5v21H3V5H2v22h28V5z"/><path class="st1" d="M4 5.75h2v.5H4z"/></g><path class="st2" d="M12 11H5v-1h7v1zm-7 7v1h11v-1H5zm0-4v1h11v-1H5z" id="iconFg"/><g id="colorImportance"><path class="st3" d="M31.618 18.912C30.984 16.356 29.49 16 28.349 16H27v-1.697c0-1.654-1.294-2.937-3.11-3.24-.802-.133-1.617-.063-2.537-.063h-.003c-.821 0-1.568-.063-2.295.065-2.221.393-3.055 1.233-3.055 3.238V16h-.868c-1.885 0-3.394 1.042-3.845 2.924-.469 1.946-.469 3.022 0 4.967C11.76 25.859 13.005 27 14.703 27H16v1.313c0 1.531 1.029 2.732 2.946 3.296.896.263 1.662.391 2.492.391.838 0 1.661-.128 2.565-.39C26.632 30.85 27 29.218 27 28.313V27h1.349c2.246 0 2.897-1.884 3.247-2.937.532-1.592.538-3.079.022-5.151z"/><linearGradient id="path1948_1_" gradientUnits="userSpaceOnUse" x1="522.205" y1="-288.668" x2="540.902" y2="-304.754" gradientTransform="matrix(.5625 0 0 -.568 -282.272 -151.69)"><stop offset="0" stop-color="#5a9fd4"/><stop offset="1" stop-color="#306998"/></linearGradient><path id="path1948_6_" class="st4" d="M21.354 11.725c-.786.004-1.537.071-2.197.188-1.946.344-2.299 1.063-2.299 2.39v1.753h4.598v.584h-6.324c-1.336 0-2.507.803-2.873 2.331-.422 1.751-.441 2.844 0 4.673.327 1.361 1.107 2.331 2.444 2.331h1.581v-2.101c0-1.518 1.313-2.857 2.873-2.857h4.593c1.278 0 2.299-1.053 2.299-2.337v-4.379c0-1.246-1.051-2.182-2.299-2.39-.79-.13-1.61-.189-2.396-.186zm-2.486 1.41c.475 0 .863.394.863.879a.87.87 0 0 1-.863.874.868.868 0 0 1-.863-.874c0-.485.386-.879.863-.879z"/><linearGradient id="path1950_1_" gradientUnits="userSpaceOnUse" x1="548.13" y1="-314.489" x2="541.454" y2="-305.043" gradientTransform="matrix(.5625 0 0 -.568 -282.272 -151.69)"><stop offset="0" stop-color="#ffd43b"/><stop offset="1" stop-color="#ffe873"/></linearGradient><path id="path1950_6_" class="st5" d="M26.623 16.64v2.042c0 1.583-1.342 2.915-2.873 2.915h-4.593c-1.258 0-2.299 1.077-2.299 2.337v4.379c0 1.246 1.084 1.979 2.299 2.337 1.456.428 2.851.505 4.593 0 1.158-.335 2.299-1.01 2.299-2.337V26.56h-4.593v-.584h6.892c1.336 0 1.834-.932 2.299-2.331.48-1.44.46-2.826 0-4.673-.33-1.33-.961-2.331-2.299-2.331h-1.725zm-2.584 11.089c.477 0 .863.391.863.874a.871.871 0 0 1-.863.879.872.872 0 0 1-.863-.879.87.87 0 0 1 .863-.874z"/></g></svg>
|
After Width: | Height: | Size: 2.9 KiB |
BIN
third_party/python/PC/icons/setup.icns
vendored
Normal file
BIN
third_party/python/PC/icons/setup.ico
vendored
Normal file
After Width: | Height: | Size: 76 KiB |
1
third_party/python/PC/icons/setup.svg
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><style>.icon-canvas-transparent{opacity:0;fill:#f6f6f6}.icon-visualstudio-online{fill:#007acc}.icon-disabled-grey{fill:#848484}.icon-white{fill:#fff}.st0{fill:#f0eff1}.st1{fill:#424242}.st2{fill:url(#path1948_1_)}.st3{fill:url(#path1950_1_)}</style><path class="icon-canvas-transparent" d="M32 32H0V0h32v32z" id="canvas"/><g id="iconBg"><path class="st0" d="M18 8v10H1V8h17zm-1.191 15.572a1.004 1.004 0 0 0-.903-.572H2.907c-.385 0-.74.225-.903.572L.886 25.928A.748.748 0 0 0 1.563 27H17.25a.748.748 0 0 0 .677-1.072l-1.118-2.356z"/><path class="icon-disabled-grey" d="M17.927 25.929l-1.118-2.356a1.003 1.003 0 0 0-.903-.573H2.907c-.385 0-.74.225-.903.572L.886 25.928A.748.748 0 0 0 1.563 27H17.25a.747.747 0 0 0 .633-.349.746.746 0 0 0 .044-.722zM1.959 26l.949-2h12.998l.949 2H1.959zM6 22v-1h3v-2h1v2h3v1H6z"/><path class="st1" d="M0 7v12h19V7H0zm18 11H1V8h17v10z"/></g><g id="iconFg"><path class="icon-white" d="M12 6V0H7v6H2.755L9.5 13.495 16.245 6z"/><path class="icon-visualstudio-online" d="M8 4h3v3h3l-4.5 5L5 7h3V4zm3-2H8v1h3V2zm0-2H8v1h3V0z"/></g><g id="colorImportance"><path class="icon-white" d="M31.596 24.063C31.246 25.116 30.595 27 28.349 27H27v1.313c0 .905-.368 2.537-2.997 3.298-.903.261-1.727.389-2.565.389-.83 0-1.597-.128-2.493-.392C17.029 31.045 16 29.844 16 28.313V27h-1.296c-1.698 0-2.944-1.141-3.417-3.11-.469-1.944-.469-3.02 0-4.967.451-1.881 1.961-2.923 3.845-2.923H16v-1.697c0-2.005.834-2.845 3.054-3.238.728-.128 1.474-.065 2.296-.065h.003c.921 0 1.735-.07 2.537.064 1.816.303 3.11 1.585 3.11 3.24V16h1.349c1.142 0 2.636.356 3.27 2.912.515 2.072.509 3.559-.023 5.151z"/><linearGradient id="path1948_1_" gradientUnits="userSpaceOnUse" x1="522.205" y1="-288.668" x2="540.902" y2="-304.754" gradientTransform="matrix(.5625 0 0 -.568 -282.272 -151.69)"><stop offset="0" stop-color="#5a9fd4"/><stop offset="1" stop-color="#306998"/></linearGradient><path id="path1948_9_" class="st2" d="M21.354 11.725c-.786.004-1.537.071-2.197.188-1.946.344-2.299 1.063-2.299 2.39v1.753h4.598v.584h-6.324c-1.336 0-2.507.803-2.873 2.331-.422 1.751-.441 2.844 0 4.673.327 1.361 1.108 2.331 2.444 2.331h1.581v-2.101c0-1.518 1.313-2.857 2.873-2.857h4.593c1.279 0 2.299-1.053 2.299-2.337v-4.379c0-1.246-1.051-2.182-2.299-2.39-.79-.13-1.61-.189-2.396-.186zm-2.486 1.41c.475 0 .863.394.863.879a.87.87 0 0 1-.863.874.868.868 0 0 1-.863-.874c0-.485.386-.879.863-.879z"/><linearGradient id="path1950_1_" gradientUnits="userSpaceOnUse" x1="548.13" y1="-314.489" x2="541.454" y2="-305.043" gradientTransform="matrix(.5625 0 0 -.568 -282.272 -151.69)"><stop offset="0" stop-color="#ffd43b"/><stop offset="1" stop-color="#ffe873"/></linearGradient><path id="path1950_9_" class="st3" d="M26.623 16.64v2.042c0 1.583-1.342 2.915-2.873 2.915h-4.593c-1.258 0-2.299 1.077-2.299 2.337v4.379c0 1.246 1.084 1.979 2.299 2.337 1.456.428 2.851.505 4.593 0 1.158-.335 2.299-1.01 2.299-2.337V26.56h-4.593v-.584H28.348c1.336 0 1.834-.932 2.299-2.331.48-1.44.46-2.826 0-4.673-.33-1.33-.961-2.331-2.299-2.331h-1.725zm-2.584 11.089c.477 0 .863.391.863.874a.871.871 0 0 1-.863.879.872.872 0 0 1-.863-.879.87.87 0 0 1 .863-.874z"/></g></svg>
|
After Width: | Height: | Size: 3.1 KiB |
22
third_party/python/PC/invalid_parameter_handler.c
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
#ifdef _MSC_VER
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#if _MSC_VER >= 1900
|
||||
/* pyconfig.h uses this function in the _Py_BEGIN/END_SUPPRESS_IPH
|
||||
* macros. It does not need to be defined when building using MSVC
|
||||
* earlier than 14.0 (_MSC_VER == 1900).
|
||||
*/
|
||||
|
||||
static void __cdecl _silent_invalid_parameter_handler(
|
||||
wchar_t const* expression,
|
||||
wchar_t const* function,
|
||||
wchar_t const* file,
|
||||
unsigned int line,
|
||||
uintptr_t pReserved) { }
|
||||
|
||||
_invalid_parameter_handler _Py_silent_invalid_parameter_handler = _silent_invalid_parameter_handler;
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
1575
third_party/python/PC/launcher.c
vendored
Normal file
606
third_party/python/PC/msvcrtmodule.c
vendored
Normal file
|
@ -0,0 +1,606 @@
|
|||
/*********************************************************
|
||||
|
||||
msvcrtmodule.c
|
||||
|
||||
A Python interface to the Microsoft Visual C Runtime
|
||||
Library, providing access to those non-portable, but
|
||||
still useful routines.
|
||||
|
||||
Only ever compiled with an MS compiler, so no attempt
|
||||
has been made to avoid MS language extensions, etc...
|
||||
|
||||
This may only work on NT or 95...
|
||||
|
||||
Author: Mark Hammond and Guido van Rossum.
|
||||
Maintenance: Guido van Rossum.
|
||||
|
||||
***********************************************************/
|
||||
|
||||
#include "Python.h"
|
||||
#include "malloc.h"
|
||||
#include <io.h>
|
||||
#include <conio.h>
|
||||
#include <sys/locking.h>
|
||||
#include <crtdbg.h>
|
||||
#include <windows.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#if _MSC_VER >= 1500 && _MSC_VER < 1600
|
||||
#include <crtassem.h>
|
||||
#elif _MSC_VER >= 1600
|
||||
#include <crtversion.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*[python input]
|
||||
class intptr_t_converter(CConverter):
|
||||
type = 'intptr_t'
|
||||
format_unit = '"_Py_PARSE_INTPTR"'
|
||||
|
||||
class handle_return_converter(long_return_converter):
|
||||
type = 'intptr_t'
|
||||
cast = '(void *)'
|
||||
conversion_fn = 'PyLong_FromVoidPtr'
|
||||
|
||||
class byte_char_return_converter(CReturnConverter):
|
||||
type = 'int'
|
||||
|
||||
def render(self, function, data):
|
||||
data.declarations.append('char s[1];')
|
||||
data.return_value = 's[0]'
|
||||
data.return_conversion.append(
|
||||
'return_value = PyBytes_FromStringAndSize(s, 1);\n')
|
||||
|
||||
class wchar_t_return_converter(CReturnConverter):
|
||||
type = 'wchar_t'
|
||||
|
||||
def render(self, function, data):
|
||||
self.declare(data)
|
||||
data.return_conversion.append(
|
||||
'return_value = PyUnicode_FromOrdinal(_return_value);\n')
|
||||
[python start generated code]*/
|
||||
/*[python end generated code: output=da39a3ee5e6b4b0d input=b59f1663dba11997]*/
|
||||
|
||||
/*[clinic input]
|
||||
module msvcrt
|
||||
[clinic start generated code]*/
|
||||
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=f31a87a783d036cd]*/
|
||||
|
||||
#include "clinic/msvcrtmodule.c.h"
|
||||
|
||||
/*[clinic input]
|
||||
msvcrt.heapmin
|
||||
|
||||
Minimize the malloc() heap.
|
||||
|
||||
Force the malloc() heap to clean itself up and return unused blocks
|
||||
to the operating system. On failure, this raises OSError.
|
||||
[clinic start generated code]*/
|
||||
|
||||
static PyObject *
|
||||
msvcrt_heapmin_impl(PyObject *module)
|
||||
/*[clinic end generated code: output=1ba00f344782dc19 input=82e1771d21bde2d8]*/
|
||||
{
|
||||
if (_heapmin() != 0)
|
||||
return PyErr_SetFromErrno(PyExc_IOError);
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
/*[clinic input]
|
||||
msvcrt.locking
|
||||
|
||||
fd: int
|
||||
mode: int
|
||||
nbytes: long
|
||||
/
|
||||
|
||||
Lock part of a file based on file descriptor fd from the C runtime.
|
||||
|
||||
Raises IOError on failure. The locked region of the file extends from
|
||||
the current file position for nbytes bytes, and may continue beyond
|
||||
the end of the file. mode must be one of the LK_* constants listed
|
||||
below. Multiple regions in a file may be locked at the same time, but
|
||||
may not overlap. Adjacent regions are not merged; they must be unlocked
|
||||
individually.
|
||||
[clinic start generated code]*/
|
||||
|
||||
static PyObject *
|
||||
msvcrt_locking_impl(PyObject *module, int fd, int mode, long nbytes)
|
||||
/*[clinic end generated code: output=a4a90deca9785a03 input=d9f13f0f6a713ba7]*/
|
||||
{
|
||||
int err;
|
||||
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
_Py_BEGIN_SUPPRESS_IPH
|
||||
err = _locking(fd, mode, nbytes);
|
||||
_Py_END_SUPPRESS_IPH
|
||||
Py_END_ALLOW_THREADS
|
||||
if (err != 0)
|
||||
return PyErr_SetFromErrno(PyExc_IOError);
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
msvcrt.setmode -> long
|
||||
|
||||
fd: int
|
||||
mode as flags: int
|
||||
/
|
||||
|
||||
Set the line-end translation mode for the file descriptor fd.
|
||||
|
||||
To set it to text mode, flags should be os.O_TEXT; for binary, it
|
||||
should be os.O_BINARY.
|
||||
|
||||
Return value is the previous mode.
|
||||
[clinic start generated code]*/
|
||||
|
||||
static long
|
||||
msvcrt_setmode_impl(PyObject *module, int fd, int flags)
|
||||
/*[clinic end generated code: output=24a9be5ea07ccb9b input=76e7c01f6b137f75]*/
|
||||
{
|
||||
_Py_BEGIN_SUPPRESS_IPH
|
||||
flags = _setmode(fd, flags);
|
||||
_Py_END_SUPPRESS_IPH
|
||||
if (flags == -1)
|
||||
PyErr_SetFromErrno(PyExc_IOError);
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
msvcrt.open_osfhandle -> long
|
||||
|
||||
handle: intptr_t
|
||||
flags: int
|
||||
/
|
||||
|
||||
Create a C runtime file descriptor from the file handle handle.
|
||||
|
||||
The flags parameter should be a bitwise OR of os.O_APPEND, os.O_RDONLY,
|
||||
and os.O_TEXT. The returned file descriptor may be used as a parameter
|
||||
to os.fdopen() to create a file object.
|
||||
[clinic start generated code]*/
|
||||
|
||||
static long
|
||||
msvcrt_open_osfhandle_impl(PyObject *module, intptr_t handle, int flags)
|
||||
/*[clinic end generated code: output=cede871bf939d6e3 input=cb2108bbea84514e]*/
|
||||
{
|
||||
int fd;
|
||||
|
||||
_Py_BEGIN_SUPPRESS_IPH
|
||||
fd = _open_osfhandle(handle, flags);
|
||||
_Py_END_SUPPRESS_IPH
|
||||
if (fd == -1)
|
||||
PyErr_SetFromErrno(PyExc_IOError);
|
||||
|
||||
return fd;
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
msvcrt.get_osfhandle -> handle
|
||||
|
||||
fd: int
|
||||
/
|
||||
|
||||
Return the file handle for the file descriptor fd.
|
||||
|
||||
Raises IOError if fd is not recognized.
|
||||
[clinic start generated code]*/
|
||||
|
||||
static intptr_t
|
||||
msvcrt_get_osfhandle_impl(PyObject *module, int fd)
|
||||
/*[clinic end generated code: output=7ce761dd0de2b503 input=c7d18d02c8017ec1]*/
|
||||
{
|
||||
intptr_t handle = -1;
|
||||
|
||||
_Py_BEGIN_SUPPRESS_IPH
|
||||
handle = _get_osfhandle(fd);
|
||||
_Py_END_SUPPRESS_IPH
|
||||
if (handle == -1)
|
||||
PyErr_SetFromErrno(PyExc_IOError);
|
||||
|
||||
return handle;
|
||||
}
|
||||
|
||||
/* Console I/O */
|
||||
/*[clinic input]
|
||||
msvcrt.kbhit -> long
|
||||
|
||||
Return true if a keypress is waiting to be read.
|
||||
[clinic start generated code]*/
|
||||
|
||||
static long
|
||||
msvcrt_kbhit_impl(PyObject *module)
|
||||
/*[clinic end generated code: output=940dfce6587c1890 input=e70d678a5c2f6acc]*/
|
||||
{
|
||||
return _kbhit();
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
msvcrt.getch -> byte_char
|
||||
|
||||
Read a keypress and return the resulting character as a byte string.
|
||||
|
||||
Nothing is echoed to the console. This call will block if a keypress is
|
||||
not already available, but will not wait for Enter to be pressed. If the
|
||||
pressed key was a special function key, this will return '\000' or
|
||||
'\xe0'; the next call will return the keycode. The Control-C keypress
|
||||
cannot be read with this function.
|
||||
[clinic start generated code]*/
|
||||
|
||||
static int
|
||||
msvcrt_getch_impl(PyObject *module)
|
||||
/*[clinic end generated code: output=a4e51f0565064a7d input=37a40cf0ed0d1153]*/
|
||||
{
|
||||
int ch;
|
||||
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
ch = _getch();
|
||||
Py_END_ALLOW_THREADS
|
||||
return ch;
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
msvcrt.getwch -> wchar_t
|
||||
|
||||
Wide char variant of getch(), returning a Unicode value.
|
||||
[clinic start generated code]*/
|
||||
|
||||
static wchar_t
|
||||
msvcrt_getwch_impl(PyObject *module)
|
||||
/*[clinic end generated code: output=be9937494e22f007 input=27b3dec8ad823d7c]*/
|
||||
{
|
||||
wchar_t ch;
|
||||
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
ch = _getwch();
|
||||
Py_END_ALLOW_THREADS
|
||||
return ch;
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
msvcrt.getche -> byte_char
|
||||
|
||||
Similar to getch(), but the keypress will be echoed if possible.
|
||||
[clinic start generated code]*/
|
||||
|
||||
static int
|
||||
msvcrt_getche_impl(PyObject *module)
|
||||
/*[clinic end generated code: output=d8f7db4fd2990401 input=43311ade9ed4a9c0]*/
|
||||
{
|
||||
int ch;
|
||||
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
ch = _getche();
|
||||
Py_END_ALLOW_THREADS
|
||||
return ch;
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
msvcrt.getwche -> wchar_t
|
||||
|
||||
Wide char variant of getche(), returning a Unicode value.
|
||||
[clinic start generated code]*/
|
||||
|
||||
static wchar_t
|
||||
msvcrt_getwche_impl(PyObject *module)
|
||||
/*[clinic end generated code: output=d0dae5ba3829d596 input=49337d59d1a591f8]*/
|
||||
{
|
||||
wchar_t ch;
|
||||
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
ch = _getwche();
|
||||
Py_END_ALLOW_THREADS
|
||||
return ch;
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
msvcrt.putch
|
||||
|
||||
char: char
|
||||
/
|
||||
|
||||
Print the byte string char to the console without buffering.
|
||||
[clinic start generated code]*/
|
||||
|
||||
static PyObject *
|
||||
msvcrt_putch_impl(PyObject *module, char char_value)
|
||||
/*[clinic end generated code: output=92ec9b81012d8f60 input=ec078dd10cb054d6]*/
|
||||
{
|
||||
_Py_BEGIN_SUPPRESS_IPH
|
||||
_putch(char_value);
|
||||
_Py_END_SUPPRESS_IPH
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
msvcrt.putwch
|
||||
|
||||
unicode_char: int(accept={str})
|
||||
/
|
||||
|
||||
Wide char variant of putch(), accepting a Unicode value.
|
||||
[clinic start generated code]*/
|
||||
|
||||
static PyObject *
|
||||
msvcrt_putwch_impl(PyObject *module, int unicode_char)
|
||||
/*[clinic end generated code: output=a3bd1a8951d28eee input=996ccd0bbcbac4c3]*/
|
||||
{
|
||||
_Py_BEGIN_SUPPRESS_IPH
|
||||
_putwch(unicode_char);
|
||||
_Py_END_SUPPRESS_IPH
|
||||
Py_RETURN_NONE;
|
||||
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
msvcrt.ungetch
|
||||
|
||||
char: char
|
||||
/
|
||||
|
||||
Opposite of getch.
|
||||
|
||||
Cause the byte string char to be "pushed back" into the
|
||||
console buffer; it will be the next character read by
|
||||
getch() or getche().
|
||||
[clinic start generated code]*/
|
||||
|
||||
static PyObject *
|
||||
msvcrt_ungetch_impl(PyObject *module, char char_value)
|
||||
/*[clinic end generated code: output=c6942a0efa119000 input=22f07ee9001bbf0f]*/
|
||||
{
|
||||
int res;
|
||||
|
||||
_Py_BEGIN_SUPPRESS_IPH
|
||||
res = _ungetch(char_value);
|
||||
_Py_END_SUPPRESS_IPH
|
||||
|
||||
if (res == EOF)
|
||||
return PyErr_SetFromErrno(PyExc_IOError);
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
msvcrt.ungetwch
|
||||
|
||||
unicode_char: int(accept={str})
|
||||
/
|
||||
|
||||
Wide char variant of ungetch(), accepting a Unicode value.
|
||||
[clinic start generated code]*/
|
||||
|
||||
static PyObject *
|
||||
msvcrt_ungetwch_impl(PyObject *module, int unicode_char)
|
||||
/*[clinic end generated code: output=e63af05438b8ba3d input=83ec0492be04d564]*/
|
||||
{
|
||||
int res;
|
||||
|
||||
_Py_BEGIN_SUPPRESS_IPH
|
||||
res = _ungetwch(unicode_char);
|
||||
_Py_END_SUPPRESS_IPH
|
||||
|
||||
if (res == WEOF)
|
||||
return PyErr_SetFromErrno(PyExc_IOError);
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
/*[clinic input]
|
||||
msvcrt.CrtSetReportFile -> long
|
||||
|
||||
type: int
|
||||
file: int
|
||||
/
|
||||
|
||||
Wrapper around _CrtSetReportFile.
|
||||
|
||||
Only available on Debug builds.
|
||||
[clinic start generated code]*/
|
||||
|
||||
static long
|
||||
msvcrt_CrtSetReportFile_impl(PyObject *module, int type, int file)
|
||||
/*[clinic end generated code: output=df291c7fe032eb68 input=bb8f721a604fcc45]*/
|
||||
{
|
||||
long res;
|
||||
|
||||
_Py_BEGIN_SUPPRESS_IPH
|
||||
res = (long)_CrtSetReportFile(type, (_HFILE)file);
|
||||
_Py_END_SUPPRESS_IPH
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
msvcrt.CrtSetReportMode -> long
|
||||
|
||||
type: int
|
||||
mode: int
|
||||
/
|
||||
|
||||
Wrapper around _CrtSetReportMode.
|
||||
|
||||
Only available on Debug builds.
|
||||
[clinic start generated code]*/
|
||||
|
||||
static long
|
||||
msvcrt_CrtSetReportMode_impl(PyObject *module, int type, int mode)
|
||||
/*[clinic end generated code: output=b2863761523de317 input=9319d29b4319426b]*/
|
||||
{
|
||||
int res;
|
||||
|
||||
_Py_BEGIN_SUPPRESS_IPH
|
||||
res = _CrtSetReportMode(type, mode);
|
||||
_Py_END_SUPPRESS_IPH
|
||||
if (res == -1)
|
||||
PyErr_SetFromErrno(PyExc_IOError);
|
||||
return res;
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
msvcrt.set_error_mode -> long
|
||||
|
||||
mode: int
|
||||
/
|
||||
|
||||
Wrapper around _set_error_mode.
|
||||
|
||||
Only available on Debug builds.
|
||||
[clinic start generated code]*/
|
||||
|
||||
static long
|
||||
msvcrt_set_error_mode_impl(PyObject *module, int mode)
|
||||
/*[clinic end generated code: output=ac4a09040d8ac4e3 input=046fca59c0f20872]*/
|
||||
{
|
||||
long res;
|
||||
|
||||
_Py_BEGIN_SUPPRESS_IPH
|
||||
res = _set_error_mode(mode);
|
||||
_Py_END_SUPPRESS_IPH
|
||||
|
||||
return res;
|
||||
}
|
||||
#endif /* _DEBUG */
|
||||
|
||||
/*[clinic input]
|
||||
msvcrt.SetErrorMode
|
||||
|
||||
mode: unsigned_int(bitwise=True)
|
||||
/
|
||||
|
||||
Wrapper around SetErrorMode.
|
||||
[clinic start generated code]*/
|
||||
|
||||
static PyObject *
|
||||
msvcrt_SetErrorMode_impl(PyObject *module, unsigned int mode)
|
||||
/*[clinic end generated code: output=01d529293f00da8f input=d8b167258d32d907]*/
|
||||
{
|
||||
unsigned int res;
|
||||
|
||||
_Py_BEGIN_SUPPRESS_IPH
|
||||
res = SetErrorMode(mode);
|
||||
_Py_END_SUPPRESS_IPH
|
||||
|
||||
return PyLong_FromUnsignedLong(res);
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
[clinic start generated code]*/
|
||||
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=da39a3ee5e6b4b0d]*/
|
||||
|
||||
/* List of functions exported by this module */
|
||||
static struct PyMethodDef msvcrt_functions[] = {
|
||||
MSVCRT_HEAPMIN_METHODDEF
|
||||
MSVCRT_LOCKING_METHODDEF
|
||||
MSVCRT_SETMODE_METHODDEF
|
||||
MSVCRT_OPEN_OSFHANDLE_METHODDEF
|
||||
MSVCRT_GET_OSFHANDLE_METHODDEF
|
||||
MSVCRT_KBHIT_METHODDEF
|
||||
MSVCRT_GETCH_METHODDEF
|
||||
MSVCRT_GETCHE_METHODDEF
|
||||
MSVCRT_PUTCH_METHODDEF
|
||||
MSVCRT_UNGETCH_METHODDEF
|
||||
MSVCRT_SETERRORMODE_METHODDEF
|
||||
MSVCRT_CRTSETREPORTFILE_METHODDEF
|
||||
MSVCRT_CRTSETREPORTMODE_METHODDEF
|
||||
MSVCRT_SET_ERROR_MODE_METHODDEF
|
||||
MSVCRT_GETWCH_METHODDEF
|
||||
MSVCRT_GETWCHE_METHODDEF
|
||||
MSVCRT_PUTWCH_METHODDEF
|
||||
MSVCRT_UNGETWCH_METHODDEF
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
|
||||
static struct PyModuleDef msvcrtmodule = {
|
||||
PyModuleDef_HEAD_INIT,
|
||||
"msvcrt",
|
||||
NULL,
|
||||
-1,
|
||||
msvcrt_functions,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
static void
|
||||
insertint(PyObject *d, char *name, int value)
|
||||
{
|
||||
PyObject *v = PyLong_FromLong((long) value);
|
||||
if (v == NULL) {
|
||||
/* Don't bother reporting this error */
|
||||
PyErr_Clear();
|
||||
}
|
||||
else {
|
||||
PyDict_SetItemString(d, name, v);
|
||||
Py_DECREF(v);
|
||||
}
|
||||
}
|
||||
|
||||
PyMODINIT_FUNC
|
||||
PyInit_msvcrt(void)
|
||||
{
|
||||
int st;
|
||||
PyObject *d, *version;
|
||||
PyObject *m = PyModule_Create(&msvcrtmodule);
|
||||
if (m == NULL)
|
||||
return NULL;
|
||||
d = PyModule_GetDict(m);
|
||||
|
||||
/* constants for the locking() function's mode argument */
|
||||
insertint(d, "LK_LOCK", _LK_LOCK);
|
||||
insertint(d, "LK_NBLCK", _LK_NBLCK);
|
||||
insertint(d, "LK_NBRLCK", _LK_NBRLCK);
|
||||
insertint(d, "LK_RLCK", _LK_RLCK);
|
||||
insertint(d, "LK_UNLCK", _LK_UNLCK);
|
||||
insertint(d, "SEM_FAILCRITICALERRORS", SEM_FAILCRITICALERRORS);
|
||||
insertint(d, "SEM_NOALIGNMENTFAULTEXCEPT", SEM_NOALIGNMENTFAULTEXCEPT);
|
||||
insertint(d, "SEM_NOGPFAULTERRORBOX", SEM_NOGPFAULTERRORBOX);
|
||||
insertint(d, "SEM_NOOPENFILEERRORBOX", SEM_NOOPENFILEERRORBOX);
|
||||
#ifdef _DEBUG
|
||||
insertint(d, "CRT_WARN", _CRT_WARN);
|
||||
insertint(d, "CRT_ERROR", _CRT_ERROR);
|
||||
insertint(d, "CRT_ASSERT", _CRT_ASSERT);
|
||||
insertint(d, "CRTDBG_MODE_DEBUG", _CRTDBG_MODE_DEBUG);
|
||||
insertint(d, "CRTDBG_MODE_FILE", _CRTDBG_MODE_FILE);
|
||||
insertint(d, "CRTDBG_MODE_WNDW", _CRTDBG_MODE_WNDW);
|
||||
insertint(d, "CRTDBG_REPORT_MODE", _CRTDBG_REPORT_MODE);
|
||||
insertint(d, "CRTDBG_FILE_STDERR", (int)_CRTDBG_FILE_STDERR);
|
||||
insertint(d, "CRTDBG_FILE_STDOUT", (int)_CRTDBG_FILE_STDOUT);
|
||||
insertint(d, "CRTDBG_REPORT_FILE", (int)_CRTDBG_REPORT_FILE);
|
||||
#endif
|
||||
|
||||
/* constants for the crt versions */
|
||||
#ifdef _VC_ASSEMBLY_PUBLICKEYTOKEN
|
||||
st = PyModule_AddStringConstant(m, "VC_ASSEMBLY_PUBLICKEYTOKEN",
|
||||
_VC_ASSEMBLY_PUBLICKEYTOKEN);
|
||||
if (st < 0) return NULL;
|
||||
#endif
|
||||
#ifdef _CRT_ASSEMBLY_VERSION
|
||||
st = PyModule_AddStringConstant(m, "CRT_ASSEMBLY_VERSION",
|
||||
_CRT_ASSEMBLY_VERSION);
|
||||
if (st < 0) return NULL;
|
||||
#endif
|
||||
#ifdef __LIBRARIES_ASSEMBLY_NAME_PREFIX
|
||||
st = PyModule_AddStringConstant(m, "LIBRARIES_ASSEMBLY_NAME_PREFIX",
|
||||
__LIBRARIES_ASSEMBLY_NAME_PREFIX);
|
||||
if (st < 0) return NULL;
|
||||
#endif
|
||||
|
||||
/* constants for the 2010 crt versions */
|
||||
#if defined(_VC_CRT_MAJOR_VERSION) && defined (_VC_CRT_MINOR_VERSION) && defined(_VC_CRT_BUILD_VERSION) && defined(_VC_CRT_RBUILD_VERSION)
|
||||
version = PyUnicode_FromFormat("%d.%d.%d.%d", _VC_CRT_MAJOR_VERSION,
|
||||
_VC_CRT_MINOR_VERSION,
|
||||
_VC_CRT_BUILD_VERSION,
|
||||
_VC_CRT_RBUILD_VERSION);
|
||||
st = PyModule_AddObject(m, "CRT_ASSEMBLY_VERSION", version);
|
||||
if (st < 0) return NULL;
|
||||
#endif
|
||||
/* make compiler warning quiet if st is unused */
|
||||
(void)st;
|
||||
|
||||
return m;
|
||||
}
|
54
third_party/python/PC/pylauncher.rc
vendored
Normal file
|
@ -0,0 +1,54 @@
|
|||
#include <windows.h>
|
||||
|
||||
#include "python_ver_rc.h"
|
||||
|
||||
// Include the manifest file that indicates we support all
|
||||
// current versions of Windows.
|
||||
#include <winuser.h>
|
||||
1 RT_MANIFEST "python.manifest"
|
||||
|
||||
1 ICON DISCARDABLE "icons\launcher.ico"
|
||||
2 ICON DISCARDABLE "icons\py.ico"
|
||||
3 ICON DISCARDABLE "icons\pyc.ico"
|
||||
4 ICON DISCARDABLE "icons\pyd.ico"
|
||||
5 ICON DISCARDABLE "icons\python.ico"
|
||||
6 ICON DISCARDABLE "icons\pythonw.ico"
|
||||
7 ICON DISCARDABLE "icons\setup.ico"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION PYVERSION64
|
||||
PRODUCTVERSION PYVERSION64
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS VS_FF_DEBUG
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS VOS__WINDOWS32
|
||||
FILETYPE VFT_APP
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "000004b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", PYTHON_COMPANY "\0"
|
||||
VALUE "FileDescription", "Python\0"
|
||||
VALUE "FileVersion", PYTHON_VERSION
|
||||
VALUE "InternalName", "Python Launcher\0"
|
||||
VALUE "LegalCopyright", PYTHON_COPYRIGHT "\0"
|
||||
VALUE "OriginalFilename", "py" PYTHON_DEBUG_EXT ".exe\0"
|
||||
VALUE "ProductName", "Python\0"
|
||||
VALUE "ProductVersion", PYTHON_VERSION
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x0, 1200
|
||||
END
|
||||
END
|
610
third_party/python/PC/pyshellext.cpp
vendored
Normal file
|
@ -0,0 +1,610 @@
|
|||
// Support back to Vista
|
||||
#define _WIN32_WINNT _WIN32_WINNT_VISTA
|
||||
#include <sdkddkver.h>
|
||||
|
||||
// Use WRL to define a classic COM class
|
||||
#define __WRL_CLASSIC_COM__
|
||||
#include <wrl.h>
|
||||
|
||||
#include <windows.h>
|
||||
#include <shlobj.h>
|
||||
#include <shlwapi.h>
|
||||
#include <olectl.h>
|
||||
#include <strsafe.h>
|
||||
|
||||
#include "pyshellext_h.h"
|
||||
|
||||
#define DDWM_UPDATEWINDOW (WM_USER+3)
|
||||
|
||||
static HINSTANCE hModule;
|
||||
static CLIPFORMAT cfDropDescription;
|
||||
static CLIPFORMAT cfDragWindow;
|
||||
|
||||
static const LPCWSTR CLASS_SUBKEY = L"Software\\Classes\\CLSID\\{BEA218D2-6950-497B-9434-61683EC065FE}";
|
||||
static const LPCWSTR DRAG_MESSAGE = L"Open with %1";
|
||||
|
||||
using namespace Microsoft::WRL;
|
||||
|
||||
HRESULT FilenameListCchLengthA(LPCSTR pszSource, size_t cchMax, size_t *pcchLength, size_t *pcchCount) {
|
||||
HRESULT hr = S_OK;
|
||||
size_t count = 0;
|
||||
size_t length = 0;
|
||||
|
||||
while (pszSource && pszSource[0]) {
|
||||
size_t oneLength;
|
||||
hr = StringCchLengthA(pszSource, cchMax - length, &oneLength);
|
||||
if (FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
count += 1;
|
||||
length += oneLength + (strchr(pszSource, ' ') ? 3 : 1);
|
||||
pszSource = &pszSource[oneLength + 1];
|
||||
}
|
||||
|
||||
*pcchCount = count;
|
||||
*pcchLength = length;
|
||||
return hr;
|
||||
}
|
||||
|
||||
HRESULT FilenameListCchLengthW(LPCWSTR pszSource, size_t cchMax, size_t *pcchLength, size_t *pcchCount) {
|
||||
HRESULT hr = S_OK;
|
||||
size_t count = 0;
|
||||
size_t length = 0;
|
||||
|
||||
while (pszSource && pszSource[0]) {
|
||||
size_t oneLength;
|
||||
hr = StringCchLengthW(pszSource, cchMax - length, &oneLength);
|
||||
if (FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
count += 1;
|
||||
length += oneLength + (wcschr(pszSource, ' ') ? 3 : 1);
|
||||
pszSource = &pszSource[oneLength + 1];
|
||||
}
|
||||
|
||||
*pcchCount = count;
|
||||
*pcchLength = length;
|
||||
return hr;
|
||||
}
|
||||
|
||||
HRESULT FilenameListCchCopyA(STRSAFE_LPSTR pszDest, size_t cchDest, LPCSTR pszSource, LPCSTR pszSeparator) {
|
||||
HRESULT hr = S_OK;
|
||||
size_t count = 0;
|
||||
size_t length = 0;
|
||||
|
||||
while (pszSource[0]) {
|
||||
STRSAFE_LPSTR newDest;
|
||||
|
||||
hr = StringCchCopyExA(pszDest, cchDest, pszSource, &newDest, &cchDest, 0);
|
||||
if (FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
pszSource += (newDest - pszDest) + 1;
|
||||
pszDest = PathQuoteSpacesA(pszDest) ? newDest + 2 : newDest;
|
||||
|
||||
if (pszSource[0]) {
|
||||
hr = StringCchCopyExA(pszDest, cchDest, pszSeparator, &newDest, &cchDest, 0);
|
||||
if (FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
pszDest = newDest;
|
||||
}
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
HRESULT FilenameListCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, LPCWSTR pszSource, LPCWSTR pszSeparator) {
|
||||
HRESULT hr = S_OK;
|
||||
size_t count = 0;
|
||||
size_t length = 0;
|
||||
|
||||
while (pszSource[0]) {
|
||||
STRSAFE_LPWSTR newDest;
|
||||
|
||||
hr = StringCchCopyExW(pszDest, cchDest, pszSource, &newDest, &cchDest, 0);
|
||||
if (FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
pszSource += (newDest - pszDest) + 1;
|
||||
pszDest = PathQuoteSpacesW(pszDest) ? newDest + 2 : newDest;
|
||||
|
||||
if (pszSource[0]) {
|
||||
hr = StringCchCopyExW(pszDest, cchDest, pszSeparator, &newDest, &cchDest, 0);
|
||||
if (FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
pszDest = newDest;
|
||||
}
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
class PyShellExt : public RuntimeClass<
|
||||
RuntimeClassFlags<ClassicCom>,
|
||||
IDropTarget,
|
||||
IPersistFile
|
||||
>
|
||||
{
|
||||
LPOLESTR target, target_dir;
|
||||
DWORD target_mode;
|
||||
|
||||
IDataObject *data_obj;
|
||||
|
||||
public:
|
||||
PyShellExt() : target(NULL), target_dir(NULL), target_mode(0), data_obj(NULL) {
|
||||
OutputDebugString(L"PyShellExt::PyShellExt");
|
||||
}
|
||||
|
||||
~PyShellExt() {
|
||||
if (target) {
|
||||
CoTaskMemFree(target);
|
||||
}
|
||||
if (target_dir) {
|
||||
CoTaskMemFree(target_dir);
|
||||
}
|
||||
if (data_obj) {
|
||||
data_obj->Release();
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
HRESULT UpdateDropDescription(IDataObject *pDataObj) {
|
||||
STGMEDIUM medium;
|
||||
FORMATETC fmt = {
|
||||
cfDropDescription,
|
||||
NULL,
|
||||
DVASPECT_CONTENT,
|
||||
-1,
|
||||
TYMED_HGLOBAL
|
||||
};
|
||||
|
||||
auto hr = pDataObj->GetData(&fmt, &medium);
|
||||
if (FAILED(hr)) {
|
||||
OutputDebugString(L"PyShellExt::UpdateDropDescription - failed to get DROPDESCRIPTION format");
|
||||
return hr;
|
||||
}
|
||||
if (!medium.hGlobal) {
|
||||
OutputDebugString(L"PyShellExt::UpdateDropDescription - DROPDESCRIPTION format had NULL hGlobal");
|
||||
ReleaseStgMedium(&medium);
|
||||
return E_FAIL;
|
||||
}
|
||||
auto dd = (DROPDESCRIPTION*)GlobalLock(medium.hGlobal);
|
||||
if (!dd) {
|
||||
OutputDebugString(L"PyShellExt::UpdateDropDescription - failed to lock DROPDESCRIPTION hGlobal");
|
||||
ReleaseStgMedium(&medium);
|
||||
return E_FAIL;
|
||||
}
|
||||
StringCchCopy(dd->szMessage, sizeof(dd->szMessage) / sizeof(dd->szMessage[0]), DRAG_MESSAGE);
|
||||
StringCchCopy(dd->szInsert, sizeof(dd->szInsert) / sizeof(dd->szInsert[0]), PathFindFileNameW(target));
|
||||
dd->type = DROPIMAGE_MOVE;
|
||||
|
||||
GlobalUnlock(medium.hGlobal);
|
||||
ReleaseStgMedium(&medium);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT GetDragWindow(IDataObject *pDataObj, HWND *phWnd) {
|
||||
HRESULT hr;
|
||||
HWND *pMem;
|
||||
STGMEDIUM medium;
|
||||
FORMATETC fmt = {
|
||||
cfDragWindow,
|
||||
NULL,
|
||||
DVASPECT_CONTENT,
|
||||
-1,
|
||||
TYMED_HGLOBAL
|
||||
};
|
||||
|
||||
hr = pDataObj->GetData(&fmt, &medium);
|
||||
if (FAILED(hr)) {
|
||||
OutputDebugString(L"PyShellExt::GetDragWindow - failed to get DragWindow format");
|
||||
return hr;
|
||||
}
|
||||
if (!medium.hGlobal) {
|
||||
OutputDebugString(L"PyShellExt::GetDragWindow - DragWindow format had NULL hGlobal");
|
||||
ReleaseStgMedium(&medium);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
pMem = (HWND*)GlobalLock(medium.hGlobal);
|
||||
if (!pMem) {
|
||||
OutputDebugString(L"PyShellExt::GetDragWindow - failed to lock DragWindow hGlobal");
|
||||
ReleaseStgMedium(&medium);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
*phWnd = *pMem;
|
||||
|
||||
GlobalUnlock(medium.hGlobal);
|
||||
ReleaseStgMedium(&medium);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT GetArguments(IDataObject *pDataObj, LPCWSTR *pArguments) {
|
||||
HRESULT hr;
|
||||
DROPFILES *pdropfiles;
|
||||
|
||||
STGMEDIUM medium;
|
||||
FORMATETC fmt = {
|
||||
CF_HDROP,
|
||||
NULL,
|
||||
DVASPECT_CONTENT,
|
||||
-1,
|
||||
TYMED_HGLOBAL
|
||||
};
|
||||
|
||||
hr = pDataObj->GetData(&fmt, &medium);
|
||||
if (FAILED(hr)) {
|
||||
OutputDebugString(L"PyShellExt::GetArguments - failed to get CF_HDROP format");
|
||||
return hr;
|
||||
}
|
||||
if (!medium.hGlobal) {
|
||||
OutputDebugString(L"PyShellExt::GetArguments - CF_HDROP format had NULL hGlobal");
|
||||
ReleaseStgMedium(&medium);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
pdropfiles = (DROPFILES*)GlobalLock(medium.hGlobal);
|
||||
if (!pdropfiles) {
|
||||
OutputDebugString(L"PyShellExt::GetArguments - failed to lock CF_HDROP hGlobal");
|
||||
ReleaseStgMedium(&medium);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (pdropfiles->fWide) {
|
||||
LPCWSTR files = (LPCWSTR)((char*)pdropfiles + pdropfiles->pFiles);
|
||||
size_t len, count;
|
||||
hr = FilenameListCchLengthW(files, 32767, &len, &count);
|
||||
if (SUCCEEDED(hr)) {
|
||||
LPWSTR args = (LPWSTR)CoTaskMemAlloc(sizeof(WCHAR) * (len + 1));
|
||||
if (args) {
|
||||
hr = FilenameListCchCopyW(args, 32767, files, L" ");
|
||||
if (SUCCEEDED(hr)) {
|
||||
*pArguments = args;
|
||||
} else {
|
||||
CoTaskMemFree(args);
|
||||
}
|
||||
} else {
|
||||
hr = E_OUTOFMEMORY;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
LPCSTR files = (LPCSTR)((char*)pdropfiles + pdropfiles->pFiles);
|
||||
size_t len, count;
|
||||
hr = FilenameListCchLengthA(files, 32767, &len, &count);
|
||||
if (SUCCEEDED(hr)) {
|
||||
LPSTR temp = (LPSTR)CoTaskMemAlloc(sizeof(CHAR) * (len + 1));
|
||||
if (temp) {
|
||||
hr = FilenameListCchCopyA(temp, 32767, files, " ");
|
||||
if (SUCCEEDED(hr)) {
|
||||
int wlen = MultiByteToWideChar(CP_ACP, 0, temp, (int)len, NULL, 0);
|
||||
if (wlen) {
|
||||
LPWSTR args = (LPWSTR)CoTaskMemAlloc(sizeof(WCHAR) * (wlen + 1));
|
||||
if (MultiByteToWideChar(CP_ACP, 0, temp, (int)len, args, wlen + 1)) {
|
||||
*pArguments = args;
|
||||
} else {
|
||||
OutputDebugString(L"PyShellExt::GetArguments - failed to convert multi-byte to wide-char path");
|
||||
CoTaskMemFree(args);
|
||||
hr = E_FAIL;
|
||||
}
|
||||
} else {
|
||||
OutputDebugString(L"PyShellExt::GetArguments - failed to get length of wide-char path");
|
||||
hr = E_FAIL;
|
||||
}
|
||||
}
|
||||
CoTaskMemFree(temp);
|
||||
} else {
|
||||
hr = E_OUTOFMEMORY;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GlobalUnlock(medium.hGlobal);
|
||||
ReleaseStgMedium(&medium);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
HRESULT NotifyDragWindow(HWND hwnd) {
|
||||
LRESULT res;
|
||||
|
||||
if (!hwnd) {
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
res = SendMessage(hwnd, DDWM_UPDATEWINDOW, 0, NULL);
|
||||
|
||||
if (res) {
|
||||
OutputDebugString(L"PyShellExt::NotifyDragWindow - failed to post DDWM_UPDATEWINDOW");
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
public:
|
||||
// IDropTarget implementation
|
||||
|
||||
STDMETHODIMP DragEnter(IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) {
|
||||
HWND hwnd;
|
||||
|
||||
OutputDebugString(L"PyShellExt::DragEnter");
|
||||
|
||||
pDataObj->AddRef();
|
||||
data_obj = pDataObj;
|
||||
|
||||
*pdwEffect = DROPEFFECT_MOVE;
|
||||
|
||||
if (FAILED(UpdateDropDescription(data_obj))) {
|
||||
OutputDebugString(L"PyShellExt::DragEnter - failed to update drop description");
|
||||
}
|
||||
if (FAILED(GetDragWindow(data_obj, &hwnd))) {
|
||||
OutputDebugString(L"PyShellExt::DragEnter - failed to get drag window");
|
||||
}
|
||||
if (FAILED(NotifyDragWindow(hwnd))) {
|
||||
OutputDebugString(L"PyShellExt::DragEnter - failed to notify drag window");
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP DragLeave() {
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP DragOver(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) {
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP Drop(IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) {
|
||||
LPCWSTR args;
|
||||
|
||||
OutputDebugString(L"PyShellExt::Drop");
|
||||
*pdwEffect = DROPEFFECT_NONE;
|
||||
|
||||
if (pDataObj != data_obj) {
|
||||
OutputDebugString(L"PyShellExt::Drop - unexpected data object");
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
data_obj->Release();
|
||||
data_obj = NULL;
|
||||
|
||||
if (SUCCEEDED(GetArguments(pDataObj, &args))) {
|
||||
OutputDebugString(args);
|
||||
ShellExecute(NULL, NULL, target, args, target_dir, SW_NORMAL);
|
||||
|
||||
CoTaskMemFree((LPVOID)args);
|
||||
} else {
|
||||
OutputDebugString(L"PyShellExt::Drop - failed to get launch arguments");
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
// IPersistFile implementation
|
||||
|
||||
STDMETHODIMP GetCurFile(LPOLESTR *ppszFileName) {
|
||||
HRESULT hr;
|
||||
size_t len;
|
||||
|
||||
if (!ppszFileName) {
|
||||
return E_POINTER;
|
||||
}
|
||||
|
||||
hr = StringCchLength(target, STRSAFE_MAX_CCH - 1, &len);
|
||||
if (FAILED(hr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
*ppszFileName = (LPOLESTR)CoTaskMemAlloc(sizeof(WCHAR) * (len + 1));
|
||||
if (!*ppszFileName) {
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
hr = StringCchCopy(*ppszFileName, len + 1, target);
|
||||
if (FAILED(hr)) {
|
||||
CoTaskMemFree(*ppszFileName);
|
||||
*ppszFileName = NULL;
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP IsDirty() {
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
STDMETHODIMP Load(LPCOLESTR pszFileName, DWORD dwMode) {
|
||||
HRESULT hr;
|
||||
size_t len;
|
||||
|
||||
OutputDebugString(L"PyShellExt::Load");
|
||||
OutputDebugString(pszFileName);
|
||||
|
||||
hr = StringCchLength(pszFileName, STRSAFE_MAX_CCH - 1, &len);
|
||||
if (FAILED(hr)) {
|
||||
OutputDebugString(L"PyShellExt::Load - failed to get string length");
|
||||
return hr;
|
||||
}
|
||||
|
||||
if (target) {
|
||||
CoTaskMemFree(target);
|
||||
}
|
||||
if (target_dir) {
|
||||
CoTaskMemFree(target_dir);
|
||||
}
|
||||
|
||||
target = (LPOLESTR)CoTaskMemAlloc(sizeof(WCHAR) * (len + 1));
|
||||
if (!target) {
|
||||
OutputDebugString(L"PyShellExt::Load - E_OUTOFMEMORY");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
target_dir = (LPOLESTR)CoTaskMemAlloc(sizeof(WCHAR) * (len + 1));
|
||||
if (!target_dir) {
|
||||
OutputDebugString(L"PyShellExt::Load - E_OUTOFMEMORY");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
hr = StringCchCopy(target, len + 1, pszFileName);
|
||||
if (FAILED(hr)) {
|
||||
OutputDebugString(L"PyShellExt::Load - failed to copy string");
|
||||
return hr;
|
||||
}
|
||||
|
||||
hr = StringCchCopy(target_dir, len + 1, pszFileName);
|
||||
if (FAILED(hr)) {
|
||||
OutputDebugString(L"PyShellExt::Load - failed to copy string");
|
||||
return hr;
|
||||
}
|
||||
if (!PathRemoveFileSpecW(target_dir)) {
|
||||
OutputDebugStringW(L"PyShellExt::Load - failed to remove filespec from target");
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
OutputDebugString(target);
|
||||
target_mode = dwMode;
|
||||
OutputDebugString(L"PyShellExt::Load - S_OK");
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP Save(LPCOLESTR pszFileName, BOOL fRemember) {
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
STDMETHODIMP SaveCompleted(LPCOLESTR pszFileName) {
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
STDMETHODIMP GetClassID(CLSID *pClassID) {
|
||||
*pClassID = CLSID_PyShellExt;
|
||||
return S_OK;
|
||||
}
|
||||
};
|
||||
|
||||
CoCreatableClass(PyShellExt);
|
||||
|
||||
STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, _COM_Outptr_ void** ppv) {
|
||||
return Module<InProc>::GetModule().GetClassObject(rclsid, riid, ppv);
|
||||
}
|
||||
|
||||
STDAPI DllCanUnloadNow() {
|
||||
return Module<InProc>::GetModule().Terminate() ? S_OK : S_FALSE;
|
||||
}
|
||||
|
||||
STDAPI DllRegisterServer() {
|
||||
LONG res;
|
||||
SECURITY_ATTRIBUTES secattr = { sizeof(SECURITY_ATTRIBUTES), NULL, FALSE };
|
||||
LPSECURITY_ATTRIBUTES psecattr = NULL;
|
||||
HKEY key, ipsKey;
|
||||
WCHAR modname[MAX_PATH];
|
||||
DWORD modname_len;
|
||||
|
||||
OutputDebugString(L"PyShellExt::DllRegisterServer");
|
||||
if (!hModule) {
|
||||
OutputDebugString(L"PyShellExt::DllRegisterServer - module handle was not set");
|
||||
return SELFREG_E_CLASS;
|
||||
}
|
||||
modname_len = GetModuleFileName(hModule, modname, MAX_PATH);
|
||||
if (modname_len == 0 ||
|
||||
(modname_len == MAX_PATH && GetLastError() == ERROR_INSUFFICIENT_BUFFER)) {
|
||||
OutputDebugString(L"PyShellExt::DllRegisterServer - failed to get module file name");
|
||||
return SELFREG_E_CLASS;
|
||||
}
|
||||
|
||||
DWORD disp;
|
||||
res = RegCreateKeyEx(HKEY_LOCAL_MACHINE, CLASS_SUBKEY, 0, NULL, 0,
|
||||
KEY_ALL_ACCESS, psecattr, &key, &disp);
|
||||
if (res == ERROR_ACCESS_DENIED) {
|
||||
OutputDebugString(L"PyShellExt::DllRegisterServer - failed to write per-machine registration. Attempting per-user instead.");
|
||||
res = RegCreateKeyEx(HKEY_CURRENT_USER, CLASS_SUBKEY, 0, NULL, 0,
|
||||
KEY_ALL_ACCESS, psecattr, &key, &disp);
|
||||
}
|
||||
if (res != ERROR_SUCCESS) {
|
||||
OutputDebugString(L"PyShellExt::DllRegisterServer - failed to create class key");
|
||||
return SELFREG_E_CLASS;
|
||||
}
|
||||
|
||||
res = RegCreateKeyEx(key, L"InProcServer32", 0, NULL, 0,
|
||||
KEY_ALL_ACCESS, psecattr, &ipsKey, NULL);
|
||||
if (res != ERROR_SUCCESS) {
|
||||
RegCloseKey(key);
|
||||
OutputDebugString(L"PyShellExt::DllRegisterServer - failed to create InProcServer32 key");
|
||||
return SELFREG_E_CLASS;
|
||||
}
|
||||
|
||||
res = RegSetValueEx(ipsKey, NULL, 0,
|
||||
REG_SZ, (LPBYTE)modname, modname_len * sizeof(modname[0]));
|
||||
|
||||
if (res != ERROR_SUCCESS) {
|
||||
RegCloseKey(ipsKey);
|
||||
RegCloseKey(key);
|
||||
OutputDebugString(L"PyShellExt::DllRegisterServer - failed to set server path");
|
||||
return SELFREG_E_CLASS;
|
||||
}
|
||||
|
||||
res = RegSetValueEx(ipsKey, L"ThreadingModel", 0,
|
||||
REG_SZ, (LPBYTE)(L"Apartment"), sizeof(L"Apartment"));
|
||||
|
||||
RegCloseKey(ipsKey);
|
||||
RegCloseKey(key);
|
||||
if (res != ERROR_SUCCESS) {
|
||||
OutputDebugString(L"PyShellExt::DllRegisterServer - failed to set threading model");
|
||||
return SELFREG_E_CLASS;
|
||||
}
|
||||
|
||||
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL);
|
||||
|
||||
OutputDebugString(L"PyShellExt::DllRegisterServer - S_OK");
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDAPI DllUnregisterServer() {
|
||||
LONG res_lm, res_cu;
|
||||
|
||||
res_lm = RegDeleteTree(HKEY_LOCAL_MACHINE, CLASS_SUBKEY);
|
||||
if (res_lm != ERROR_SUCCESS && res_lm != ERROR_FILE_NOT_FOUND) {
|
||||
OutputDebugString(L"PyShellExt::DllUnregisterServer - failed to delete per-machine registration");
|
||||
return SELFREG_E_CLASS;
|
||||
}
|
||||
|
||||
res_cu = RegDeleteTree(HKEY_CURRENT_USER, CLASS_SUBKEY);
|
||||
if (res_cu != ERROR_SUCCESS && res_cu != ERROR_FILE_NOT_FOUND) {
|
||||
OutputDebugString(L"PyShellExt::DllUnregisterServer - failed to delete per-user registration");
|
||||
return SELFREG_E_CLASS;
|
||||
}
|
||||
|
||||
if (res_lm == ERROR_FILE_NOT_FOUND && res_cu == ERROR_FILE_NOT_FOUND) {
|
||||
OutputDebugString(L"PyShellExt::DllUnregisterServer - extension was not registered");
|
||||
return SELFREG_E_CLASS;
|
||||
}
|
||||
|
||||
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL);
|
||||
|
||||
OutputDebugString(L"PyShellExt::DllUnregisterServer - S_OK");
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDAPI_(BOOL) DllMain(_In_opt_ HINSTANCE hinst, DWORD reason, _In_opt_ void*) {
|
||||
if (reason == DLL_PROCESS_ATTACH) {
|
||||
hModule = hinst;
|
||||
|
||||
cfDropDescription = RegisterClipboardFormat(CFSTR_DROPDESCRIPTION);
|
||||
if (!cfDropDescription) {
|
||||
OutputDebugString(L"PyShellExt::DllMain - failed to get CFSTR_DROPDESCRIPTION format");
|
||||
}
|
||||
cfDragWindow = RegisterClipboardFormat(L"DragWindow");
|
||||
if (!cfDragWindow) {
|
||||
OutputDebugString(L"PyShellExt::DllMain - failed to get DragWindow format");
|
||||
}
|
||||
|
||||
DisableThreadLibraryCalls(hinst);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
6
third_party/python/PC/pyshellext.def
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
LIBRARY "pyshellext"
|
||||
EXPORTS
|
||||
DllRegisterServer PRIVATE
|
||||
DllUnregisterServer PRIVATE
|
||||
DllGetClassObject PRIVATE
|
||||
DllCanUnloadNow PRIVATE
|
12
third_party/python/PC/pyshellext.idl
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
import "ocidl.idl";
|
||||
|
||||
[uuid(44039A76-3BDD-41C1-A31B-71C00202CE81), version(1.0)]
|
||||
library PyShellExtLib
|
||||
{
|
||||
[uuid(BEA218D2-6950-497B-9434-61683EC065FE), version(1.0)]
|
||||
coclass PyShellExt
|
||||
{
|
||||
[default] interface IDropTarget;
|
||||
interface IPersistFile;
|
||||
}
|
||||
};
|
46
third_party/python/PC/pyshellext.rc
vendored
Normal file
|
@ -0,0 +1,46 @@
|
|||
#include <windows.h>
|
||||
|
||||
#include "python_ver_rc.h"
|
||||
|
||||
// Include the manifest file that indicates we support all
|
||||
// current versions of Windows.
|
||||
#include <winuser.h>
|
||||
1 RT_MANIFEST "python.manifest"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION PYVERSION64
|
||||
PRODUCTVERSION PYVERSION64
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS VS_FF_DEBUG
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS VOS__WINDOWS32
|
||||
FILETYPE VFT_APP
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "000004b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", PYTHON_COMPANY "\0"
|
||||
VALUE "FileDescription", "Python\0"
|
||||
VALUE "FileVersion", PYTHON_VERSION
|
||||
VALUE "InternalName", "Python Launcher Shell Extension\0"
|
||||
VALUE "LegalCopyright", PYTHON_COPYRIGHT "\0"
|
||||
VALUE "OriginalFilename", "pyshellext" PYTHON_DEBUG_EXT ".dll\0"
|
||||
VALUE "ProductName", "Python\0"
|
||||
VALUE "ProductVersion", PYTHON_VERSION
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x0, 1200
|
||||
END
|
||||
END
|
6
third_party/python/PC/pyshellext_d.def
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
LIBRARY "pyshellext_d"
|
||||
EXPORTS
|
||||
DllRegisterServer PRIVATE
|
||||
DllUnregisterServer PRIVATE
|
||||
DllGetClassObject PRIVATE
|
||||
DllCanUnloadNow PRIVATE
|
30
third_party/python/PC/python.manifest
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<security>
|
||||
<requestedPrivileges>
|
||||
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
|
||||
</requestedPrivileges>
|
||||
</security>
|
||||
</trustInfo>
|
||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||
<application>
|
||||
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
|
||||
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
|
||||
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
|
||||
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
|
||||
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
|
||||
</application>
|
||||
</compatibility>
|
||||
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<windowsSettings>
|
||||
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
|
||||
</windowsSettings>
|
||||
</application>
|
||||
<dependency>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls"
|
||||
version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*" />
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
</assembly>
|
789
third_party/python/PC/python3.def
vendored
Normal file
|
@ -0,0 +1,789 @@
|
|||
; This file specifies the import forwarding for python3.dll
|
||||
; It is used when building python3dll.vcxproj
|
||||
LIBRARY "python3"
|
||||
EXPORTS
|
||||
PyArg_Parse=python36.PyArg_Parse
|
||||
PyArg_ParseTuple=python36.PyArg_ParseTuple
|
||||
PyArg_ParseTupleAndKeywords=python36.PyArg_ParseTupleAndKeywords
|
||||
PyArg_UnpackTuple=python36.PyArg_UnpackTuple
|
||||
PyArg_VaParse=python36.PyArg_VaParse
|
||||
PyArg_VaParseTupleAndKeywords=python36.PyArg_VaParseTupleAndKeywords
|
||||
PyArg_ValidateKeywordArguments=python36.PyArg_ValidateKeywordArguments
|
||||
PyBaseObject_Type=python36.PyBaseObject_Type DATA
|
||||
PyBool_FromLong=python36.PyBool_FromLong
|
||||
PyBool_Type=python36.PyBool_Type DATA
|
||||
PyByteArrayIter_Type=python36.PyByteArrayIter_Type DATA
|
||||
PyByteArray_AsString=python36.PyByteArray_AsString
|
||||
PyByteArray_Concat=python36.PyByteArray_Concat
|
||||
PyByteArray_FromObject=python36.PyByteArray_FromObject
|
||||
PyByteArray_FromStringAndSize=python36.PyByteArray_FromStringAndSize
|
||||
PyByteArray_Resize=python36.PyByteArray_Resize
|
||||
PyByteArray_Size=python36.PyByteArray_Size
|
||||
PyByteArray_Type=python36.PyByteArray_Type DATA
|
||||
PyBytesIter_Type=python36.PyBytesIter_Type DATA
|
||||
PyBytes_AsString=python36.PyBytes_AsString
|
||||
PyBytes_AsStringAndSize=python36.PyBytes_AsStringAndSize
|
||||
PyBytes_Concat=python36.PyBytes_Concat
|
||||
PyBytes_ConcatAndDel=python36.PyBytes_ConcatAndDel
|
||||
PyBytes_DecodeEscape=python36.PyBytes_DecodeEscape
|
||||
PyBytes_FromFormat=python36.PyBytes_FromFormat
|
||||
PyBytes_FromFormatV=python36.PyBytes_FromFormatV
|
||||
PyBytes_FromObject=python36.PyBytes_FromObject
|
||||
PyBytes_FromString=python36.PyBytes_FromString
|
||||
PyBytes_FromStringAndSize=python36.PyBytes_FromStringAndSize
|
||||
PyBytes_Repr=python36.PyBytes_Repr
|
||||
PyBytes_Size=python36.PyBytes_Size
|
||||
PyBytes_Type=python36.PyBytes_Type DATA
|
||||
PyCFunction_Call=python36.PyCFunction_Call
|
||||
PyCFunction_ClearFreeList=python36.PyCFunction_ClearFreeList
|
||||
PyCFunction_GetFlags=python36.PyCFunction_GetFlags
|
||||
PyCFunction_GetFunction=python36.PyCFunction_GetFunction
|
||||
PyCFunction_GetSelf=python36.PyCFunction_GetSelf
|
||||
PyCFunction_New=python36.PyCFunction_New
|
||||
PyCFunction_NewEx=python36.PyCFunction_NewEx
|
||||
PyCFunction_Type=python36.PyCFunction_Type DATA
|
||||
PyCallIter_New=python36.PyCallIter_New
|
||||
PyCallIter_Type=python36.PyCallIter_Type DATA
|
||||
PyCallable_Check=python36.PyCallable_Check
|
||||
PyCapsule_GetContext=python36.PyCapsule_GetContext
|
||||
PyCapsule_GetDestructor=python36.PyCapsule_GetDestructor
|
||||
PyCapsule_GetName=python36.PyCapsule_GetName
|
||||
PyCapsule_GetPointer=python36.PyCapsule_GetPointer
|
||||
PyCapsule_Import=python36.PyCapsule_Import
|
||||
PyCapsule_IsValid=python36.PyCapsule_IsValid
|
||||
PyCapsule_New=python36.PyCapsule_New
|
||||
PyCapsule_SetContext=python36.PyCapsule_SetContext
|
||||
PyCapsule_SetDestructor=python36.PyCapsule_SetDestructor
|
||||
PyCapsule_SetName=python36.PyCapsule_SetName
|
||||
PyCapsule_SetPointer=python36.PyCapsule_SetPointer
|
||||
PyCapsule_Type=python36.PyCapsule_Type DATA
|
||||
PyClassMethodDescr_Type=python36.PyClassMethodDescr_Type DATA
|
||||
PyCodec_BackslashReplaceErrors=python36.PyCodec_BackslashReplaceErrors
|
||||
PyCodec_Decode=python36.PyCodec_Decode
|
||||
PyCodec_Decoder=python36.PyCodec_Decoder
|
||||
PyCodec_Encode=python36.PyCodec_Encode
|
||||
PyCodec_Encoder=python36.PyCodec_Encoder
|
||||
PyCodec_IgnoreErrors=python36.PyCodec_IgnoreErrors
|
||||
PyCodec_IncrementalDecoder=python36.PyCodec_IncrementalDecoder
|
||||
PyCodec_IncrementalEncoder=python36.PyCodec_IncrementalEncoder
|
||||
PyCodec_KnownEncoding=python36.PyCodec_KnownEncoding
|
||||
PyCodec_LookupError=python36.PyCodec_LookupError
|
||||
PyCodec_NameReplaceErrors=python36.PyCodec_NameReplaceErrors
|
||||
PyCodec_Register=python36.PyCodec_Register
|
||||
PyCodec_RegisterError=python36.PyCodec_RegisterError
|
||||
PyCodec_ReplaceErrors=python36.PyCodec_ReplaceErrors
|
||||
PyCodec_StreamReader=python36.PyCodec_StreamReader
|
||||
PyCodec_StreamWriter=python36.PyCodec_StreamWriter
|
||||
PyCodec_StrictErrors=python36.PyCodec_StrictErrors
|
||||
PyCodec_XMLCharRefReplaceErrors=python36.PyCodec_XMLCharRefReplaceErrors
|
||||
PyComplex_FromDoubles=python36.PyComplex_FromDoubles
|
||||
PyComplex_ImagAsDouble=python36.PyComplex_ImagAsDouble
|
||||
PyComplex_RealAsDouble=python36.PyComplex_RealAsDouble
|
||||
PyComplex_Type=python36.PyComplex_Type DATA
|
||||
PyDescr_NewClassMethod=python36.PyDescr_NewClassMethod
|
||||
PyDescr_NewGetSet=python36.PyDescr_NewGetSet
|
||||
PyDescr_NewMember=python36.PyDescr_NewMember
|
||||
PyDescr_NewMethod=python36.PyDescr_NewMethod
|
||||
PyDictItems_Type=python36.PyDictItems_Type DATA
|
||||
PyDictIterItem_Type=python36.PyDictIterItem_Type DATA
|
||||
PyDictIterKey_Type=python36.PyDictIterKey_Type DATA
|
||||
PyDictIterValue_Type=python36.PyDictIterValue_Type DATA
|
||||
PyDictKeys_Type=python36.PyDictKeys_Type DATA
|
||||
PyDictProxy_New=python36.PyDictProxy_New
|
||||
PyDictProxy_Type=python36.PyDictProxy_Type DATA
|
||||
PyDictValues_Type=python36.PyDictValues_Type DATA
|
||||
PyDict_Clear=python36.PyDict_Clear
|
||||
PyDict_Contains=python36.PyDict_Contains
|
||||
PyDict_Copy=python36.PyDict_Copy
|
||||
PyDict_DelItem=python36.PyDict_DelItem
|
||||
PyDict_DelItemString=python36.PyDict_DelItemString
|
||||
PyDict_GetItem=python36.PyDict_GetItem
|
||||
PyDict_GetItemString=python36.PyDict_GetItemString
|
||||
PyDict_GetItemWithError=python36.PyDict_GetItemWithError
|
||||
PyDict_Items=python36.PyDict_Items
|
||||
PyDict_Keys=python36.PyDict_Keys
|
||||
PyDict_Merge=python36.PyDict_Merge
|
||||
PyDict_MergeFromSeq2=python36.PyDict_MergeFromSeq2
|
||||
PyDict_New=python36.PyDict_New
|
||||
PyDict_Next=python36.PyDict_Next
|
||||
PyDict_SetItem=python36.PyDict_SetItem
|
||||
PyDict_SetItemString=python36.PyDict_SetItemString
|
||||
PyDict_Size=python36.PyDict_Size
|
||||
PyDict_Type=python36.PyDict_Type DATA
|
||||
PyDict_Update=python36.PyDict_Update
|
||||
PyDict_Values=python36.PyDict_Values
|
||||
PyEllipsis_Type=python36.PyEllipsis_Type DATA
|
||||
PyEnum_Type=python36.PyEnum_Type DATA
|
||||
PyErr_BadArgument=python36.PyErr_BadArgument
|
||||
PyErr_BadInternalCall=python36.PyErr_BadInternalCall
|
||||
PyErr_CheckSignals=python36.PyErr_CheckSignals
|
||||
PyErr_Clear=python36.PyErr_Clear
|
||||
PyErr_Display=python36.PyErr_Display
|
||||
PyErr_ExceptionMatches=python36.PyErr_ExceptionMatches
|
||||
PyErr_Fetch=python36.PyErr_Fetch
|
||||
PyErr_Format=python36.PyErr_Format
|
||||
PyErr_FormatV=python36.PyErr_FormatV
|
||||
PyErr_GetExcInfo=python36.PyErr_GetExcInfo
|
||||
PyErr_GivenExceptionMatches=python36.PyErr_GivenExceptionMatches
|
||||
PyErr_NewException=python36.PyErr_NewException
|
||||
PyErr_NewExceptionWithDoc=python36.PyErr_NewExceptionWithDoc
|
||||
PyErr_NoMemory=python36.PyErr_NoMemory
|
||||
PyErr_NormalizeException=python36.PyErr_NormalizeException
|
||||
PyErr_Occurred=python36.PyErr_Occurred
|
||||
PyErr_Print=python36.PyErr_Print
|
||||
PyErr_PrintEx=python36.PyErr_PrintEx
|
||||
PyErr_ProgramText=python36.PyErr_ProgramText
|
||||
PyErr_ResourceWarning=python36.PyErr_ResourceWarning
|
||||
PyErr_Restore=python36.PyErr_Restore
|
||||
PyErr_SetExcFromWindowsErr=python36.PyErr_SetExcFromWindowsErr
|
||||
PyErr_SetExcFromWindowsErrWithFilename=python36.PyErr_SetExcFromWindowsErrWithFilename
|
||||
PyErr_SetExcFromWindowsErrWithFilenameObject=python36.PyErr_SetExcFromWindowsErrWithFilenameObject
|
||||
PyErr_SetExcFromWindowsErrWithFilenameObjects=python36.PyErr_SetExcFromWindowsErrWithFilenameObjects
|
||||
PyErr_SetExcInfo=python36.PyErr_SetExcInfo
|
||||
PyErr_SetFromErrno=python36.PyErr_SetFromErrno
|
||||
PyErr_SetFromErrnoWithFilename=python36.PyErr_SetFromErrnoWithFilename
|
||||
PyErr_SetFromErrnoWithFilenameObject=python36.PyErr_SetFromErrnoWithFilenameObject
|
||||
PyErr_SetFromErrnoWithFilenameObjects=python36.PyErr_SetFromErrnoWithFilenameObjects
|
||||
PyErr_SetFromWindowsErr=python36.PyErr_SetFromWindowsErr
|
||||
PyErr_SetFromWindowsErrWithFilename=python36.PyErr_SetFromWindowsErrWithFilename
|
||||
PyErr_SetImportError=python36.PyErr_SetImportError
|
||||
PyErr_SetImportErrorSubclass=python36.PyErr_SetImportErrorSubclass
|
||||
PyErr_SetInterrupt=python36.PyErr_SetInterrupt
|
||||
PyErr_SetNone=python36.PyErr_SetNone
|
||||
PyErr_SetObject=python36.PyErr_SetObject
|
||||
PyErr_SetString=python36.PyErr_SetString
|
||||
PyErr_SyntaxLocation=python36.PyErr_SyntaxLocation
|
||||
PyErr_SyntaxLocationEx=python36.PyErr_SyntaxLocationEx
|
||||
PyErr_WarnEx=python36.PyErr_WarnEx
|
||||
PyErr_WarnExplicit=python36.PyErr_WarnExplicit
|
||||
PyErr_WarnFormat=python36.PyErr_WarnFormat
|
||||
PyErr_WriteUnraisable=python36.PyErr_WriteUnraisable
|
||||
PyEval_AcquireLock=python36.PyEval_AcquireLock
|
||||
PyEval_AcquireThread=python36.PyEval_AcquireThread
|
||||
PyEval_CallFunction=python36.PyEval_CallFunction
|
||||
PyEval_CallMethod=python36.PyEval_CallMethod
|
||||
PyEval_CallObjectWithKeywords=python36.PyEval_CallObjectWithKeywords
|
||||
PyEval_EvalCode=python36.PyEval_EvalCode
|
||||
PyEval_EvalCodeEx=python36.PyEval_EvalCodeEx
|
||||
PyEval_EvalFrame=python36.PyEval_EvalFrame
|
||||
PyEval_EvalFrameEx=python36.PyEval_EvalFrameEx
|
||||
PyEval_GetBuiltins=python36.PyEval_GetBuiltins
|
||||
PyEval_GetCallStats=python36.PyEval_GetCallStats
|
||||
PyEval_GetFrame=python36.PyEval_GetFrame
|
||||
PyEval_GetFuncDesc=python36.PyEval_GetFuncDesc
|
||||
PyEval_GetFuncName=python36.PyEval_GetFuncName
|
||||
PyEval_GetGlobals=python36.PyEval_GetGlobals
|
||||
PyEval_GetLocals=python36.PyEval_GetLocals
|
||||
PyEval_InitThreads=python36.PyEval_InitThreads
|
||||
PyEval_ReInitThreads=python36.PyEval_ReInitThreads
|
||||
PyEval_ReleaseLock=python36.PyEval_ReleaseLock
|
||||
PyEval_ReleaseThread=python36.PyEval_ReleaseThread
|
||||
PyEval_RestoreThread=python36.PyEval_RestoreThread
|
||||
PyEval_SaveThread=python36.PyEval_SaveThread
|
||||
PyEval_ThreadsInitialized=python36.PyEval_ThreadsInitialized
|
||||
PyExc_ArithmeticError=python36.PyExc_ArithmeticError DATA
|
||||
PyExc_AssertionError=python36.PyExc_AssertionError DATA
|
||||
PyExc_AttributeError=python36.PyExc_AttributeError DATA
|
||||
PyExc_BaseException=python36.PyExc_BaseException DATA
|
||||
PyExc_BlockingIOError=python36.PyExc_BlockingIOError DATA
|
||||
PyExc_BrokenPipeError=python36.PyExc_BrokenPipeError DATA
|
||||
PyExc_BufferError=python36.PyExc_BufferError DATA
|
||||
PyExc_BytesWarning=python36.PyExc_BytesWarning DATA
|
||||
PyExc_ChildProcessError=python36.PyExc_ChildProcessError DATA
|
||||
PyExc_ConnectionAbortedError=python36.PyExc_ConnectionAbortedError DATA
|
||||
PyExc_ConnectionError=python36.PyExc_ConnectionError DATA
|
||||
PyExc_ConnectionRefusedError=python36.PyExc_ConnectionRefusedError DATA
|
||||
PyExc_ConnectionResetError=python36.PyExc_ConnectionResetError DATA
|
||||
PyExc_DeprecationWarning=python36.PyExc_DeprecationWarning DATA
|
||||
PyExc_EOFError=python36.PyExc_EOFError DATA
|
||||
PyExc_EnvironmentError=python36.PyExc_EnvironmentError DATA
|
||||
PyExc_Exception=python36.PyExc_Exception DATA
|
||||
PyExc_FileExistsError=python36.PyExc_FileExistsError DATA
|
||||
PyExc_FileNotFoundError=python36.PyExc_FileNotFoundError DATA
|
||||
PyExc_FloatingPointError=python36.PyExc_FloatingPointError DATA
|
||||
PyExc_FutureWarning=python36.PyExc_FutureWarning DATA
|
||||
PyExc_GeneratorExit=python36.PyExc_GeneratorExit DATA
|
||||
PyExc_IOError=python36.PyExc_IOError DATA
|
||||
PyExc_ImportError=python36.PyExc_ImportError DATA
|
||||
PyExc_ImportWarning=python36.PyExc_ImportWarning DATA
|
||||
PyExc_IndentationError=python36.PyExc_IndentationError DATA
|
||||
PyExc_IndexError=python36.PyExc_IndexError DATA
|
||||
PyExc_InterruptedError=python36.PyExc_InterruptedError DATA
|
||||
PyExc_IsADirectoryError=python36.PyExc_IsADirectoryError DATA
|
||||
PyExc_KeyError=python36.PyExc_KeyError DATA
|
||||
PyExc_KeyboardInterrupt=python36.PyExc_KeyboardInterrupt DATA
|
||||
PyExc_LookupError=python36.PyExc_LookupError DATA
|
||||
PyExc_MemoryError=python36.PyExc_MemoryError DATA
|
||||
PyExc_ModuleNotFoundError=python36.PyExc_ModuleNotFoundError DATA
|
||||
PyExc_NameError=python36.PyExc_NameError DATA
|
||||
PyExc_NotADirectoryError=python36.PyExc_NotADirectoryError DATA
|
||||
PyExc_NotImplementedError=python36.PyExc_NotImplementedError DATA
|
||||
PyExc_OSError=python36.PyExc_OSError DATA
|
||||
PyExc_OverflowError=python36.PyExc_OverflowError DATA
|
||||
PyExc_PendingDeprecationWarning=python36.PyExc_PendingDeprecationWarning DATA
|
||||
PyExc_PermissionError=python36.PyExc_PermissionError DATA
|
||||
PyExc_ProcessLookupError=python36.PyExc_ProcessLookupError DATA
|
||||
PyExc_RecursionError=python36.PyExc_RecursionError DATA
|
||||
PyExc_ReferenceError=python36.PyExc_ReferenceError DATA
|
||||
PyExc_ResourceWarning=python36.PyExc_ResourceWarning DATA
|
||||
PyExc_RuntimeError=python36.PyExc_RuntimeError DATA
|
||||
PyExc_RuntimeWarning=python36.PyExc_RuntimeWarning DATA
|
||||
PyExc_StopAsyncIteration=python36.PyExc_StopAsyncIteration DATA
|
||||
PyExc_StopIteration=python36.PyExc_StopIteration DATA
|
||||
PyExc_SyntaxError=python36.PyExc_SyntaxError DATA
|
||||
PyExc_SyntaxWarning=python36.PyExc_SyntaxWarning DATA
|
||||
PyExc_SystemError=python36.PyExc_SystemError DATA
|
||||
PyExc_SystemExit=python36.PyExc_SystemExit DATA
|
||||
PyExc_TabError=python36.PyExc_TabError DATA
|
||||
PyExc_TimeoutError=python36.PyExc_TimeoutError DATA
|
||||
PyExc_TypeError=python36.PyExc_TypeError DATA
|
||||
PyExc_UnboundLocalError=python36.PyExc_UnboundLocalError DATA
|
||||
PyExc_UnicodeDecodeError=python36.PyExc_UnicodeDecodeError DATA
|
||||
PyExc_UnicodeEncodeError=python36.PyExc_UnicodeEncodeError DATA
|
||||
PyExc_UnicodeError=python36.PyExc_UnicodeError DATA
|
||||
PyExc_UnicodeTranslateError=python36.PyExc_UnicodeTranslateError DATA
|
||||
PyExc_UnicodeWarning=python36.PyExc_UnicodeWarning DATA
|
||||
PyExc_UserWarning=python36.PyExc_UserWarning DATA
|
||||
PyExc_ValueError=python36.PyExc_ValueError DATA
|
||||
PyExc_Warning=python36.PyExc_Warning DATA
|
||||
PyExc_WindowsError=python36.PyExc_WindowsError DATA
|
||||
PyExc_ZeroDivisionError=python36.PyExc_ZeroDivisionError DATA
|
||||
PyException_GetCause=python36.PyException_GetCause
|
||||
PyException_GetContext=python36.PyException_GetContext
|
||||
PyException_GetTraceback=python36.PyException_GetTraceback
|
||||
PyException_SetCause=python36.PyException_SetCause
|
||||
PyException_SetContext=python36.PyException_SetContext
|
||||
PyException_SetTraceback=python36.PyException_SetTraceback
|
||||
PyFile_FromFd=python36.PyFile_FromFd
|
||||
PyFile_GetLine=python36.PyFile_GetLine
|
||||
PyFile_WriteObject=python36.PyFile_WriteObject
|
||||
PyFile_WriteString=python36.PyFile_WriteString
|
||||
PyFilter_Type=python36.PyFilter_Type DATA
|
||||
PyFloat_AsDouble=python36.PyFloat_AsDouble
|
||||
PyFloat_FromDouble=python36.PyFloat_FromDouble
|
||||
PyFloat_FromString=python36.PyFloat_FromString
|
||||
PyFloat_GetInfo=python36.PyFloat_GetInfo
|
||||
PyFloat_GetMax=python36.PyFloat_GetMax
|
||||
PyFloat_GetMin=python36.PyFloat_GetMin
|
||||
PyFloat_Type=python36.PyFloat_Type DATA
|
||||
PyFrozenSet_New=python36.PyFrozenSet_New
|
||||
PyFrozenSet_Type=python36.PyFrozenSet_Type DATA
|
||||
PyGC_Collect=python36.PyGC_Collect
|
||||
PyGILState_Ensure=python36.PyGILState_Ensure
|
||||
PyGILState_GetThisThreadState=python36.PyGILState_GetThisThreadState
|
||||
PyGILState_Release=python36.PyGILState_Release
|
||||
PyGetSetDescr_Type=python36.PyGetSetDescr_Type DATA
|
||||
PyImport_AddModule=python36.PyImport_AddModule
|
||||
PyImport_AddModuleObject=python36.PyImport_AddModuleObject
|
||||
PyImport_AppendInittab=python36.PyImport_AppendInittab
|
||||
PyImport_Cleanup=python36.PyImport_Cleanup
|
||||
PyImport_ExecCodeModule=python36.PyImport_ExecCodeModule
|
||||
PyImport_ExecCodeModuleEx=python36.PyImport_ExecCodeModuleEx
|
||||
PyImport_ExecCodeModuleObject=python36.PyImport_ExecCodeModuleObject
|
||||
PyImport_ExecCodeModuleWithPathnames=python36.PyImport_ExecCodeModuleWithPathnames
|
||||
PyImport_GetImporter=python36.PyImport_GetImporter
|
||||
PyImport_GetMagicNumber=python36.PyImport_GetMagicNumber
|
||||
PyImport_GetMagicTag=python36.PyImport_GetMagicTag
|
||||
PyImport_GetModuleDict=python36.PyImport_GetModuleDict
|
||||
PyImport_Import=python36.PyImport_Import
|
||||
PyImport_ImportFrozenModule=python36.PyImport_ImportFrozenModule
|
||||
PyImport_ImportFrozenModuleObject=python36.PyImport_ImportFrozenModuleObject
|
||||
PyImport_ImportModule=python36.PyImport_ImportModule
|
||||
PyImport_ImportModuleLevel=python36.PyImport_ImportModuleLevel
|
||||
PyImport_ImportModuleLevelObject=python36.PyImport_ImportModuleLevelObject
|
||||
PyImport_ImportModuleNoBlock=python36.PyImport_ImportModuleNoBlock
|
||||
PyImport_ReloadModule=python36.PyImport_ReloadModule
|
||||
PyInterpreterState_Clear=python36.PyInterpreterState_Clear
|
||||
PyInterpreterState_Delete=python36.PyInterpreterState_Delete
|
||||
PyInterpreterState_New=python36.PyInterpreterState_New
|
||||
PyIter_Next=python36.PyIter_Next
|
||||
PyListIter_Type=python36.PyListIter_Type DATA
|
||||
PyListRevIter_Type=python36.PyListRevIter_Type DATA
|
||||
PyList_Append=python36.PyList_Append
|
||||
PyList_AsTuple=python36.PyList_AsTuple
|
||||
PyList_GetItem=python36.PyList_GetItem
|
||||
PyList_GetSlice=python36.PyList_GetSlice
|
||||
PyList_Insert=python36.PyList_Insert
|
||||
PyList_New=python36.PyList_New
|
||||
PyList_Reverse=python36.PyList_Reverse
|
||||
PyList_SetItem=python36.PyList_SetItem
|
||||
PyList_SetSlice=python36.PyList_SetSlice
|
||||
PyList_Size=python36.PyList_Size
|
||||
PyList_Sort=python36.PyList_Sort
|
||||
PyList_Type=python36.PyList_Type DATA
|
||||
PyLongRangeIter_Type=python36.PyLongRangeIter_Type DATA
|
||||
PyLong_AsDouble=python36.PyLong_AsDouble
|
||||
PyLong_AsLong=python36.PyLong_AsLong
|
||||
PyLong_AsLongAndOverflow=python36.PyLong_AsLongAndOverflow
|
||||
PyLong_AsLongLong=python36.PyLong_AsLongLong
|
||||
PyLong_AsLongLongAndOverflow=python36.PyLong_AsLongLongAndOverflow
|
||||
PyLong_AsSize_t=python36.PyLong_AsSize_t
|
||||
PyLong_AsSsize_t=python36.PyLong_AsSsize_t
|
||||
PyLong_AsUnsignedLong=python36.PyLong_AsUnsignedLong
|
||||
PyLong_AsUnsignedLongLong=python36.PyLong_AsUnsignedLongLong
|
||||
PyLong_AsUnsignedLongLongMask=python36.PyLong_AsUnsignedLongLongMask
|
||||
PyLong_AsUnsignedLongMask=python36.PyLong_AsUnsignedLongMask
|
||||
PyLong_AsVoidPtr=python36.PyLong_AsVoidPtr
|
||||
PyLong_FromDouble=python36.PyLong_FromDouble
|
||||
PyLong_FromLong=python36.PyLong_FromLong
|
||||
PyLong_FromLongLong=python36.PyLong_FromLongLong
|
||||
PyLong_FromSize_t=python36.PyLong_FromSize_t
|
||||
PyLong_FromSsize_t=python36.PyLong_FromSsize_t
|
||||
PyLong_FromString=python36.PyLong_FromString
|
||||
PyLong_FromUnsignedLong=python36.PyLong_FromUnsignedLong
|
||||
PyLong_FromUnsignedLongLong=python36.PyLong_FromUnsignedLongLong
|
||||
PyLong_FromVoidPtr=python36.PyLong_FromVoidPtr
|
||||
PyLong_GetInfo=python36.PyLong_GetInfo
|
||||
PyLong_Type=python36.PyLong_Type DATA
|
||||
PyMap_Type=python36.PyMap_Type DATA
|
||||
PyMapping_Check=python36.PyMapping_Check
|
||||
PyMapping_GetItemString=python36.PyMapping_GetItemString
|
||||
PyMapping_HasKey=python36.PyMapping_HasKey
|
||||
PyMapping_HasKeyString=python36.PyMapping_HasKeyString
|
||||
PyMapping_Items=python36.PyMapping_Items
|
||||
PyMapping_Keys=python36.PyMapping_Keys
|
||||
PyMapping_Length=python36.PyMapping_Length
|
||||
PyMapping_SetItemString=python36.PyMapping_SetItemString
|
||||
PyMapping_Size=python36.PyMapping_Size
|
||||
PyMapping_Values=python36.PyMapping_Values
|
||||
PyMem_Calloc=python36.PyMem_Calloc
|
||||
PyMem_Free=python36.PyMem_Free
|
||||
PyMem_Malloc=python36.PyMem_Malloc
|
||||
PyMem_Realloc=python36.PyMem_Realloc
|
||||
PyMemberDescr_Type=python36.PyMemberDescr_Type DATA
|
||||
PyMemoryView_FromMemory=python36.PyMemoryView_FromMemory
|
||||
PyMemoryView_FromObject=python36.PyMemoryView_FromObject
|
||||
PyMemoryView_GetContiguous=python36.PyMemoryView_GetContiguous
|
||||
PyMemoryView_Type=python36.PyMemoryView_Type DATA
|
||||
PyMethodDescr_Type=python36.PyMethodDescr_Type DATA
|
||||
PyModuleDef_Init=python36.PyModuleDef_Init
|
||||
PyModuleDef_Type=python36.PyModuleDef_Type DATA
|
||||
PyModule_AddFunctions=python36.PyModule_AddFunctions
|
||||
PyModule_AddIntConstant=python36.PyModule_AddIntConstant
|
||||
PyModule_AddObject=python36.PyModule_AddObject
|
||||
PyModule_AddStringConstant=python36.PyModule_AddStringConstant
|
||||
PyModule_Create2=python36.PyModule_Create2
|
||||
PyModule_ExecDef=python36.PyModule_ExecDef
|
||||
PyModule_FromDefAndSpec2=python36.PyModule_FromDefAndSpec2
|
||||
PyModule_GetDef=python36.PyModule_GetDef
|
||||
PyModule_GetDict=python36.PyModule_GetDict
|
||||
PyModule_GetFilename=python36.PyModule_GetFilename
|
||||
PyModule_GetFilenameObject=python36.PyModule_GetFilenameObject
|
||||
PyModule_GetName=python36.PyModule_GetName
|
||||
PyModule_GetNameObject=python36.PyModule_GetNameObject
|
||||
PyModule_GetState=python36.PyModule_GetState
|
||||
PyModule_New=python36.PyModule_New
|
||||
PyModule_NewObject=python36.PyModule_NewObject
|
||||
PyModule_SetDocString=python36.PyModule_SetDocString
|
||||
PyModule_Type=python36.PyModule_Type DATA
|
||||
PyNullImporter_Type=python36.PyNullImporter_Type DATA
|
||||
PyNumber_Absolute=python36.PyNumber_Absolute
|
||||
PyNumber_Add=python36.PyNumber_Add
|
||||
PyNumber_And=python36.PyNumber_And
|
||||
PyNumber_AsSsize_t=python36.PyNumber_AsSsize_t
|
||||
PyNumber_Check=python36.PyNumber_Check
|
||||
PyNumber_Divmod=python36.PyNumber_Divmod
|
||||
PyNumber_Float=python36.PyNumber_Float
|
||||
PyNumber_FloorDivide=python36.PyNumber_FloorDivide
|
||||
PyNumber_InPlaceAdd=python36.PyNumber_InPlaceAdd
|
||||
PyNumber_InPlaceAnd=python36.PyNumber_InPlaceAnd
|
||||
PyNumber_InPlaceFloorDivide=python36.PyNumber_InPlaceFloorDivide
|
||||
PyNumber_InPlaceLshift=python36.PyNumber_InPlaceLshift
|
||||
PyNumber_InPlaceMatrixMultiply=python36.PyNumber_InPlaceMatrixMultiply
|
||||
PyNumber_InPlaceMultiply=python36.PyNumber_InPlaceMultiply
|
||||
PyNumber_InPlaceOr=python36.PyNumber_InPlaceOr
|
||||
PyNumber_InPlacePower=python36.PyNumber_InPlacePower
|
||||
PyNumber_InPlaceRemainder=python36.PyNumber_InPlaceRemainder
|
||||
PyNumber_InPlaceRshift=python36.PyNumber_InPlaceRshift
|
||||
PyNumber_InPlaceSubtract=python36.PyNumber_InPlaceSubtract
|
||||
PyNumber_InPlaceTrueDivide=python36.PyNumber_InPlaceTrueDivide
|
||||
PyNumber_InPlaceXor=python36.PyNumber_InPlaceXor
|
||||
PyNumber_Index=python36.PyNumber_Index
|
||||
PyNumber_Invert=python36.PyNumber_Invert
|
||||
PyNumber_Long=python36.PyNumber_Long
|
||||
PyNumber_Lshift=python36.PyNumber_Lshift
|
||||
PyNumber_MatrixMultiply=python36.PyNumber_MatrixMultiply
|
||||
PyNumber_Multiply=python36.PyNumber_Multiply
|
||||
PyNumber_Negative=python36.PyNumber_Negative
|
||||
PyNumber_Or=python36.PyNumber_Or
|
||||
PyNumber_Positive=python36.PyNumber_Positive
|
||||
PyNumber_Power=python36.PyNumber_Power
|
||||
PyNumber_Remainder=python36.PyNumber_Remainder
|
||||
PyNumber_Rshift=python36.PyNumber_Rshift
|
||||
PyNumber_Subtract=python36.PyNumber_Subtract
|
||||
PyNumber_ToBase=python36.PyNumber_ToBase
|
||||
PyNumber_TrueDivide=python36.PyNumber_TrueDivide
|
||||
PyNumber_Xor=python36.PyNumber_Xor
|
||||
PyODictItems_Type=python36.PyODictItems_Type DATA
|
||||
PyODictIter_Type=python36.PyODictIter_Type DATA
|
||||
PyODictKeys_Type=python36.PyODictKeys_Type DATA
|
||||
PyODictValues_Type=python36.PyODictValues_Type DATA
|
||||
PyODict_DelItem=python36.PyODict_DelItem
|
||||
PyODict_New=python36.PyODict_New
|
||||
PyODict_SetItem=python36.PyODict_SetItem
|
||||
PyODict_Type=python36.PyODict_Type DATA
|
||||
PyOS_AfterFork=python36.PyOS_AfterFork
|
||||
PyOS_CheckStack=python36.PyOS_CheckStack
|
||||
PyOS_FSPath=python36.PyOS_FSPath
|
||||
PyOS_InitInterrupts=python36.PyOS_InitInterrupts
|
||||
PyOS_InputHook=python36.PyOS_InputHook DATA
|
||||
PyOS_InterruptOccurred=python36.PyOS_InterruptOccurred
|
||||
PyOS_ReadlineFunctionPointer=python36.PyOS_ReadlineFunctionPointer DATA
|
||||
PyOS_double_to_string=python36.PyOS_double_to_string
|
||||
PyOS_getsig=python36.PyOS_getsig
|
||||
PyOS_mystricmp=python36.PyOS_mystricmp
|
||||
PyOS_mystrnicmp=python36.PyOS_mystrnicmp
|
||||
PyOS_setsig=python36.PyOS_setsig
|
||||
PyOS_snprintf=python36.PyOS_snprintf
|
||||
PyOS_string_to_double=python36.PyOS_string_to_double
|
||||
PyOS_strtol=python36.PyOS_strtol
|
||||
PyOS_strtoul=python36.PyOS_strtoul
|
||||
PyOS_vsnprintf=python36.PyOS_vsnprintf
|
||||
PyObject_ASCII=python36.PyObject_ASCII
|
||||
PyObject_AsCharBuffer=python36.PyObject_AsCharBuffer
|
||||
PyObject_AsFileDescriptor=python36.PyObject_AsFileDescriptor
|
||||
PyObject_AsReadBuffer=python36.PyObject_AsReadBuffer
|
||||
PyObject_AsWriteBuffer=python36.PyObject_AsWriteBuffer
|
||||
PyObject_Bytes=python36.PyObject_Bytes
|
||||
PyObject_Call=python36.PyObject_Call
|
||||
PyObject_CallFunction=python36.PyObject_CallFunction
|
||||
PyObject_CallFunctionObjArgs=python36.PyObject_CallFunctionObjArgs
|
||||
PyObject_CallMethod=python36.PyObject_CallMethod
|
||||
PyObject_CallMethodObjArgs=python36.PyObject_CallMethodObjArgs
|
||||
PyObject_CallObject=python36.PyObject_CallObject
|
||||
PyObject_Calloc=python36.PyObject_Calloc
|
||||
PyObject_CheckReadBuffer=python36.PyObject_CheckReadBuffer
|
||||
PyObject_ClearWeakRefs=python36.PyObject_ClearWeakRefs
|
||||
PyObject_DelItem=python36.PyObject_DelItem
|
||||
PyObject_DelItemString=python36.PyObject_DelItemString
|
||||
PyObject_Dir=python36.PyObject_Dir
|
||||
PyObject_Format=python36.PyObject_Format
|
||||
PyObject_Free=python36.PyObject_Free
|
||||
PyObject_GC_Del=python36.PyObject_GC_Del
|
||||
PyObject_GC_Track=python36.PyObject_GC_Track
|
||||
PyObject_GC_UnTrack=python36.PyObject_GC_UnTrack
|
||||
PyObject_GenericGetAttr=python36.PyObject_GenericGetAttr
|
||||
PyObject_GenericSetAttr=python36.PyObject_GenericSetAttr
|
||||
PyObject_GenericSetDict=python36.PyObject_GenericSetDict
|
||||
PyObject_GetAttr=python36.PyObject_GetAttr
|
||||
PyObject_GetAttrString=python36.PyObject_GetAttrString
|
||||
PyObject_GetItem=python36.PyObject_GetItem
|
||||
PyObject_GetIter=python36.PyObject_GetIter
|
||||
PyObject_HasAttr=python36.PyObject_HasAttr
|
||||
PyObject_HasAttrString=python36.PyObject_HasAttrString
|
||||
PyObject_Hash=python36.PyObject_Hash
|
||||
PyObject_HashNotImplemented=python36.PyObject_HashNotImplemented
|
||||
PyObject_Init=python36.PyObject_Init
|
||||
PyObject_InitVar=python36.PyObject_InitVar
|
||||
PyObject_IsInstance=python36.PyObject_IsInstance
|
||||
PyObject_IsSubclass=python36.PyObject_IsSubclass
|
||||
PyObject_IsTrue=python36.PyObject_IsTrue
|
||||
PyObject_Length=python36.PyObject_Length
|
||||
PyObject_Malloc=python36.PyObject_Malloc
|
||||
PyObject_Not=python36.PyObject_Not
|
||||
PyObject_Realloc=python36.PyObject_Realloc
|
||||
PyObject_Repr=python36.PyObject_Repr
|
||||
PyObject_RichCompare=python36.PyObject_RichCompare
|
||||
PyObject_RichCompareBool=python36.PyObject_RichCompareBool
|
||||
PyObject_SelfIter=python36.PyObject_SelfIter
|
||||
PyObject_SetAttr=python36.PyObject_SetAttr
|
||||
PyObject_SetAttrString=python36.PyObject_SetAttrString
|
||||
PyObject_SetItem=python36.PyObject_SetItem
|
||||
PyObject_Size=python36.PyObject_Size
|
||||
PyObject_Str=python36.PyObject_Str
|
||||
PyObject_Type=python36.PyObject_Type
|
||||
PyParser_SimpleParseFileFlags=python36.PyParser_SimpleParseFileFlags
|
||||
PyParser_SimpleParseStringFlags=python36.PyParser_SimpleParseStringFlags
|
||||
PyParser_SimpleParseStringFlagsFilename=python36.PyParser_SimpleParseStringFlagsFilename
|
||||
PyProperty_Type=python36.PyProperty_Type DATA
|
||||
PyRangeIter_Type=python36.PyRangeIter_Type DATA
|
||||
PyRange_Type=python36.PyRange_Type DATA
|
||||
PyReversed_Type=python36.PyReversed_Type DATA
|
||||
PySeqIter_New=python36.PySeqIter_New
|
||||
PySeqIter_Type=python36.PySeqIter_Type DATA
|
||||
PySequence_Check=python36.PySequence_Check
|
||||
PySequence_Concat=python36.PySequence_Concat
|
||||
PySequence_Contains=python36.PySequence_Contains
|
||||
PySequence_Count=python36.PySequence_Count
|
||||
PySequence_DelItem=python36.PySequence_DelItem
|
||||
PySequence_DelSlice=python36.PySequence_DelSlice
|
||||
PySequence_Fast=python36.PySequence_Fast
|
||||
PySequence_GetItem=python36.PySequence_GetItem
|
||||
PySequence_GetSlice=python36.PySequence_GetSlice
|
||||
PySequence_In=python36.PySequence_In
|
||||
PySequence_InPlaceConcat=python36.PySequence_InPlaceConcat
|
||||
PySequence_InPlaceRepeat=python36.PySequence_InPlaceRepeat
|
||||
PySequence_Index=python36.PySequence_Index
|
||||
PySequence_Length=python36.PySequence_Length
|
||||
PySequence_List=python36.PySequence_List
|
||||
PySequence_Repeat=python36.PySequence_Repeat
|
||||
PySequence_SetItem=python36.PySequence_SetItem
|
||||
PySequence_SetSlice=python36.PySequence_SetSlice
|
||||
PySequence_Size=python36.PySequence_Size
|
||||
PySequence_Tuple=python36.PySequence_Tuple
|
||||
PySetIter_Type=python36.PySetIter_Type DATA
|
||||
PySet_Add=python36.PySet_Add
|
||||
PySet_Clear=python36.PySet_Clear
|
||||
PySet_Contains=python36.PySet_Contains
|
||||
PySet_Discard=python36.PySet_Discard
|
||||
PySet_New=python36.PySet_New
|
||||
PySet_Pop=python36.PySet_Pop
|
||||
PySet_Size=python36.PySet_Size
|
||||
PySet_Type=python36.PySet_Type DATA
|
||||
PySlice_AdjustIndices=python36.PySlice_AdjustIndices
|
||||
PySlice_GetIndices=python36.PySlice_GetIndices
|
||||
PySlice_GetIndicesEx=python36.PySlice_GetIndicesEx
|
||||
PySlice_New=python36.PySlice_New
|
||||
PySlice_Type=python36.PySlice_Type DATA
|
||||
PySlice_Unpack=python36.PySlice_Unpack
|
||||
PySortWrapper_Type=python36.PySortWrapper_Type DATA
|
||||
PyState_AddModule=python36.PyState_AddModule
|
||||
PyState_FindModule=python36.PyState_FindModule
|
||||
PyState_RemoveModule=python36.PyState_RemoveModule
|
||||
PyStructSequence_GetItem=python36.PyStructSequence_GetItem
|
||||
PyStructSequence_New=python36.PyStructSequence_New
|
||||
PyStructSequence_NewType=python36.PyStructSequence_NewType
|
||||
PyStructSequence_SetItem=python36.PyStructSequence_SetItem
|
||||
PySuper_Type=python36.PySuper_Type DATA
|
||||
PySys_AddWarnOption=python36.PySys_AddWarnOption
|
||||
PySys_AddWarnOptionUnicode=python36.PySys_AddWarnOptionUnicode
|
||||
PySys_AddXOption=python36.PySys_AddXOption
|
||||
PySys_FormatStderr=python36.PySys_FormatStderr
|
||||
PySys_FormatStdout=python36.PySys_FormatStdout
|
||||
PySys_GetObject=python36.PySys_GetObject
|
||||
PySys_GetXOptions=python36.PySys_GetXOptions
|
||||
PySys_HasWarnOptions=python36.PySys_HasWarnOptions
|
||||
PySys_ResetWarnOptions=python36.PySys_ResetWarnOptions
|
||||
PySys_SetArgv=python36.PySys_SetArgv
|
||||
PySys_SetArgvEx=python36.PySys_SetArgvEx
|
||||
PySys_SetObject=python36.PySys_SetObject
|
||||
PySys_SetPath=python36.PySys_SetPath
|
||||
PySys_WriteStderr=python36.PySys_WriteStderr
|
||||
PySys_WriteStdout=python36.PySys_WriteStdout
|
||||
PyThreadState_Clear=python36.PyThreadState_Clear
|
||||
PyThreadState_Delete=python36.PyThreadState_Delete
|
||||
PyThreadState_DeleteCurrent=python36.PyThreadState_DeleteCurrent
|
||||
PyThreadState_Get=python36.PyThreadState_Get
|
||||
PyThreadState_GetDict=python36.PyThreadState_GetDict
|
||||
PyThreadState_New=python36.PyThreadState_New
|
||||
PyThreadState_SetAsyncExc=python36.PyThreadState_SetAsyncExc
|
||||
PyThreadState_Swap=python36.PyThreadState_Swap
|
||||
PyTraceBack_Here=python36.PyTraceBack_Here
|
||||
PyTraceBack_Print=python36.PyTraceBack_Print
|
||||
PyTraceBack_Type=python36.PyTraceBack_Type DATA
|
||||
PyTupleIter_Type=python36.PyTupleIter_Type DATA
|
||||
PyTuple_ClearFreeList=python36.PyTuple_ClearFreeList
|
||||
PyTuple_GetItem=python36.PyTuple_GetItem
|
||||
PyTuple_GetSlice=python36.PyTuple_GetSlice
|
||||
PyTuple_New=python36.PyTuple_New
|
||||
PyTuple_Pack=python36.PyTuple_Pack
|
||||
PyTuple_SetItem=python36.PyTuple_SetItem
|
||||
PyTuple_Size=python36.PyTuple_Size
|
||||
PyTuple_Type=python36.PyTuple_Type DATA
|
||||
PyType_ClearCache=python36.PyType_ClearCache
|
||||
PyType_FromSpec=python36.PyType_FromSpec
|
||||
PyType_FromSpecWithBases=python36.PyType_FromSpecWithBases
|
||||
PyType_GenericAlloc=python36.PyType_GenericAlloc
|
||||
PyType_GenericNew=python36.PyType_GenericNew
|
||||
PyType_GetFlags=python36.PyType_GetFlags
|
||||
PyType_GetSlot=python36.PyType_GetSlot
|
||||
PyType_IsSubtype=python36.PyType_IsSubtype
|
||||
PyType_Modified=python36.PyType_Modified
|
||||
PyType_Ready=python36.PyType_Ready
|
||||
PyType_Type=python36.PyType_Type DATA
|
||||
PyUnicodeDecodeError_Create=python36.PyUnicodeDecodeError_Create
|
||||
PyUnicodeDecodeError_GetEncoding=python36.PyUnicodeDecodeError_GetEncoding
|
||||
PyUnicodeDecodeError_GetEnd=python36.PyUnicodeDecodeError_GetEnd
|
||||
PyUnicodeDecodeError_GetObject=python36.PyUnicodeDecodeError_GetObject
|
||||
PyUnicodeDecodeError_GetReason=python36.PyUnicodeDecodeError_GetReason
|
||||
PyUnicodeDecodeError_GetStart=python36.PyUnicodeDecodeError_GetStart
|
||||
PyUnicodeDecodeError_SetEnd=python36.PyUnicodeDecodeError_SetEnd
|
||||
PyUnicodeDecodeError_SetReason=python36.PyUnicodeDecodeError_SetReason
|
||||
PyUnicodeDecodeError_SetStart=python36.PyUnicodeDecodeError_SetStart
|
||||
PyUnicodeEncodeError_GetEncoding=python36.PyUnicodeEncodeError_GetEncoding
|
||||
PyUnicodeEncodeError_GetEnd=python36.PyUnicodeEncodeError_GetEnd
|
||||
PyUnicodeEncodeError_GetObject=python36.PyUnicodeEncodeError_GetObject
|
||||
PyUnicodeEncodeError_GetReason=python36.PyUnicodeEncodeError_GetReason
|
||||
PyUnicodeEncodeError_GetStart=python36.PyUnicodeEncodeError_GetStart
|
||||
PyUnicodeEncodeError_SetEnd=python36.PyUnicodeEncodeError_SetEnd
|
||||
PyUnicodeEncodeError_SetReason=python36.PyUnicodeEncodeError_SetReason
|
||||
PyUnicodeEncodeError_SetStart=python36.PyUnicodeEncodeError_SetStart
|
||||
PyUnicodeIter_Type=python36.PyUnicodeIter_Type DATA
|
||||
PyUnicodeTranslateError_GetEnd=python36.PyUnicodeTranslateError_GetEnd
|
||||
PyUnicodeTranslateError_GetObject=python36.PyUnicodeTranslateError_GetObject
|
||||
PyUnicodeTranslateError_GetReason=python36.PyUnicodeTranslateError_GetReason
|
||||
PyUnicodeTranslateError_GetStart=python36.PyUnicodeTranslateError_GetStart
|
||||
PyUnicodeTranslateError_SetEnd=python36.PyUnicodeTranslateError_SetEnd
|
||||
PyUnicodeTranslateError_SetReason=python36.PyUnicodeTranslateError_SetReason
|
||||
PyUnicodeTranslateError_SetStart=python36.PyUnicodeTranslateError_SetStart
|
||||
PyUnicode_Append=python36.PyUnicode_Append
|
||||
PyUnicode_AppendAndDel=python36.PyUnicode_AppendAndDel
|
||||
PyUnicode_AsASCIIString=python36.PyUnicode_AsASCIIString
|
||||
PyUnicode_AsCharmapString=python36.PyUnicode_AsCharmapString
|
||||
PyUnicode_AsDecodedObject=python36.PyUnicode_AsDecodedObject
|
||||
PyUnicode_AsDecodedUnicode=python36.PyUnicode_AsDecodedUnicode
|
||||
PyUnicode_AsEncodedObject=python36.PyUnicode_AsEncodedObject
|
||||
PyUnicode_AsEncodedString=python36.PyUnicode_AsEncodedString
|
||||
PyUnicode_AsEncodedUnicode=python36.PyUnicode_AsEncodedUnicode
|
||||
PyUnicode_AsLatin1String=python36.PyUnicode_AsLatin1String
|
||||
PyUnicode_AsMBCSString=python36.PyUnicode_AsMBCSString
|
||||
PyUnicode_AsRawUnicodeEscapeString=python36.PyUnicode_AsRawUnicodeEscapeString
|
||||
PyUnicode_AsUCS4=python36.PyUnicode_AsUCS4
|
||||
PyUnicode_AsUCS4Copy=python36.PyUnicode_AsUCS4Copy
|
||||
PyUnicode_AsUTF16String=python36.PyUnicode_AsUTF16String
|
||||
PyUnicode_AsUTF32String=python36.PyUnicode_AsUTF32String
|
||||
PyUnicode_AsUTF8String=python36.PyUnicode_AsUTF8String
|
||||
PyUnicode_AsUnicodeEscapeString=python36.PyUnicode_AsUnicodeEscapeString
|
||||
PyUnicode_AsWideChar=python36.PyUnicode_AsWideChar
|
||||
PyUnicode_AsWideCharString=python36.PyUnicode_AsWideCharString
|
||||
PyUnicode_BuildEncodingMap=python36.PyUnicode_BuildEncodingMap
|
||||
PyUnicode_ClearFreeList=python36.PyUnicode_ClearFreeList
|
||||
PyUnicode_Compare=python36.PyUnicode_Compare
|
||||
PyUnicode_CompareWithASCIIString=python36.PyUnicode_CompareWithASCIIString
|
||||
PyUnicode_Concat=python36.PyUnicode_Concat
|
||||
PyUnicode_Contains=python36.PyUnicode_Contains
|
||||
PyUnicode_Count=python36.PyUnicode_Count
|
||||
PyUnicode_Decode=python36.PyUnicode_Decode
|
||||
PyUnicode_DecodeASCII=python36.PyUnicode_DecodeASCII
|
||||
PyUnicode_DecodeCharmap=python36.PyUnicode_DecodeCharmap
|
||||
PyUnicode_DecodeCodePageStateful=python36.PyUnicode_DecodeCodePageStateful
|
||||
PyUnicode_DecodeFSDefault=python36.PyUnicode_DecodeFSDefault
|
||||
PyUnicode_DecodeFSDefaultAndSize=python36.PyUnicode_DecodeFSDefaultAndSize
|
||||
PyUnicode_DecodeLatin1=python36.PyUnicode_DecodeLatin1
|
||||
PyUnicode_DecodeLocale=python36.PyUnicode_DecodeLocale
|
||||
PyUnicode_DecodeLocaleAndSize=python36.PyUnicode_DecodeLocaleAndSize
|
||||
PyUnicode_DecodeMBCS=python36.PyUnicode_DecodeMBCS
|
||||
PyUnicode_DecodeMBCSStateful=python36.PyUnicode_DecodeMBCSStateful
|
||||
PyUnicode_DecodeRawUnicodeEscape=python36.PyUnicode_DecodeRawUnicodeEscape
|
||||
PyUnicode_DecodeUTF16=python36.PyUnicode_DecodeUTF16
|
||||
PyUnicode_DecodeUTF16Stateful=python36.PyUnicode_DecodeUTF16Stateful
|
||||
PyUnicode_DecodeUTF32=python36.PyUnicode_DecodeUTF32
|
||||
PyUnicode_DecodeUTF32Stateful=python36.PyUnicode_DecodeUTF32Stateful
|
||||
PyUnicode_DecodeUTF7=python36.PyUnicode_DecodeUTF7
|
||||
PyUnicode_DecodeUTF7Stateful=python36.PyUnicode_DecodeUTF7Stateful
|
||||
PyUnicode_DecodeUTF8=python36.PyUnicode_DecodeUTF8
|
||||
PyUnicode_DecodeUTF8Stateful=python36.PyUnicode_DecodeUTF8Stateful
|
||||
PyUnicode_DecodeUnicodeEscape=python36.PyUnicode_DecodeUnicodeEscape
|
||||
PyUnicode_EncodeCodePage=python36.PyUnicode_EncodeCodePage
|
||||
PyUnicode_EncodeFSDefault=python36.PyUnicode_EncodeFSDefault
|
||||
PyUnicode_EncodeLocale=python36.PyUnicode_EncodeLocale
|
||||
PyUnicode_FSConverter=python36.PyUnicode_FSConverter
|
||||
PyUnicode_FSDecoder=python36.PyUnicode_FSDecoder
|
||||
PyUnicode_Find=python36.PyUnicode_Find
|
||||
PyUnicode_FindChar=python36.PyUnicode_FindChar
|
||||
PyUnicode_Format=python36.PyUnicode_Format
|
||||
PyUnicode_FromEncodedObject=python36.PyUnicode_FromEncodedObject
|
||||
PyUnicode_FromFormat=python36.PyUnicode_FromFormat
|
||||
PyUnicode_FromFormatV=python36.PyUnicode_FromFormatV
|
||||
PyUnicode_FromObject=python36.PyUnicode_FromObject
|
||||
PyUnicode_FromOrdinal=python36.PyUnicode_FromOrdinal
|
||||
PyUnicode_FromString=python36.PyUnicode_FromString
|
||||
PyUnicode_FromStringAndSize=python36.PyUnicode_FromStringAndSize
|
||||
PyUnicode_FromWideChar=python36.PyUnicode_FromWideChar
|
||||
PyUnicode_GetDefaultEncoding=python36.PyUnicode_GetDefaultEncoding
|
||||
PyUnicode_GetLength=python36.PyUnicode_GetLength
|
||||
PyUnicode_GetSize=python36.PyUnicode_GetSize
|
||||
PyUnicode_InternFromString=python36.PyUnicode_InternFromString
|
||||
PyUnicode_InternImmortal=python36.PyUnicode_InternImmortal
|
||||
PyUnicode_InternInPlace=python36.PyUnicode_InternInPlace
|
||||
PyUnicode_IsIdentifier=python36.PyUnicode_IsIdentifier
|
||||
PyUnicode_Join=python36.PyUnicode_Join
|
||||
PyUnicode_Partition=python36.PyUnicode_Partition
|
||||
PyUnicode_RPartition=python36.PyUnicode_RPartition
|
||||
PyUnicode_RSplit=python36.PyUnicode_RSplit
|
||||
PyUnicode_ReadChar=python36.PyUnicode_ReadChar
|
||||
PyUnicode_Replace=python36.PyUnicode_Replace
|
||||
PyUnicode_Resize=python36.PyUnicode_Resize
|
||||
PyUnicode_RichCompare=python36.PyUnicode_RichCompare
|
||||
PyUnicode_Split=python36.PyUnicode_Split
|
||||
PyUnicode_Splitlines=python36.PyUnicode_Splitlines
|
||||
PyUnicode_Substring=python36.PyUnicode_Substring
|
||||
PyUnicode_Tailmatch=python36.PyUnicode_Tailmatch
|
||||
PyUnicode_Translate=python36.PyUnicode_Translate
|
||||
PyUnicode_Type=python36.PyUnicode_Type DATA
|
||||
PyUnicode_WriteChar=python36.PyUnicode_WriteChar
|
||||
PyWeakref_GetObject=python36.PyWeakref_GetObject
|
||||
PyWeakref_NewProxy=python36.PyWeakref_NewProxy
|
||||
PyWeakref_NewRef=python36.PyWeakref_NewRef
|
||||
PyWrapperDescr_Type=python36.PyWrapperDescr_Type DATA
|
||||
PyWrapper_New=python36.PyWrapper_New
|
||||
PyZip_Type=python36.PyZip_Type DATA
|
||||
Py_AddPendingCall=python36.Py_AddPendingCall
|
||||
Py_AtExit=python36.Py_AtExit
|
||||
Py_BuildValue=python36.Py_BuildValue
|
||||
Py_CompileString=python36.Py_CompileString
|
||||
Py_DecRef=python36.Py_DecRef
|
||||
Py_DecodeLocale=python36.Py_DecodeLocale
|
||||
Py_EncodeLocale=python36.Py_EncodeLocale
|
||||
Py_EndInterpreter=python36.Py_EndInterpreter
|
||||
Py_Exit=python36.Py_Exit
|
||||
Py_FatalError=python36.Py_FatalError
|
||||
Py_FileSystemDefaultEncodeErrors=python36.Py_FileSystemDefaultEncodeErrors DATA
|
||||
Py_FileSystemDefaultEncoding=python36.Py_FileSystemDefaultEncoding DATA
|
||||
Py_Finalize=python36.Py_Finalize
|
||||
Py_FinalizeEx=python36.Py_FinalizeEx
|
||||
Py_GetBuildInfo=python36.Py_GetBuildInfo
|
||||
Py_GetCompiler=python36.Py_GetCompiler
|
||||
Py_GetCopyright=python36.Py_GetCopyright
|
||||
Py_GetExecPrefix=python36.Py_GetExecPrefix
|
||||
Py_GetPath=python36.Py_GetPath
|
||||
Py_GetPlatform=python36.Py_GetPlatform
|
||||
Py_GetPrefix=python36.Py_GetPrefix
|
||||
Py_GetProgramFullPath=python36.Py_GetProgramFullPath
|
||||
Py_GetProgramName=python36.Py_GetProgramName
|
||||
Py_GetPythonHome=python36.Py_GetPythonHome
|
||||
Py_GetRecursionLimit=python36.Py_GetRecursionLimit
|
||||
Py_GetVersion=python36.Py_GetVersion
|
||||
Py_HasFileSystemDefaultEncoding=python36.Py_HasFileSystemDefaultEncoding DATA
|
||||
Py_IncRef=python36.Py_IncRef
|
||||
Py_Initialize=python36.Py_Initialize
|
||||
Py_InitializeEx=python36.Py_InitializeEx
|
||||
Py_IsInitialized=python36.Py_IsInitialized
|
||||
Py_Main=python36.Py_Main
|
||||
Py_MakePendingCalls=python36.Py_MakePendingCalls
|
||||
Py_NewInterpreter=python36.Py_NewInterpreter
|
||||
Py_ReprEnter=python36.Py_ReprEnter
|
||||
Py_ReprLeave=python36.Py_ReprLeave
|
||||
Py_SetPath=python36.Py_SetPath
|
||||
Py_SetProgramName=python36.Py_SetProgramName
|
||||
Py_SetPythonHome=python36.Py_SetPythonHome
|
||||
Py_SetRecursionLimit=python36.Py_SetRecursionLimit
|
||||
Py_SymtableString=python36.Py_SymtableString
|
||||
Py_VaBuildValue=python36.Py_VaBuildValue
|
||||
_PyArg_ParseTupleAndKeywords_SizeT=python36._PyArg_ParseTupleAndKeywords_SizeT
|
||||
_PyArg_ParseTuple_SizeT=python36._PyArg_ParseTuple_SizeT
|
||||
_PyArg_Parse_SizeT=python36._PyArg_Parse_SizeT
|
||||
_PyArg_VaParseTupleAndKeywords_SizeT=python36._PyArg_VaParseTupleAndKeywords_SizeT
|
||||
_PyArg_VaParse_SizeT=python36._PyArg_VaParse_SizeT
|
||||
_PyErr_BadInternalCall=python36._PyErr_BadInternalCall
|
||||
_PyObject_CallFunction_SizeT=python36._PyObject_CallFunction_SizeT
|
||||
_PyObject_CallMethod_SizeT=python36._PyObject_CallMethod_SizeT
|
||||
_PyObject_GC_Malloc=python36._PyObject_GC_Malloc
|
||||
_PyObject_GC_New=python36._PyObject_GC_New
|
||||
_PyObject_GC_NewVar=python36._PyObject_GC_NewVar
|
||||
_PyObject_GC_Resize=python36._PyObject_GC_Resize
|
||||
_PyObject_New=python36._PyObject_New
|
||||
_PyObject_NewVar=python36._PyObject_NewVar
|
||||
_PyState_AddModule=python36._PyState_AddModule
|
||||
_PyThreadState_Init=python36._PyThreadState_Init
|
||||
_PyThreadState_Prealloc=python36._PyThreadState_Prealloc
|
||||
_PyTrash_delete_later=python36._PyTrash_delete_later DATA
|
||||
_PyTrash_delete_nesting=python36._PyTrash_delete_nesting DATA
|
||||
_PyTrash_deposit_object=python36._PyTrash_deposit_object
|
||||
_PyTrash_destroy_chain=python36._PyTrash_destroy_chain
|
||||
_PyTrash_thread_deposit_object=python36._PyTrash_thread_deposit_object
|
||||
_PyTrash_thread_destroy_chain=python36._PyTrash_thread_destroy_chain
|
||||
_PyWeakref_CallableProxyType=python36._PyWeakref_CallableProxyType DATA
|
||||
_PyWeakref_ProxyType=python36._PyWeakref_ProxyType DATA
|
||||
_PyWeakref_RefType=python36._PyWeakref_RefType DATA
|
||||
_Py_BuildValue_SizeT=python36._Py_BuildValue_SizeT
|
||||
_Py_CheckRecursionLimit=python36._Py_CheckRecursionLimit DATA
|
||||
_Py_CheckRecursiveCall=python36._Py_CheckRecursiveCall
|
||||
_Py_Dealloc=python36._Py_Dealloc
|
||||
_Py_EllipsisObject=python36._Py_EllipsisObject DATA
|
||||
_Py_FalseStruct=python36._Py_FalseStruct DATA
|
||||
_Py_NoneStruct=python36._Py_NoneStruct DATA
|
||||
_Py_NotImplementedStruct=python36._Py_NotImplementedStruct DATA
|
||||
_Py_SwappedOp=python36._Py_SwappedOp DATA
|
||||
_Py_TrueStruct=python36._Py_TrueStruct DATA
|
||||
_Py_VaBuildValue_SizeT=python36._Py_VaBuildValue_SizeT
|
9
third_party/python/PC/python3dll.c
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
#include <windows.h>
|
||||
|
||||
BOOL WINAPI
|
||||
DllMain(HINSTANCE hInstDLL,
|
||||
DWORD fdwReason,
|
||||
LPVOID lpReserved)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
49
third_party/python/PC/python_exe.rc
vendored
Normal file
|
@ -0,0 +1,49 @@
|
|||
// Resource script for Python console EXEs.
|
||||
|
||||
#include "python_ver_rc.h"
|
||||
|
||||
// Include the manifest file that indicates we support all
|
||||
// current versions of Windows.
|
||||
#include <winuser.h>
|
||||
1 RT_MANIFEST "python.manifest"
|
||||
|
||||
1 ICON DISCARDABLE "icons\python.ico"
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION PYVERSION64
|
||||
PRODUCTVERSION PYVERSION64
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS VS_FF_DEBUG
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS VOS__WINDOWS32
|
||||
FILETYPE VFT_APP
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "000004b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", PYTHON_COMPANY "\0"
|
||||
VALUE "FileDescription", "Python\0"
|
||||
VALUE "FileVersion", PYTHON_VERSION
|
||||
VALUE "InternalName", "Python Console\0"
|
||||
VALUE "LegalCopyright", PYTHON_COPYRIGHT "\0"
|
||||
VALUE "OriginalFilename", "python" PYTHON_DEBUG_EXT ".exe\0"
|
||||
VALUE "ProductName", "Python\0"
|
||||
VALUE "ProductVersion", PYTHON_VERSION
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x0, 1200
|
||||
END
|
||||
END
|
52
third_party/python/PC/python_nt.rc
vendored
Normal file
|
@ -0,0 +1,52 @@
|
|||
// Resource script for Python core DLL.
|
||||
|
||||
#include "python_ver_rc.h"
|
||||
|
||||
// Include the manifest file that indicates we support all
|
||||
// current versions of Windows.
|
||||
#include <winuser.h>
|
||||
2 RT_MANIFEST "python.manifest"
|
||||
|
||||
// String Tables
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
1000, MS_DLL_ID
|
||||
END
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION PYVERSION64
|
||||
PRODUCTVERSION PYVERSION64
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS VS_FF_DEBUG
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS VOS__WINDOWS32
|
||||
FILETYPE VFT_DLL
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "000004b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", PYTHON_COMPANY "\0"
|
||||
VALUE "FileDescription", "Python Core\0"
|
||||
VALUE "FileVersion", PYTHON_VERSION
|
||||
VALUE "InternalName", "Python DLL\0"
|
||||
VALUE "LegalCopyright", PYTHON_COPYRIGHT "\0"
|
||||
VALUE "OriginalFilename", PYTHON_DLL_NAME "\0"
|
||||
VALUE "ProductName", "Python\0"
|
||||
VALUE "ProductVersion", PYTHON_VERSION
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x0, 1200
|
||||
END
|
||||
END
|
34
third_party/python/PC/python_ver_rc.h
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
// Resource script for Python core DLL.
|
||||
// Currently only holds version information.
|
||||
//
|
||||
#include "winver.h"
|
||||
|
||||
#define PYTHON_COMPANY "Python Software Foundation"
|
||||
#define PYTHON_COPYRIGHT "Copyright \xA9 2001-2021 Python Software Foundation. Copyright \xA9 2000 BeOpen.com. Copyright \xA9 1995-2001 CNRI. Copyright \xA9 1991-1995 SMC."
|
||||
|
||||
#define MS_WINDOWS
|
||||
#include "modsupport.h"
|
||||
#include "patchlevel.h"
|
||||
#include <pythonnt_rc.h>
|
||||
#ifdef _DEBUG
|
||||
# define PYTHON_DEBUG_EXT "_d"
|
||||
#else
|
||||
# define PYTHON_DEBUG_EXT
|
||||
#endif
|
||||
|
||||
/* e.g., 3.3.0a1
|
||||
* PY_VERSION comes from patchlevel.h
|
||||
*/
|
||||
#define PYTHON_VERSION PY_VERSION "\0"
|
||||
|
||||
/* 64-bit version number as comma-separated list of 4 16-bit ints */
|
||||
#if PY_MICRO_VERSION > 64
|
||||
# error "PY_MICRO_VERSION > 64"
|
||||
#endif
|
||||
#if PY_RELEASE_LEVEL > 99
|
||||
# error "PY_RELEASE_LEVEL > 99"
|
||||
#endif
|
||||
#if PY_RELEASE_SERIAL > 9
|
||||
# error "PY_RELEASE_SERIAL > 9"
|
||||
#endif
|
||||
#define PYVERSION64 PY_MAJOR_VERSION, PY_MINOR_VERSION, FIELD3, PYTHON_API_VERSION
|
49
third_party/python/PC/pythonw_exe.rc
vendored
Normal file
|
@ -0,0 +1,49 @@
|
|||
// Resource script for Python console EXEs.
|
||||
|
||||
#include "python_ver_rc.h"
|
||||
|
||||
// Include the manifest file that indicates we support all
|
||||
// current versions of Windows.
|
||||
#include <winuser.h>
|
||||
1 RT_MANIFEST "python.manifest"
|
||||
|
||||
1 ICON DISCARDABLE "icons\pythonw.ico"
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION PYVERSION64
|
||||
PRODUCTVERSION PYVERSION64
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS VS_FF_DEBUG
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS VOS__WINDOWS32
|
||||
FILETYPE VFT_APP
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "000004b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", PYTHON_COMPANY "\0"
|
||||
VALUE "FileDescription", "Python\0"
|
||||
VALUE "FileVersion", PYTHON_VERSION
|
||||
VALUE "InternalName", "Python Application\0"
|
||||
VALUE "LegalCopyright", PYTHON_COPYRIGHT "\0"
|
||||
VALUE "OriginalFilename", "pythonw" PYTHON_DEBUG_EXT ".exe\0"
|
||||
VALUE "ProductName", "Python\0"
|
||||
VALUE "ProductVersion", PYTHON_VERSION
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x0, 1200
|
||||
END
|
||||
END
|
81
third_party/python/PC/readme.txt
vendored
Normal file
|
@ -0,0 +1,81 @@
|
|||
Welcome to the "PC" subdirectory of the Python distribution
|
||||
***********************************************************
|
||||
|
||||
This "PC" subdirectory contains complete project files to make
|
||||
several older PC ports of Python, as well as all the PC-specific
|
||||
Python source files. It should be located in the root of the
|
||||
Python distribution, and there should be directories "Modules",
|
||||
"Objects", "Python", etc. in the parent directory of this "PC"
|
||||
subdirectory. Be sure to read the documentation in the Python
|
||||
distribution.
|
||||
|
||||
Python requires library files such as string.py to be available in
|
||||
one or more library directories. The search path of libraries is
|
||||
set up when Python starts. To see the current Python library search
|
||||
path, start Python and enter "import sys" and "print sys.path".
|
||||
|
||||
All PC ports use this scheme to try to set up a module search path:
|
||||
|
||||
1) The script location; the current directory without script.
|
||||
2) The PYTHONPATH variable, if set.
|
||||
3) For Win32 platforms (NT/95), paths specified in the Registry.
|
||||
4) Default directories lib, lib/win, lib/test, lib/tkinter;
|
||||
these are searched relative to the environment variable
|
||||
PYTHONHOME, if set, or relative to the executable and its
|
||||
ancestors, if a landmark file (Lib/string.py) is found ,
|
||||
or the current directory (not useful).
|
||||
5) The directory containing the executable.
|
||||
|
||||
The best installation strategy is to put the Python executable (and
|
||||
DLL, for Win32 platforms) in some convenient directory such as
|
||||
C:/python, and copy all library files and subdirectories (using XCOPY)
|
||||
to C:/python/lib. Then you don't need to set PYTHONPATH. Otherwise,
|
||||
set the environment variable PYTHONPATH to your Python search path.
|
||||
For example,
|
||||
set PYTHONPATH=.;d:\python\lib;d:\python\lib\win;d:\python\lib\dos-8x3
|
||||
|
||||
There are several add-in modules to build Python programs which use
|
||||
the native Windows operating environment. The ports here just make
|
||||
"QuickWin" and DOS Python versions which support a character-mode
|
||||
(console) environment. Look in www.python.org for Tkinter, PythonWin,
|
||||
WPY and wxPython.
|
||||
|
||||
To make a Python port, start the Integrated Development Environment
|
||||
(IDE) of your compiler, and read in the native "project file"
|
||||
(or makefile) provided. This will enable you to change any source
|
||||
files or build settings so you can make custom builds.
|
||||
|
||||
pyconfig.h An important configuration file specific to PC's.
|
||||
|
||||
config.c The list of C modules to include in the Python PC
|
||||
version. Manually edit this file to add or
|
||||
remove Python modules.
|
||||
|
||||
testpy.py A Python test program. Run this to test your
|
||||
Python port. It should produce copious output,
|
||||
ending in a report on how many tests were OK, how many
|
||||
failed, and how many were skipped. Don't worry about
|
||||
skipped tests (these test unavailable optional features).
|
||||
|
||||
|
||||
Additional files and subdirectories for 32-bit Windows
|
||||
======================================================
|
||||
|
||||
python_nt.rc Resource compiler input for python15.dll.
|
||||
|
||||
dl_nt.c
|
||||
Additional sources used for 32-bit Windows features.
|
||||
|
||||
getpathp.c Default sys.path calculations (for all PC platforms).
|
||||
|
||||
dllbase_nt.txt A (manually maintained) list of base addresses for
|
||||
various DLLs, to avoid run-time relocation.
|
||||
|
||||
|
||||
Note for Windows 3.x and DOS users
|
||||
==================================
|
||||
|
||||
Neither Windows 3.x nor DOS is supported any more. The last Python
|
||||
version that supported these was Python 1.5.2; the support files were
|
||||
present in Python 2.0 but weren't updated, and it is not our intention
|
||||
to support these platforms for Python 2.x.
|
49
third_party/python/PC/sqlite3.rc
vendored
Normal file
|
@ -0,0 +1,49 @@
|
|||
// Resource script for Sqlite DLL.
|
||||
|
||||
#include <winver.h>
|
||||
|
||||
// Include the manifest file that indicates we support all
|
||||
// current versions of Windows.
|
||||
#include <winuser.h>
|
||||
2 RT_MANIFEST "python.manifest"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
#define _S(x) #x
|
||||
#define S(x) _S(x)
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION SQLITE_MAJOR_VERSION, SQLITE_MINOR_VERSION, SQLITE_MICRO_VERSION, SQLITE_PATCH_VERSION
|
||||
PRODUCTVERSION SQLITE_MAJOR_VERSION, SQLITE_MINOR_VERSION, SQLITE_MICRO_VERSION, SQLITE_PATCH_VERSION
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS VS_FF_DEBUG
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS VOS__WINDOWS32
|
||||
FILETYPE VFT_DLL
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "000004b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "SQLite3\0"
|
||||
VALUE "FileDescription", "SQLite3\0"
|
||||
VALUE "FileVersion", S(SQLITE_VERSION) "\0"
|
||||
VALUE "InternalName", "SQLite3 DLL\0"
|
||||
VALUE "LegalCopyright", "Unspecified\0"
|
||||
VALUE "OriginalFilename", "sqlite3.dll\0"
|
||||
VALUE "ProductName", "SQLite3\0"
|
||||
VALUE "ProductVersion", S(SQLITE_VERSION) "\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x0, 1200
|
||||
END
|
||||
END
|
30
third_party/python/PC/testpy.py
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
import sys
|
||||
|
||||
# This is a test module for Python. It looks in the standard
|
||||
# places for various *.py files. If these are moved, you must
|
||||
# change this module too.
|
||||
|
||||
try:
|
||||
import os
|
||||
except:
|
||||
print("""Could not import the standard "os" module.
|
||||
Please check your PYTHONPATH environment variable.""")
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
import symbol
|
||||
except:
|
||||
print("""Could not import the standard "symbol" module. If this is
|
||||
a PC, you should add the dos_8x3 directory to your PYTHONPATH.""")
|
||||
sys.exit(1)
|
||||
|
||||
for dir in sys.path:
|
||||
file = os.path.join(dir, "os.py")
|
||||
if os.path.isfile(file):
|
||||
test = os.path.join(dir, "test")
|
||||
if os.path.isdir(test):
|
||||
# Add the "test" directory to PYTHONPATH.
|
||||
sys.path = sys.path + [test]
|
||||
|
||||
import libregrtest # Standard Python tester.
|
||||
libregrtest.main()
|
89
third_party/python/PC/validate_ucrtbase.py
vendored
Normal file
|
@ -0,0 +1,89 @@
|
|||
'''
|
||||
This script gets the version number from ucrtbased.dll and checks
|
||||
whether it is a version with a known issue.
|
||||
'''
|
||||
|
||||
import sys
|
||||
|
||||
from ctypes import (c_buffer, POINTER, byref, create_unicode_buffer,
|
||||
Structure, WinDLL)
|
||||
from ctypes.wintypes import DWORD, HANDLE
|
||||
|
||||
class VS_FIXEDFILEINFO(Structure):
|
||||
_fields_ = [
|
||||
("dwSignature", DWORD),
|
||||
("dwStrucVersion", DWORD),
|
||||
("dwFileVersionMS", DWORD),
|
||||
("dwFileVersionLS", DWORD),
|
||||
("dwProductVersionMS", DWORD),
|
||||
("dwProductVersionLS", DWORD),
|
||||
("dwFileFlagsMask", DWORD),
|
||||
("dwFileFlags", DWORD),
|
||||
("dwFileOS", DWORD),
|
||||
("dwFileType", DWORD),
|
||||
("dwFileSubtype", DWORD),
|
||||
("dwFileDateMS", DWORD),
|
||||
("dwFileDateLS", DWORD),
|
||||
]
|
||||
|
||||
kernel32 = WinDLL('kernel32')
|
||||
version = WinDLL('version')
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
print('Usage: validate_ucrtbase.py <ucrtbase|ucrtbased>')
|
||||
sys.exit(2)
|
||||
|
||||
try:
|
||||
ucrtbased = WinDLL(sys.argv[1])
|
||||
except OSError:
|
||||
print('Cannot find ucrtbased.dll')
|
||||
# This likely means that VS is not installed, but that is an
|
||||
# obvious enough problem if you're trying to produce a debug
|
||||
# build that we don't need to fail here.
|
||||
sys.exit(0)
|
||||
|
||||
# We will immediately double the length up to MAX_PATH, but the
|
||||
# path may be longer, so we retry until the returned string is
|
||||
# shorter than our buffer.
|
||||
name_len = actual_len = 130
|
||||
while actual_len == name_len:
|
||||
name_len *= 2
|
||||
name = create_unicode_buffer(name_len)
|
||||
actual_len = kernel32.GetModuleFileNameW(HANDLE(ucrtbased._handle),
|
||||
name, len(name))
|
||||
if not actual_len:
|
||||
print('Failed to get full module name.')
|
||||
sys.exit(2)
|
||||
|
||||
size = version.GetFileVersionInfoSizeW(name, None)
|
||||
if not size:
|
||||
print('Failed to get size of version info.')
|
||||
sys.exit(2)
|
||||
|
||||
ver_block = c_buffer(size)
|
||||
if (not version.GetFileVersionInfoW(name, None, size, ver_block) or
|
||||
not ver_block):
|
||||
print('Failed to get version info.')
|
||||
sys.exit(2)
|
||||
|
||||
pvi = POINTER(VS_FIXEDFILEINFO)()
|
||||
if not version.VerQueryValueW(ver_block, "", byref(pvi), byref(DWORD())):
|
||||
print('Failed to get version value from info.')
|
||||
sys.exit(2)
|
||||
|
||||
ver = (
|
||||
pvi.contents.dwProductVersionMS >> 16,
|
||||
pvi.contents.dwProductVersionMS & 0xFFFF,
|
||||
pvi.contents.dwProductVersionLS >> 16,
|
||||
pvi.contents.dwProductVersionLS & 0xFFFF,
|
||||
)
|
||||
|
||||
print('{} is version {}.{}.{}.{}'.format(name.value, *ver))
|
||||
|
||||
if ver < (10, 0, 10586):
|
||||
print('WARN: ucrtbased contains known issues. '
|
||||
'Please update the Windows 10 SDK.')
|
||||
print('See:')
|
||||
print(' http://bugs.python.org/issue27705')
|
||||
print(' https://developer.microsoft.com/en-US/windows/downloads/windows-10-sdk')
|
||||
sys.exit(1)
|
1960
third_party/python/PC/winreg.c
vendored
Normal file
250
third_party/python/PC/winsound.c
vendored
Normal file
|
@ -0,0 +1,250 @@
|
|||
/* Author: Toby Dickenson <htrd90@zepler.org>
|
||||
*
|
||||
* Copyright (c) 1999 Toby Dickenson
|
||||
*
|
||||
* Permission to use this software in any way is granted without
|
||||
* fee, provided that the copyright notice above appears in all
|
||||
* copies. This software is provided "as is" without any warranty.
|
||||
*/
|
||||
|
||||
/* Modified by Guido van Rossum */
|
||||
/* Beep added by Mark Hammond */
|
||||
/* Win9X Beep and platform identification added by Uncle Timmy */
|
||||
|
||||
/* Example:
|
||||
|
||||
import winsound
|
||||
import time
|
||||
|
||||
# Play wav file
|
||||
winsound.PlaySound('c:/windows/media/Chord.wav', winsound.SND_FILENAME)
|
||||
|
||||
# Play sound from control panel settings
|
||||
winsound.PlaySound('SystemQuestion', winsound.SND_ALIAS)
|
||||
|
||||
# Play wav file from memory
|
||||
data=open('c:/windows/media/Chimes.wav',"rb").read()
|
||||
winsound.PlaySound(data, winsound.SND_MEMORY)
|
||||
|
||||
# Start playing the first bit of wav file asynchronously
|
||||
winsound.PlaySound('c:/windows/media/Chord.wav',
|
||||
winsound.SND_FILENAME|winsound.SND_ASYNC)
|
||||
# But dont let it go for too long...
|
||||
time.sleep(0.1)
|
||||
# ...Before stopping it
|
||||
winsound.PlaySound(None, 0)
|
||||
*/
|
||||
|
||||
#include <Python.h>
|
||||
#include <windows.h>
|
||||
#include <mmsystem.h>
|
||||
|
||||
PyDoc_STRVAR(sound_module_doc,
|
||||
"PlaySound(sound, flags) - play a sound\n"
|
||||
"SND_FILENAME - sound is a wav file name\n"
|
||||
"SND_ALIAS - sound is a registry sound association name\n"
|
||||
"SND_LOOP - Play the sound repeatedly; must also specify SND_ASYNC\n"
|
||||
"SND_MEMORY - sound is a memory image of a wav file\n"
|
||||
"SND_PURGE - stop all instances of the specified sound\n"
|
||||
"SND_ASYNC - PlaySound returns immediately\n"
|
||||
"SND_NODEFAULT - Do not play a default beep if the sound can not be found\n"
|
||||
"SND_NOSTOP - Do not interrupt any sounds currently playing\n" // Raising RuntimeError if needed
|
||||
"SND_NOWAIT - Return immediately if the sound driver is busy\n" // Without any errors
|
||||
"\n"
|
||||
"Beep(frequency, duration) - Make a beep through the PC speaker.\n"
|
||||
"MessageBeep(type) - Call Windows MessageBeep.");
|
||||
|
||||
/*[clinic input]
|
||||
module winsound
|
||||
[clinic start generated code]*/
|
||||
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=a18401142d97b8d5]*/
|
||||
|
||||
#include "clinic/winsound.c.h"
|
||||
|
||||
/*[clinic input]
|
||||
winsound.PlaySound
|
||||
|
||||
sound: object
|
||||
The sound to play; a filename, data, or None.
|
||||
flags: int
|
||||
Flag values, ored together. See module documentation.
|
||||
|
||||
A wrapper around the Windows PlaySound API.
|
||||
[clinic start generated code]*/
|
||||
|
||||
static PyObject *
|
||||
winsound_PlaySound_impl(PyObject *module, PyObject *sound, int flags)
|
||||
/*[clinic end generated code: output=49a0fd16a372ebeb input=c63e1f2d848da2f2]*/
|
||||
{
|
||||
int ok;
|
||||
wchar_t *wsound;
|
||||
Py_buffer view = {NULL, NULL};
|
||||
|
||||
if (sound == Py_None) {
|
||||
wsound = NULL;
|
||||
} else if (flags & SND_MEMORY) {
|
||||
if (flags & SND_ASYNC) {
|
||||
/* Sidestep reference counting headache; unfortunately this also
|
||||
prevent SND_LOOP from memory. */
|
||||
PyErr_SetString(PyExc_RuntimeError,
|
||||
"Cannot play asynchronously from memory");
|
||||
return NULL;
|
||||
}
|
||||
if (PyObject_GetBuffer(sound, &view, PyBUF_SIMPLE) < 0) {
|
||||
return NULL;
|
||||
}
|
||||
wsound = (wchar_t *)view.buf;
|
||||
} else {
|
||||
if (!PyUnicode_Check(sound)) {
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"'sound' must be str or None, not '%s'",
|
||||
Py_TYPE(sound)->tp_name);
|
||||
return NULL;
|
||||
}
|
||||
wsound = _PyUnicode_AsWideCharString(sound);
|
||||
if (wsound == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
ok = PlaySoundW(wsound, NULL, flags);
|
||||
Py_END_ALLOW_THREADS
|
||||
if (view.obj) {
|
||||
PyBuffer_Release(&view);
|
||||
} else if (sound != Py_None) {
|
||||
PyMem_Free(wsound);
|
||||
}
|
||||
if (!ok) {
|
||||
PyErr_SetString(PyExc_RuntimeError, "Failed to play sound");
|
||||
return NULL;
|
||||
}
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
winsound.Beep
|
||||
|
||||
frequency: int
|
||||
Frequency of the sound in hertz.
|
||||
Must be in the range 37 through 32,767.
|
||||
duration: int
|
||||
How long the sound should play, in milliseconds.
|
||||
|
||||
A wrapper around the Windows Beep API.
|
||||
[clinic start generated code]*/
|
||||
|
||||
static PyObject *
|
||||
winsound_Beep_impl(PyObject *module, int frequency, int duration)
|
||||
/*[clinic end generated code: output=f32382e52ee9b2fb input=40e360cfa00a5cf0]*/
|
||||
{
|
||||
BOOL ok;
|
||||
|
||||
if (frequency < 37 || frequency > 32767) {
|
||||
PyErr_SetString(PyExc_ValueError,
|
||||
"frequency must be in 37 thru 32767");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
ok = Beep(frequency, duration);
|
||||
Py_END_ALLOW_THREADS
|
||||
if (!ok) {
|
||||
PyErr_SetString(PyExc_RuntimeError,"Failed to beep");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
winsound.MessageBeep
|
||||
|
||||
type: int(c_default="MB_OK") = MB_OK
|
||||
|
||||
Call Windows MessageBeep(x).
|
||||
|
||||
x defaults to MB_OK.
|
||||
[clinic start generated code]*/
|
||||
|
||||
static PyObject *
|
||||
winsound_MessageBeep_impl(PyObject *module, int type)
|
||||
/*[clinic end generated code: output=120875455121121f input=db185f741ae21401]*/
|
||||
{
|
||||
BOOL ok;
|
||||
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
ok = MessageBeep(type);
|
||||
Py_END_ALLOW_THREADS
|
||||
|
||||
if (!ok) {
|
||||
PyErr_SetExcFromWindowsErr(PyExc_RuntimeError, 0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static struct PyMethodDef sound_methods[] =
|
||||
{
|
||||
WINSOUND_PLAYSOUND_METHODDEF
|
||||
WINSOUND_BEEP_METHODDEF
|
||||
WINSOUND_MESSAGEBEEP_METHODDEF
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
static void
|
||||
add_define(PyObject *dict, const char *key, long value)
|
||||
{
|
||||
PyObject *k = PyUnicode_FromString(key);
|
||||
PyObject *v = PyLong_FromLong(value);
|
||||
if (v && k) {
|
||||
PyDict_SetItem(dict, k, v);
|
||||
}
|
||||
Py_XDECREF(k);
|
||||
Py_XDECREF(v);
|
||||
}
|
||||
|
||||
#define ADD_DEFINE(tok) add_define(dict,#tok,tok)
|
||||
|
||||
|
||||
static struct PyModuleDef winsoundmodule = {
|
||||
PyModuleDef_HEAD_INIT,
|
||||
"winsound",
|
||||
sound_module_doc,
|
||||
-1,
|
||||
sound_methods,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
PyMODINIT_FUNC
|
||||
PyInit_winsound(void)
|
||||
{
|
||||
PyObject *dict;
|
||||
PyObject *module = PyModule_Create(&winsoundmodule);
|
||||
if (module == NULL)
|
||||
return NULL;
|
||||
dict = PyModule_GetDict(module);
|
||||
|
||||
ADD_DEFINE(SND_ASYNC);
|
||||
ADD_DEFINE(SND_NODEFAULT);
|
||||
ADD_DEFINE(SND_NOSTOP);
|
||||
ADD_DEFINE(SND_NOWAIT);
|
||||
ADD_DEFINE(SND_ALIAS);
|
||||
ADD_DEFINE(SND_FILENAME);
|
||||
ADD_DEFINE(SND_MEMORY);
|
||||
ADD_DEFINE(SND_PURGE);
|
||||
ADD_DEFINE(SND_LOOP);
|
||||
ADD_DEFINE(SND_APPLICATION);
|
||||
|
||||
ADD_DEFINE(MB_OK);
|
||||
ADD_DEFINE(MB_ICONASTERISK);
|
||||
ADD_DEFINE(MB_ICONEXCLAMATION);
|
||||
ADD_DEFINE(MB_ICONHAND);
|
||||
ADD_DEFINE(MB_ICONQUESTION);
|
||||
return module;
|
||||
}
|