x64 crashes fixed

This commit is contained in:
d1str4ught
2025-08-19 03:54:44 +02:00
parent e87b6fc67b
commit 61a04096ee
10 changed files with 114 additions and 78 deletions

View File

@@ -1,6 +1,9 @@
#include "StdAfx.h"
#include "PythonUtils.h"
#define PyLong_AsLong PyLong_AsLongLong
#define PyLong_AsUnsignedLong PyLong_AsUnsignedLongLong
IPythonExceptionSender * g_pkExceptionSender = NULL;
bool __PyCallClassMemberFunc_ByCString(PyObject* poClass, const char* c_szFunc, PyObject* poArgs, PyObject** poRet);
@@ -71,6 +74,20 @@ bool PyTuple_GetLong(PyObject* poArgs, int pos, long* ret)
return true;
}
bool PyTuple_GetLongLong(PyObject* poArgs, int pos, long long* ret)
{
if (pos >= PyTuple_Size(poArgs))
return false;
PyObject* poItem = PyTuple_GetItem(poArgs, pos);
if (!poItem)
return false;
*ret = PyLong_AsLongLong(poItem);
return true;
}
bool PyTuple_GetDouble(PyObject* poArgs, int pos, double* ret)
{
if (pos >= PyTuple_Size(poArgs))
@@ -151,6 +168,20 @@ bool PyTuple_GetUnsignedLong(PyObject* poArgs, int pos, unsigned long* ret)
return true;
}
bool PyTuple_GetUnsignedLongLong(PyObject* poArgs, int pos, unsigned long long* ret)
{
if (pos >= PyTuple_Size(poArgs))
return false;
PyObject* poItem = PyTuple_GetItem(poArgs, pos);
if (!poItem)
return false;
*ret = PyLong_AsUnsignedLongLong(poItem);
return true;
}
bool PyTuple_GetUnsignedInteger(PyObject* poArgs, int pos, unsigned int* ret)
{
if (pos >= PyTuple_Size(poArgs))

View File

@@ -9,7 +9,9 @@ bool PyTuple_GetInteger(PyObject* poArgs, int pos, WORD* ret);
bool PyTuple_GetByte(PyObject* poArgs, int pos, unsigned char* ret);
bool PyTuple_GetUnsignedInteger(PyObject* poArgs, int pos, unsigned int* ret);
bool PyTuple_GetLong(PyObject* poArgs, int pos, long* ret);
bool PyTuple_GetLongLong(PyObject* poArgs, int pos, long long* ret);
bool PyTuple_GetUnsignedLong(PyObject* poArgs, int pos, unsigned long* ret);
bool PyTuple_GetUnsignedLongLong(PyObject* poArgs, int pos, unsigned long long* ret);
bool PyTuple_GetFloat(PyObject* poArgs, int pos, float* ret);
bool PyTuple_GetDouble(PyObject* poArgs, int pos, double* ret);
bool PyTuple_GetObject(PyObject* poArgs, int pos, PyObject** ret);