_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.
(*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);
(*ppPrinterInfo)++;
// Free the memory for temporary strings.
- DllFreeSplMem(pwszStrings[0]);
+ DllFreeSplMem(Allocation);
}
static void
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.
(*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);
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);
(*ppPrinterInfo)++;
// Free the memory for temporary strings.
- DllFreeSplMem(pwszStrings[0]);
- DllFreeSplMem(pwszStrings[2]);
+ DllFreeSplMem(Allocation1);
+ DllFreeSplMem(Allocation2);
}
static void
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;
(*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);
(*ppPrinterInfo)++;
// Free the memory for temporary strings.
- DllFreeSplMem(pwszStrings[0]);
+ DllFreeSplMem(Allocation);
}
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);
(*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);
(*ppPrinterInfo)++;
// Free the memory for temporary strings.
- DllFreeSplMem(pwszStrings[0]);
+ DllFreeSplMem(Allocation);
}
static void
{
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);
(*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);
(*ppPrinterInfo)++;
// Free the memory for temporary strings.
- DllFreeSplMem(pwszStrings[0]);
+ DllFreeSplMem(Allocation);
}
static void