From 0e7bf5b548e76cf421235fa6bf3a50e8395059d7 Mon Sep 17 00:00:00 2001 From: CristiFati Date: Thu, 31 Mar 2022 00:16:40 +0300 Subject: [PATCH 1/2] Fix mismatch (char / wchar_t) filling JOB_INFO_* string members --- win32/src/win32print/win32print.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/win32/src/win32print/win32print.cpp b/win32/src/win32print/win32print.cpp index 7dce78a756..d18fba180e 100644 --- a/win32/src/win32print/win32print.cpp +++ b/win32/src/win32print/win32print.cpp @@ -1160,14 +1160,14 @@ BOOL PytoJob(DWORD level, PyObject *pyjobinfo, LPBYTE *pbuf) static char *job1_keys[] = {"JobId", "pPrinterName", "pMachineName", "pUserName", "pDocument", "pDatatype", "pStatus", "Status", "Priority", "Position", "TotalPages", "PagesPrinted", "Submitted", NULL}; - static char *job1_format = "kzzzzzzkkkkk|O:JOB_INFO_1"; + static char *job1_format = "kZZZZZZkkkkk|O:JOB_INFO_1"; static char *job2_keys[] = {"JobId", "pPrinterName", "pMachineName", "pUserName", "pDocument", "pNotifyName", "pDatatype", "pPrintProcessor", "pParameters", "pDriverName", "pDevMode", "pStatus", "pSecurityDescriptor", "Status", "Priority", "Position", "StartTime", "UntilTime", "TotalPages", "Size", "Submitted", "Time", "PagesPrinted", NULL}; - static char *job2_format = "kzzzzzzzzzOzOkkkkkkkOkk:JOB_INFO_2"; + static char *job2_format = "kZZZZZZZZZOZOkkkkkkkOkk:JOB_INFO_2"; static char *job3_keys[] = {"JobId", "NextJobId", "Reserved", NULL}; static char *job3_format = "kk|k:JOB_INFO_3"; From 8506ba13bc35612c39a20ae8c829fa9bd8166469 Mon Sep 17 00:00:00 2001 From: CristiFati Date: Thu, 31 Mar 2022 02:01:25 +0300 Subject: [PATCH 2/2] Update CHANGES.txt --- CHANGES.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index fcc699ab24..493acce1c8 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -13,6 +13,9 @@ Since build 303: break any workarounds which were used, such as using specific encodings in these strings. (#1823, #1833) +* Fixed a bug triggering `win32print.SetJob` to fail due to data type + (`char*` / `wchar_t*`) mismatch (#1849, @CristiFati) + Since build 302: ---------------- * Tweaks to how DLLs are loaded and our installation found, which should