Use the new Unicode API
* Replace PyUnicode_FromUnicode(NULL, 0) by PyUnicode_New(0, 0)
* Replce PyUnicode_FromUnicode(str, len) by PyUnicode_FromWideChar(str, len)
* Replace Py_UNICODE by wchar_t
* posix_putenv() uses PyUnicode_FromFormat() to create the string, instead
of PyUnicode_FromUnicode() + _snwprintf()
diff --git a/PC/_msi.c b/PC/_msi.c
index 6fb9c42..0b5b94e 100644
--- a/PC/_msi.c
+++ b/PC/_msi.c
@@ -18,7 +18,7 @@
uuidcreate(PyObject* obj, PyObject*args)
{
UUID result;
- unsigned short *cresult;
+ wchar_t *cresult;
PyObject *oresult;
/* May return ok, local only, and no address.
@@ -35,7 +35,7 @@
return NULL;
}
- oresult = PyUnicode_FromUnicode(cresult, wcslen(cresult));
+ oresult = PyUnicode_FromWideChar(cresult, wcslen(cresult));
RpcStringFreeW(&cresult);
return oresult;
@@ -379,7 +379,7 @@
}
if (status != ERROR_SUCCESS)
return msierror((int) status);
- string = PyUnicode_FromUnicode(res, size);
+ string = PyUnicode_FromWideChar(res, size);
if (buf != res)
free(res);
return string;
@@ -401,7 +401,7 @@
{
int status;
int field;
- Py_UNICODE *data;
+ wchar_t *data;
if (!PyArg_ParseTuple(args, "iu:SetString", &field, &data))
return NULL;
@@ -418,7 +418,7 @@
{
int status;
int field;
- Py_UNICODE *data;
+ wchar_t *data;
if (!PyArg_ParseTuple(args, "iu:SetStream", &field, &data))
return NULL;