https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2e4457f22307063457ec3…
commit 2e4457f22307063457ec3016ae431e50429819ef
Author: Mark Jansen <mark.jansen(a)reactos.org>
AuthorDate: Sun Jan 6 12:18:40 2019 +0100
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sun Jan 6 21:07:09 2019 +0100
[PRINTING] The first argument to PackStrings can be const.
---
.../apitests/spoolss/MarshallDownStructuresArray.c | 2 +-
modules/rostests/apitests/spoolss/PackStrings.c | 4 +-
win32ss/printing/base/spoolss/tools.c | 2 +-
win32ss/printing/include/spoolss.h | 2 +-
win32ss/printing/monitors/localmon/ports.c | 4 +-
win32ss/printing/processors/winprint/main.c | 4 +-
win32ss/printing/providers/localspl/jobs.c | 4 +-
win32ss/printing/providers/localspl/main.c | 2 +-
win32ss/printing/providers/localspl/monitors.c | 4 +-
win32ss/printing/providers/localspl/precomp.h | 2 +-
win32ss/printing/providers/localspl/printers.c | 56 +++++++++++-----------
11 files changed, 43 insertions(+), 43 deletions(-)
diff --git a/modules/rostests/apitests/spoolss/MarshallDownStructuresArray.c
b/modules/rostests/apitests/spoolss/MarshallDownStructuresArray.c
index 7b7deba6f4..e4033b0ac4 100644
--- a/modules/rostests/apitests/spoolss/MarshallDownStructuresArray.c
+++ b/modules/rostests/apitests/spoolss/MarshallDownStructuresArray.c
@@ -32,7 +32,7 @@ START_TEST(MarshallDownStructuresArray)
PPORT_INFO_2W pPortInfo2Copy;
PPORT_INFO_2W pPortInfo2Test;
PBYTE pPortInfoEnd;
- PWSTR pwszStrings[] = { L"PortName", L"MonitorName",
L"Description" };
+ PCWSTR pwszStrings[] = { L"PortName", L"MonitorName",
L"Description" };
DWORD cbPortInfo2Size = cElements * (sizeof(PORT_INFO_2W) + (wcslen(pwszStrings[0]) +
1 + wcslen(pwszStrings[1]) + 1 + wcslen(pwszStrings[2]) + 1) * sizeof(WCHAR));
DWORD fPortType = 1337;
DWORD Reserved = 42;
diff --git a/modules/rostests/apitests/spoolss/PackStrings.c
b/modules/rostests/apitests/spoolss/PackStrings.c
index d0285f432d..d572b5f5e1 100644
--- a/modules/rostests/apitests/spoolss/PackStrings.c
+++ b/modules/rostests/apitests/spoolss/PackStrings.c
@@ -21,8 +21,8 @@ EXAMPLE_STRUCT, *PEXAMPLE_STRUCT;
START_TEST(PackStrings)
{
- PWSTR Source1[] = { L"Test", L"String" };
- PWSTR Source2[] = { L"Test", NULL };
+ PCWSTR Source1[] = { L"Test", L"String" };
+ PCWSTR Source2[] = { L"Test", NULL };
BYTE Buffer[50];
PBYTE pEnd;
diff --git a/win32ss/printing/base/spoolss/tools.c
b/win32ss/printing/base/spoolss/tools.c
index 7b8410a41a..97d781c66a 100644
--- a/win32ss/printing/base/spoolss/tools.c
+++ b/win32ss/printing/base/spoolss/tools.c
@@ -36,7 +36,7 @@
* The strings are copied in reverse order, so this pointer will point to the last copied
string of pSource.
*/
PBYTE WINAPI
-PackStrings(PWSTR* pSource, PBYTE pDest, const DWORD* DestOffsets, PBYTE pEnd)
+PackStrings(PCWSTR* pSource, PBYTE pDest, const DWORD* DestOffsets, PBYTE pEnd)
{
DWORD cbString;
ULONG_PTR StringAddress;
diff --git a/win32ss/printing/include/spoolss.h b/win32ss/printing/include/spoolss.h
index 7e1c132dcf..a16cca49ae 100644
--- a/win32ss/printing/include/spoolss.h
+++ b/win32ss/printing/include/spoolss.h
@@ -63,7 +63,7 @@ PVOID WINAPI DllAllocSplMem(DWORD dwBytes);
BOOL WINAPI DllFreeSplMem(PVOID pMem);
BOOL WINAPI DllFreeSplStr(PWSTR pwszString);
BOOL WINAPI InitializeRouter(HANDLE SpoolerStatusHandle);
-PBYTE WINAPI PackStrings(PWSTR* pSource, PBYTE pDest, const DWORD* DestOffsets, PBYTE
pEnd);
+PBYTE WINAPI PackStrings(PCWSTR* pSource, PBYTE pDest, const DWORD* DestOffsets, PBYTE
pEnd);
PVOID WINAPI ReallocSplMem(PVOID pOldMem, DWORD cbOld, DWORD cbNew);
BOOL WINAPI ReallocSplStr(PWSTR* ppwszString, PCWSTR pwszInput);
BOOL WINAPI SplInitializeWinSpoolDrv(PVOID* pTable);
diff --git a/win32ss/printing/monitors/localmon/ports.c
b/win32ss/printing/monitors/localmon/ports.c
index ab4b7bff49..bee1a22fb2 100644
--- a/win32ss/printing/monitors/localmon/ports.c
+++ b/win32ss/printing/monitors/localmon/ports.c
@@ -374,7 +374,7 @@ static void
_LocalmonGetPortLevel1(PLOCALMON_PORT pPort, PPORT_INFO_1W* ppPortInfo, PBYTE*
ppPortInfoEnd, PDWORD pcbNeeded)
{
DWORD cbPortName;
- PWSTR pwszStrings[1];
+ PCWSTR pwszStrings[1];
// Calculate the string lengths.
if (!ppPortInfo)
@@ -397,7 +397,7 @@ static void
_LocalmonGetPortLevel2(PLOCALMON_PORT pPort, PPORT_INFO_2W* ppPortInfo, PBYTE*
ppPortInfoEnd, PDWORD pcbNeeded)
{
DWORD cbPortName;
- PWSTR pwszStrings[3];
+ PCWSTR pwszStrings[3];
// Calculate the string lengths.
if (!ppPortInfo)
diff --git a/win32ss/printing/processors/winprint/main.c
b/win32ss/printing/processors/winprint/main.c
index 6d0f07313e..4bbe3d6cc5 100644
--- a/win32ss/printing/processors/winprint/main.c
+++ b/win32ss/printing/processors/winprint/main.c
@@ -8,7 +8,7 @@
#include "precomp.h"
// Local Constants
-static PWSTR _pwszDatatypes[] = {
+static PCWSTR _pwszDatatypes[] = {
L"RAW",
0
};
@@ -113,7 +113,7 @@ EnumPrintProcessorDatatypesW(PWSTR pName, PWSTR pPrintProcessorName,
DWORD Level
DWORD cbDatatype;
DWORD dwDatatypeCount = 0;
DWORD dwOffsets[_countof(_pwszDatatypes)];
- PWSTR* pCurrentDatatype;
+ PCWSTR* pCurrentDatatype;
PDWORD pCurrentOffset = dwOffsets;
TRACE("EnumPrintProcessorDatatypesW(%S, %S, %lu, %p, %lu, %p, %p)\n",
pName, pPrintProcessorName, Level, pDatatypes, cbBuf, pcbNeeded, pcReturned);
diff --git a/win32ss/printing/providers/localspl/jobs.c
b/win32ss/printing/providers/localspl/jobs.c
index ea6e219a22..44d11b69f0 100644
--- a/win32ss/printing/providers/localspl/jobs.c
+++ b/win32ss/printing/providers/localspl/jobs.c
@@ -455,7 +455,7 @@ _LocalGetJobLevel1(PLOCAL_JOB pJob, PJOB_INFO_1W* ppJobInfo, PBYTE*
ppJobInfoEnd
DWORD cbPrinterName;
DWORD cbStatus = 0;
DWORD cbUserName = 0;
- PWSTR pwszStrings[6];
+ PCWSTR pwszStrings[6];
// Calculate the string lengths.
if (!ppJobInfo)
@@ -536,7 +536,7 @@ _LocalGetJobLevel2(PLOCAL_JOB pJob, PJOB_INFO_2W* ppJobInfo, PBYTE*
ppJobInfoEnd
DWORD cbUserName = 0;
FILETIME ftNow;
FILETIME ftSubmitted;
- PWSTR pwszStrings[10];
+ PCWSTR pwszStrings[10];
ULARGE_INTEGER uliNow;
ULARGE_INTEGER uliSubmitted;
diff --git a/win32ss/printing/providers/localspl/main.c
b/win32ss/printing/providers/localspl/main.c
index 95105f2a27..7666050446 100644
--- a/win32ss/printing/providers/localspl/main.c
+++ b/win32ss/printing/providers/localspl/main.c
@@ -24,7 +24,7 @@ const DWORD dwSpoolerMinorVersion = 0;
const WCHAR wszDefaultDocumentName[] = L"Local Downlevel Document";
-PWSTR wszPrintProviderInfo[3] = {
+PCWSTR wszPrintProviderInfo[3] = {
L"Windows NT Local Print Providor", // Name
L"Locally connected Printers", // Comment
L"Windows NT Local Printers" // Description
diff --git a/win32ss/printing/providers/localspl/monitors.c
b/win32ss/printing/providers/localspl/monitors.c
index da47850c71..9a04ca7268 100644
--- a/win32ss/printing/providers/localspl/monitors.c
+++ b/win32ss/printing/providers/localspl/monitors.c
@@ -257,7 +257,7 @@ static void
_LocalGetMonitorLevel1(PLOCAL_PRINT_MONITOR pPrintMonitor, PMONITOR_INFO_1W*
ppMonitorInfo, PBYTE* ppMonitorInfoEnd, PDWORD pcbNeeded)
{
DWORD cbMonitorName;
- PWSTR pwszStrings[1];
+ PCWSTR pwszStrings[1];
// Calculate the string lengths.
if (!ppMonitorInfo)
@@ -281,7 +281,7 @@ _LocalGetMonitorLevel2(PLOCAL_PRINT_MONITOR pPrintMonitor,
PMONITOR_INFO_2W* ppM
{
DWORD cbFileName;
DWORD cbMonitorName;
- PWSTR pwszStrings[3];
+ PCWSTR pwszStrings[3];
// Calculate the string lengths.
if (!ppMonitorInfo)
diff --git a/win32ss/printing/providers/localspl/precomp.h
b/win32ss/printing/providers/localspl/precomp.h
index 0c97f22c85..83061a8a8b 100644
--- a/win32ss/printing/providers/localspl/precomp.h
+++ b/win32ss/printing/providers/localspl/precomp.h
@@ -264,7 +264,7 @@ extern const DWORD dwSpoolerMinorVersion;
extern const WCHAR wszDefaultDocumentName[];
extern HKEY hPrintKey;
extern HKEY hPrintersKey;
-extern PWSTR wszPrintProviderInfo[3];
+extern PCWSTR wszPrintProviderInfo[3];
extern WCHAR wszJobDirectory[MAX_PATH];
extern DWORD cchJobDirectory;
extern WCHAR wszSpoolDirectory[MAX_PATH];
diff --git a/win32ss/printing/providers/localspl/printers.c
b/win32ss/printing/providers/localspl/printers.c
index 7c9c2dd3b5..c0140142c6 100644
--- a/win32ss/printing/providers/localspl/printers.c
+++ b/win32ss/printing/providers/localspl/printers.c
@@ -491,8 +491,8 @@ static void
_LocalGetPrinterLevel0(PLOCAL_PRINTER pPrinter, PPRINTER_INFO_STRESS* ppPrinterInfo,
PBYTE* ppPrinterInfoEnd, PDWORD pcbNeeded, DWORD cchComputerName, PCWSTR wszComputerName)
{
size_t cbName;
- PWSTR p;
- PWSTR pwszStrings[1];
+ PWSTR p, Allocation;
+ PCWSTR pwszStrings[1];
SYSTEM_INFO SystemInfo;
// Calculate the string lengths.
@@ -521,8 +521,8 @@ _LocalGetPrinterLevel0(PLOCAL_PRINTER pPrinter, PPRINTER_INFO_STRESS*
ppPrinterI
(*ppPrinterInfo)->wProcessorLevel = SystemInfo.wProcessorLevel;
// Copy the Printer Name.
- pwszStrings[0] = DllAllocSplMem(cbName);
- p = pwszStrings[0];
+ p = Allocation = DllAllocSplMem(cbName);
+ pwszStrings[0] = Allocation;
StringCbCopyExW(p, cbName, wszComputerName, &p, &cbName, 0);
StringCbCopyExW(p, cbName, pPrinter->pwszPrinterName, &p, &cbName, 0);
@@ -531,7 +531,7 @@ _LocalGetPrinterLevel0(PLOCAL_PRINTER pPrinter, PPRINTER_INFO_STRESS*
ppPrinterI
(*ppPrinterInfo)++;
// Free the memory for temporary strings.
- DllFreeSplMem(pwszStrings[0]);
+ DllFreeSplMem(Allocation);
}
static void
@@ -542,8 +542,8 @@ _LocalGetPrinterLevel1(PLOCAL_PRINTER pPrinter, PPRINTER_INFO_1W*
ppPrinterInfo,
size_t cbName;
size_t cbComment;
size_t cbDescription;
- PWSTR p;
- PWSTR pwszStrings[3];
+ PWSTR p, Allocation1, Allocation2;
+ PCWSTR pwszStrings[3];
// Calculate the string lengths.
// Attention: pComment equals the "Description" registry value while
pDescription is concatenated out of several strings.
@@ -562,8 +562,8 @@ _LocalGetPrinterLevel1(PLOCAL_PRINTER pPrinter, PPRINTER_INFO_1W*
ppPrinterInfo,
(*ppPrinterInfo)->Flags = PRINTER_ENUM_ICON8;
// Copy the Printer Name.
- pwszStrings[0] = DllAllocSplMem(cbName);
- p = pwszStrings[0];
+ p = Allocation1 = DllAllocSplMem(cbName);
+ pwszStrings[0] = Allocation1;
StringCbCopyExW(p, cbName, wszComputerName, &p, &cbName, 0);
StringCbCopyExW(p, cbName, pPrinter->pwszPrinterName, &p, &cbName, 0);
@@ -571,8 +571,8 @@ _LocalGetPrinterLevel1(PLOCAL_PRINTER pPrinter, PPRINTER_INFO_1W*
ppPrinterInfo,
pwszStrings[1] = pPrinter->pwszDescription;
// Copy the description, which for PRINTER_INFO_1W has the form "Name,Printer
Driver,Location"
- pwszStrings[2] = DllAllocSplMem(cbDescription);
- p = pwszStrings[2];
+ p = Allocation2 = DllAllocSplMem(cbDescription);
+ pwszStrings[2] = Allocation2;
StringCbCopyExW(p, cbDescription, wszComputerName, &p, &cbDescription, 0);
StringCbCopyExW(p, cbDescription, pPrinter->pwszPrinterName, &p,
&cbDescription, 0);
StringCbCopyExW(p, cbDescription, wszComma, &p, &cbDescription, 0);
@@ -585,8 +585,8 @@ _LocalGetPrinterLevel1(PLOCAL_PRINTER pPrinter, PPRINTER_INFO_1W*
ppPrinterInfo,
(*ppPrinterInfo)++;
// Free the memory for temporary strings.
- DllFreeSplMem(pwszStrings[0]);
- DllFreeSplMem(pwszStrings[2]);
+ DllFreeSplMem(Allocation1);
+ DllFreeSplMem(Allocation2);
}
static void
@@ -605,8 +605,8 @@ _LocalGetPrinterLevel2(PLOCAL_PRINTER pPrinter, PPRINTER_INFO_2W*
ppPrinterInfo,
size_t cbPrintProcessor;
size_t cbDatatype;
size_t cbParameters;
- PWSTR p;
- PWSTR pwszStrings[10];
+ PWSTR p, Allocation;
+ PCWSTR pwszStrings[10];
// Calculate the string lengths.
cbDevMode = pPrinter->pDefaultDevMode->dmSize +
pPrinter->pDefaultDevMode->dmDriverExtra;
@@ -641,8 +641,8 @@ _LocalGetPrinterLevel2(PLOCAL_PRINTER pPrinter, PPRINTER_INFO_2W*
ppPrinterInfo,
(*ppPrinterInfo)->pDevMode = (PDEVMODEW)(*ppPrinterInfoEnd);
// Set the pPrinterName field.
- pwszStrings[0] = DllAllocSplMem(cbPrinterName);
- p = pwszStrings[0];
+ p = Allocation = DllAllocSplMem(cbPrinterName);
+ pwszStrings[0] = Allocation;
StringCbCopyExW(p, cbPrinterName, wszComputerName, &p, &cbPrinterName, 0);
StringCbCopyExW(p, cbPrinterName, pPrinter->pwszPrinterName, &p,
&cbPrinterName, 0);
@@ -678,7 +678,7 @@ _LocalGetPrinterLevel2(PLOCAL_PRINTER pPrinter, PPRINTER_INFO_2W*
ppPrinterInfo,
(*ppPrinterInfo)++;
// Free the memory for temporary strings.
- DllFreeSplMem(pwszStrings[0]);
+ DllFreeSplMem(Allocation);
}
static void
@@ -707,8 +707,8 @@ static void
_LocalGetPrinterLevel4(PLOCAL_PRINTER pPrinter, PPRINTER_INFO_4W* ppPrinterInfo, PBYTE*
ppPrinterInfoEnd, PDWORD pcbNeeded, DWORD cchComputerName, PCWSTR wszComputerName)
{
size_t cbPrinterName;
- PWSTR p;
- PWSTR pwszStrings[1];
+ PWSTR p, Allocation;
+ PCWSTR pwszStrings[1];
// Calculate the string lengths.
cbPrinterName = (cchComputerName + wcslen(pPrinter->pwszPrinterName) + 1) *
sizeof(WCHAR);
@@ -724,8 +724,8 @@ _LocalGetPrinterLevel4(PLOCAL_PRINTER pPrinter, PPRINTER_INFO_4W*
ppPrinterInfo,
(*ppPrinterInfo)->Attributes = pPrinter->dwAttributes;
// Set the pPrinterName field.
- pwszStrings[0] = DllAllocSplMem(cbPrinterName);
- p = pwszStrings[0];
+ p = Allocation = DllAllocSplMem(cbPrinterName);
+ pwszStrings[0] = Allocation;
StringCbCopyExW(p, cbPrinterName, wszComputerName, &p, &cbPrinterName, 0);
StringCbCopyExW(p, cbPrinterName, pPrinter->pwszPrinterName, &p,
&cbPrinterName, 0);
@@ -734,7 +734,7 @@ _LocalGetPrinterLevel4(PLOCAL_PRINTER pPrinter, PPRINTER_INFO_4W*
ppPrinterInfo,
(*ppPrinterInfo)++;
// Free the memory for temporary strings.
- DllFreeSplMem(pwszStrings[0]);
+ DllFreeSplMem(Allocation);
}
static void
@@ -742,8 +742,8 @@ _LocalGetPrinterLevel5(PLOCAL_PRINTER pPrinter, PPRINTER_INFO_5W*
ppPrinterInfo,
{
size_t cbPrinterName;
size_t cbPortName;
- PWSTR p;
- PWSTR pwszStrings[2];
+ PWSTR p, Allocation;
+ PCWSTR pwszStrings[2];
// Calculate the string lengths.
cbPrinterName = (cchComputerName + wcslen(pPrinter->pwszPrinterName) + 1) *
sizeof(WCHAR);
@@ -762,8 +762,8 @@ _LocalGetPrinterLevel5(PLOCAL_PRINTER pPrinter, PPRINTER_INFO_5W*
ppPrinterInfo,
(*ppPrinterInfo)->TransmissionRetryTimeout = dwTransmissionRetryTimeout;
// Set the pPrinterName field.
- pwszStrings[0] = DllAllocSplMem(cbPrinterName);
- p = pwszStrings[0];
+ p = Allocation = DllAllocSplMem(cbPrinterName);
+ pwszStrings[0] = Allocation;
StringCbCopyExW(p, cbPrinterName, wszComputerName, &p, &cbPrinterName, 0);
StringCbCopyExW(p, cbPrinterName, pPrinter->pwszPrinterName, &p,
&cbPrinterName, 0);
@@ -775,7 +775,7 @@ _LocalGetPrinterLevel5(PLOCAL_PRINTER pPrinter, PPRINTER_INFO_5W*
ppPrinterInfo,
(*ppPrinterInfo)++;
// Free the memory for temporary strings.
- DllFreeSplMem(pwszStrings[0]);
+ DllFreeSplMem(Allocation);
}
static void