From 1cf31524d509fd9810a8c0a86299db1e2f31ce6f Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 18 May 2024 18:08:12 +0300 Subject: [PATCH] [REACTOS] Stop using non-conforming swprintf / vswprintf Use the underscored versions instead. --- base/applications/cmdutils/at/at.c | 8 +- base/applications/cmdutils/mode/mode.c | 10 +- base/applications/cmdutils/tree/tree.c | 20 +-- base/applications/dxdiag/d3dtest.c | 2 +- base/applications/fontview/display.c | 20 +-- .../applications/mscutils/eventvwr/eventvwr.c | 2 +- .../mscutils/eventvwr/evtdetctl.c | 18 +-- base/applications/network/ipconfig/ipconfig.c | 12 +- base/applications/network/net/cmdUse.c | 2 +- base/applications/network/net/main.c | 2 +- base/applications/network/netsh/help.c | 2 +- base/applications/network/netsh/netsh.c | 2 +- base/applications/rapps/integrity.cpp | 2 +- base/services/dnsrslvr/hostsfile.c | 12 +- base/services/schedsvc/job.c | 2 +- base/services/tcpsvcs/discard.c | 2 +- base/services/tcpsvcs/echo.c | 4 +- base/services/tcpsvcs/skelserver.c | 30 ++-- base/services/tcpsvcs/tcpsvcs.c | 6 +- base/services/umpnpmgr/install.c | 2 +- base/services/umpnpmgr/rpcserver.c | 12 +- base/setup/usetup/cmdcons.c | 6 +- base/setup/usetup/usetup.c | 2 +- base/shell/cmd/console.c | 2 +- base/shell/cmd/error.c | 2 +- base/system/autochk/autochk.c | 2 +- base/system/diskpart/detail.c | 4 +- base/system/diskpart/dump.c | 14 +- base/system/diskpart/list.c | 2 +- base/system/diskpart/misc.c | 26 ++-- base/system/diskpart/mountmgr.c | 4 +- base/system/diskpart/uniqueid.c | 2 +- base/system/services/controlset.c | 6 +- base/system/smss/sminit.c | 10 +- base/system/userinit/livecd.c | 4 +- base/system/winlogon/shutdown.c | 4 +- base/system/winlogon/winlogon.c | 2 +- dll/cpl/sysdm/hardprof.c | 6 +- dll/cpl/sysdm/startrec.c | 2 +- dll/cpl/sysdm/userprofile.c | 2 +- dll/cpl/timedate/monthcal.c | 4 +- dll/cpl/timedate/timedate.c | 2 +- dll/directx/bdaplgin/controlnode.cpp | 8 +- dll/directx/bdaplgin/devicecontrol.cpp | 28 ++-- dll/directx/bdaplgin/digitaldemo.cpp | 16 +- dll/directx/bdaplgin/frequencyfilter.cpp | 12 +- dll/directx/bdaplgin/lnbinfo.cpp | 8 +- dll/directx/bdaplgin/pincontrol.cpp | 6 +- dll/directx/bdaplgin/signalstatistics.cpp | 12 +- dll/directx/ksproxy/classfactory.cpp | 2 +- dll/directx/ksproxy/clockforward.cpp | 4 +- dll/directx/ksproxy/enum_mediatypes.cpp | 2 +- dll/directx/ksproxy/enumpins.cpp | 2 +- dll/directx/ksproxy/input_pin.cpp | 12 +- dll/directx/ksproxy/interface.cpp | 2 +- dll/directx/ksproxy/output_pin.cpp | 58 +++---- dll/directx/ksproxy/proxy.cpp | 56 +++---- dll/directx/msdvbnp/enum_mediatypes.cpp | 4 +- dll/directx/msdvbnp/enumpins.cpp | 2 +- dll/directx/msdvbnp/networkprovider.cpp | 6 +- dll/directx/msdvbnp/pin.cpp | 4 +- dll/directx/msdvbnp/scanningtuner.cpp | 22 +-- dll/directx/msvidctl/enumtuningspaces.cpp | 4 +- dll/directx/msvidctl/tunerequest.cpp | 14 +- dll/directx/msvidctl/tuningspace.cpp | 8 +- .../msvidctl/tuningspace_container.cpp | 4 +- dll/shellext/netshell/connectmanager.cpp | 4 +- dll/shellext/netshell/lanconnectui.cpp | 4 +- dll/shellext/netshell/lanstatusui.cpp | 26 ++-- dll/shellext/stobject/hotplug.cpp | 4 +- dll/win32/advapi32/misc/hwprofiles.c | 23 ++- dll/win32/advapi32/service/sctrl.c | 2 +- dll/win32/avicap32/avicap32.c | 10 +- dll/win32/devmgr/properties/advprop.cpp | 20 +-- dll/win32/kernel32/client/dllmain.c | 10 +- dll/win32/kernel32/client/file/npipe.c | 8 +- dll/win32/msafd/misc/dllmain.c | 14 +- dll/win32/msports/classinst.c | 32 ++-- dll/win32/msports/parallel.c | 18 +-- dll/win32/msports/serial.c | 12 +- dll/win32/netcfgx/netcfg_iface.c | 4 +- dll/win32/netcfgx/tcpipconf_notify.c | 40 ++--- dll/win32/newdev/newdev.c | 2 +- dll/win32/samsrv/alias.c | 2 +- dll/win32/samsrv/group.c | 2 +- dll/win32/samsrv/samrpc.c | 16 +- dll/win32/samsrv/setup.c | 14 +- dll/win32/samsrv/user.c | 2 +- dll/win32/shell32/COpenWithMenu.cpp | 2 +- dll/win32/shell32/dialogs/drvdefext.cpp | 2 +- dll/win32/shell32/dialogs/filedefext.cpp | 14 +- dll/win32/shell32/dialogs/recycler_prop.cpp | 6 +- .../shell32/droptargets/CFSDropTarget.cpp | 8 +- dll/win32/shell32/folders/CRecycleBin.cpp | 2 +- dll/win32/shell32/shell32.cpp | 2 +- .../shellrecyclebin/recyclebin_generic.cpp | 4 +- dll/win32/shell32/shfldr.h | 2 +- dll/win32/shell32/shlexec.cpp | 6 +- dll/win32/shell32/shlfolder.cpp | 4 +- dll/win32/syssetup/logfile.c | 8 +- dll/win32/syssetup/wizard.c | 4 +- dll/win32/userenv/profile.c | 2 +- drivers/bluetooth/fbtusb/fbtusb.c | 6 +- drivers/bus/acpi/acpienum.c | 4 +- drivers/bus/acpi/buspdo.c | 64 ++++---- drivers/bus/acpi/main.c | 14 +- drivers/bus/pci/pci.c | 142 +++++++++--------- drivers/bus/pcix/arb/arb_comn.c | 8 +- drivers/bus/pcix/pci/id.c | 10 +- drivers/bus/pcix/pdo.c | 2 +- drivers/bus/pcix/utils.c | 16 +- drivers/hid/hidclass/hidclass.c | 2 +- drivers/hid/hidclass/pdo.c | 24 +-- drivers/input/kbdclass/kbdclass.c | 2 +- drivers/input/mouclass/mouclass.c | 2 +- drivers/ksfilter/ks/swenum.c | 4 +- drivers/parallel/parport/fdo.c | 16 +- drivers/processor/processr/pnp.c | 2 +- drivers/sac/driver/concmd.c | 4 +- drivers/sac/driver/conmgr.c | 4 +- drivers/sac/driver/util.c | 86 +++++------ drivers/serial/serial/pnp.c | 10 +- drivers/storage/floppy/fdc/fdo.c | 12 +- drivers/storage/floppy/floppy/floppy.c | 6 +- drivers/storage/floppy/floppy/floppy.h | 2 +- drivers/storage/partmgr/partition.c | 44 +++--- drivers/storage/port/scsiport/fdo.c | 4 +- drivers/storage/port/scsiport/pdo.c | 2 +- drivers/storage/port/scsiport/registry.c | 32 ++-- drivers/storage/port/scsiport/scsiport.c | 10 +- drivers/storage/port/storport/storport.c | 6 +- drivers/usb/usbccgp/function.c | 66 +++++--- drivers/usb/usbccgp/pdo.c | 6 +- drivers/usb/usbstor_new/pdo.c | 4 +- .../audio/backpln/portcls/miniport_dmus.cpp | 2 +- drivers/wdm/audio/backpln/portcls/undoc.cpp | 4 +- drivers/wdm/audio/legacy/wdmaud/sup.c | 2 +- hal/halx86/legacy/bussupp.c | 2 +- .../applications/cmdutils/arping/arping.c | 18 ++- .../sysutils/systeminfo/systeminfo.c | 14 +- .../sysutils/utils/partinfo/partinfo.c | 2 +- .../vcdcontroltool/vcdcontroltool.c | 2 +- modules/rostests/apitests/apphelp/db.cpp | 14 +- .../kernel32/GetFinalPathNameByHandle.c | 8 +- .../apitests/kernel32/GetModuleFileName.c | 2 +- modules/rostests/apitests/ntdll/NtDeleteKey.c | 8 +- .../ntdll/RtlComputePrivatizedDllName_U.c | 4 +- .../apitests/ntdll/RtlDoesFileExists.c | 28 ++-- .../ntdll/RtlDosPathNameToNtPathName_U.c | 6 +- .../apitests/ntdll/RtlDosSearchPath_U.c | 18 +-- modules/rostests/apitests/ntdll/sprintf.c | 2 +- .../apitests/shell32/Control_RunDLLW.cpp | 2 +- .../apitests/user32/RegisterClassEx.c | 4 +- modules/rostests/rosautotest/CPipe.cpp | 2 +- modules/rostests/tests/parttest/parttest.c | 4 +- .../comctl32/buttonvistest/buttonvistest.cpp | 4 +- ntoskrnl/ex/locale.c | 20 +-- ntoskrnl/fstub/disksup.c | 34 ++--- ntoskrnl/io/iomgr/bootlog.c | 15 +- ntoskrnl/io/iomgr/device.c | 6 +- ntoskrnl/io/iomgr/driver.c | 6 +- ntoskrnl/io/pnpmgr/devaction.c | 2 +- ntoskrnl/io/pnpmgr/pnpmap.c | 2 +- ntoskrnl/io/pnpmgr/pnpreport.c | 14 +- ntoskrnl/ntoskrnl.spec | 1 + sdk/include/crt/tchar.h | 2 +- sdk/lib/atl/cstringt.h | 2 +- sdk/lib/rtl/atom.c | 6 +- sdk/lib/rtl/sid.c | 32 ++-- sdk/lib/rtl/unicode.c | 26 ++-- subsystems/csr/csrsrv/init.c | 8 +- subsystems/win/basesrv/init.c | 2 +- win32ss/drivers/videoprt/child.c | 12 +- win32ss/drivers/videoprt/registry.c | 2 +- win32ss/drivers/videoprt/videoprt.c | 6 +- win32ss/gdi/eng/device.c | 4 +- .../printing/monitors/localmon/ui/localui.c | 6 +- win32ss/printing/providers/localspl/jobs.c | 2 +- win32ss/user/ntuser/display.c | 2 +- win32ss/user/ntuser/kbdlayout.c | 2 +- win32ss/user/user32/misc/dllmain.c | 10 +- win32ss/user/winsrv/concfg/precomp.h | 2 +- win32ss/user/winsrv/concfg/settings.c | 2 +- 183 files changed, 964 insertions(+), 943 deletions(-) diff --git a/base/applications/cmdutils/at/at.c b/base/applications/cmdutils/at/at.c index c9c39014ac5..9d3b784b149 100644 --- a/base/applications/cmdutils/at/at.c +++ b/base/applications/cmdutils/at/at.c @@ -472,7 +472,7 @@ PrintJobDetails( { if (pBuffer->DaysOfMonth & (1 << i)) { - swprintf(szDateBuffer, L" %d", i + 1); + _swprintf(szDateBuffer, L" %d", i + 1); nDateLength = wcslen(szDateBuffer); if (nScheduleLength + nDateLength <= 55) { @@ -499,7 +499,7 @@ PrintJobDetails( { if (pBuffer->DaysOfWeek & (1 << i)) { - swprintf(szDateBuffer, L" %s", pszDaysOfWeekArray[i]); + _swprintf(szDateBuffer, L" %s", pszDaysOfWeekArray[i]); nDateLength = wcslen(szDateBuffer); if (nScheduleLength + nDateLength <= 55) { @@ -597,7 +597,7 @@ PrintAllJobs( { if (pBuffer[i].DaysOfMonth & (1 << j)) { - swprintf(szDateBuffer, L" %d", j + 1); + _swprintf(szDateBuffer, L" %d", j + 1); nDateLength = wcslen(szDateBuffer); if (nScheduleLength + nDateLength <= 19) { @@ -624,7 +624,7 @@ PrintAllJobs( { if (pBuffer[i].DaysOfWeek & (1 << j)) { - swprintf(szDateBuffer, L" %s", pszDaysOfWeekArray[j]); + _swprintf(szDateBuffer, L" %s", pszDaysOfWeekArray[j]); nDateLength = wcslen(szDateBuffer); if (nScheduleLength + nDateLength <= 55) { diff --git a/base/applications/cmdutils/mode/mode.c b/base/applications/cmdutils/mode/mode.c index ef94cd15568..b17e8a1a2e7 100644 --- a/base/applications/cmdutils/mode/mode.c +++ b/base/applications/cmdutils/mode/mode.c @@ -76,7 +76,7 @@ int ShowParallelStatus(INT nPortNum) WCHAR buffer[250]; WCHAR szPortName[MAX_PORTNAME_LEN]; - swprintf(szPortName, L"LPT%d", nPortNum); + _swprintf(szPortName, L"LPT%d", nPortNum); ConPuts(StdOut, L"\n"); UnderlinedResPrintf(StdOut, IDS_DEVICE_STATUS_HEADER, szPortName); @@ -113,8 +113,8 @@ int SetParallelState(INT nPortNum) WCHAR szPortName[MAX_PORTNAME_LEN]; WCHAR szTargetPath[MAX_PORTNAME_LEN]; - swprintf(szPortName, L"LPT%d", nPortNum); - swprintf(szTargetPath, L"COM%d", nPortNum); + _swprintf(szPortName, L"LPT%d", nPortNum); + _swprintf(szTargetPath, L"COM%d", nPortNum); if (!DefineDosDeviceW(DDD_REMOVE_DEFINITION, szPortName, szTargetPath)) { ConPrintf(StdErr, L"ERROR: SetParallelState(%d) - DefineDosDevice(%s) failed: 0x%lx\n", nPortNum, szPortName, GetLastError()); @@ -528,7 +528,7 @@ SerialPortQuery(INT nPortNum, LPDCB pDCB, LPCOMMTIMEOUTS pCommTimeouts, BOOL bWr ASSERT(pDCB); ASSERT(pCommTimeouts); - swprintf(szPortName, L"COM%d", nPortNum); + _swprintf(szPortName, L"COM%d", nPortNum); hPort = CreateFileW(szPortName, bWrite ? GENERIC_WRITE : GENERIC_READ, 0, // exclusive @@ -604,7 +604,7 @@ int ShowSerialStatus(INT nPortNum) dcb.StopBits = 0; } - swprintf(szPortName, L"COM%d", nPortNum); + _swprintf(szPortName, L"COM%d", nPortNum); ConPuts(StdOut, L"\n"); UnderlinedResPrintf(StdOut, IDS_DEVICE_STATUS_HEADER, szPortName); diff --git a/base/applications/cmdutils/tree/tree.c b/base/applications/cmdutils/tree/tree.c index a8012c7451e..6f65a16b7f9 100644 --- a/base/applications/cmdutils/tree/tree.c +++ b/base/applications/cmdutils/tree/tree.c @@ -136,9 +136,9 @@ static VOID DrawTree(PCWSTR strPath, { /* Add '├───Folder name' (\xC3\xC4\xC4\xC4 or \x251C\x2500\x2500\x2500) */ if (bUseAscii) - swprintf(str, L"+---%s", arrFolder[i].cFileName); + _swprintf(str, L"+---%s", arrFolder[i].cFileName); else - swprintf(str, L"\x251C\x2500\x2500\x2500%s", arrFolder[i].cFileName); + _swprintf(str, L"\x251C\x2500\x2500\x2500%s", arrFolder[i].cFileName); } else { @@ -147,14 +147,14 @@ static VOID DrawTree(PCWSTR strPath, /* Add '│ FileName' (\xB3 or \x2502) */ // This line is added to connect the below-folder sub-structure if (bUseAscii) - swprintf(str, L"| %s", arrFolder[i].cFileName); + _swprintf(str, L"| %s", arrFolder[i].cFileName); else - swprintf(str, L"\x2502 %s", arrFolder[i].cFileName); + _swprintf(str, L"\x2502 %s", arrFolder[i].cFileName); } else { /* Add ' FileName' */ - swprintf(str, L" %s", arrFolder[i].cFileName); + _swprintf(str, L" %s", arrFolder[i].cFileName); } } } @@ -164,9 +164,9 @@ static VOID DrawTree(PCWSTR strPath, { /* '└───Folder name' (\xC0\xC4\xC4\xC4 or \x2514\x2500\x2500\x2500) */ if (bUseAscii) - swprintf(str, L"\\---%s", arrFolder[i].cFileName); + _swprintf(str, L"\\---%s", arrFolder[i].cFileName); else - swprintf(str, L"\x2514\x2500\x2500\x2500%s", arrFolder[i].cFileName); + _swprintf(str, L"\x2514\x2500\x2500\x2500%s", arrFolder[i].cFileName); } else { @@ -174,14 +174,14 @@ static VOID DrawTree(PCWSTR strPath, { /* '│ FileName' (\xB3 or \x2502) */ if (bUseAscii) - swprintf(str, L"| %s", arrFolder[i].cFileName); + _swprintf(str, L"| %s", arrFolder[i].cFileName); else - swprintf(str, L"\x2502 %s", arrFolder[i].cFileName); + _swprintf(str, L"\x2502 %s", arrFolder[i].cFileName); } else { /* ' FileName' */ - swprintf(str, L" %s", arrFolder[i].cFileName); + _swprintf(str, L" %s", arrFolder[i].cFileName); } } } diff --git a/base/applications/dxdiag/d3dtest.c b/base/applications/dxdiag/d3dtest.c index 8b7b2bfbd8f..f28db92b24c 100644 --- a/base/applications/dxdiag/d3dtest.c +++ b/base/applications/dxdiag/d3dtest.c @@ -31,7 +31,7 @@ BOOL StartD3DTest(GUID *lpDevice, HWND hWnd, HINSTANCE hInstance, WCHAR* pszCapt LoadStringW(hInstance, IDS_D3DTEST_D3Dx, szTestDescriptionRaw, sizeof(szTestDescriptionRaw) / sizeof(WCHAR)); //LoadStringW(hInstance, resResult, szResult, sizeof(szResult) / sizeof(WCHAR)); - swprintf(szTestDescription, szTestDescriptionRaw, TestNr); + _swprintf(szTestDescription, szTestDescriptionRaw, TestNr); if (MessageBox(NULL, szTestDescription, szCaption, MB_YESNO | MB_ICONQUESTION) == IDNO) return FALSE; diff --git a/base/applications/fontview/display.c b/base/applications/fontview/display.c index 0c4f771b27e..3cad5ca87a1 100644 --- a/base/applications/fontview/display.c +++ b/base/applications/fontview/display.c @@ -78,7 +78,7 @@ Display_DrawText(HDC hDC, DISPLAYDATA* pData, int nYPos) hOldFont = SelectObject(hDC, pData->hCaptionFont); GetTextMetrics(hDC, &tm); - swprintf(szCaption, L"%s%s", pData->szTypeFaceName, pData->szFormat); + _swprintf(szCaption, L"%s%s", pData->szTypeFaceName, pData->szFormat); TextOutW(hDC, 0, y, szCaption, (INT)wcslen(szCaption)); y += tm.tmHeight + SPACING1; @@ -93,15 +93,15 @@ Display_DrawText(HDC hDC, DISPLAYDATA* pData, int nYPos) /* Output Character set */ SelectObject(hDC, pData->hCharSetFont); GetTextMetrics(hDC, &tm); - swprintf(szCaption, L"abcdefghijklmnopqrstuvwxyz"); + _swprintf(szCaption, L"abcdefghijklmnopqrstuvwxyz"); TextOutW(hDC, 0, y, szCaption, (INT)wcslen(szCaption)); y += tm.tmHeight + 1; - swprintf(szCaption, L"ABCDEFGHIJKLMNOPQRSTUVWXYZ"); + _swprintf(szCaption, L"ABCDEFGHIJKLMNOPQRSTUVWXYZ"); TextOutW(hDC, 0, y, szCaption, (INT)wcslen(szCaption)); y += tm.tmHeight + 1; - swprintf(szCaption, L"0123456789.:,;(\"~!@#$%%^&*')"); + _swprintf(szCaption, L"0123456789.:,;(\"~!@#$%%^&*')"); TextOutW(hDC, 0, y, szCaption, (INT)wcslen(szCaption)); y += tm.tmHeight + 1; @@ -119,7 +119,7 @@ Display_DrawText(HDC hDC, DISPLAYDATA* pData, int nYPos) GetTextMetrics(hDC, &tm); y += tm.tmHeight + 1; SelectObject(hDC, pData->hSizeFont); - swprintf(szSize, L"%d", pData->nSizes[i]); + _swprintf(szSize, L"%d", pData->nSizes[i]); TextOutW(hDC, 0, y - 13 - tm.tmDescent, szSize, (INT)wcslen(szSize)); } SelectObject(hDC, hOldFont); @@ -199,17 +199,17 @@ Display_SetTypeFace(HWND hwnd, PLOGFONTW pLogFont) EnumFontFamProcW, (LPARAM)&fOpenType, 0); if (fOpenType) - swprintf(pData->szFormat, L" (OpenType)"); + _swprintf(pData->szFormat, L" (OpenType)"); else - swprintf(pData->szFormat, L" (TrueType)"); + _swprintf(pData->szFormat, L" (TrueType)"); } else if (tm.tmPitchAndFamily & TMPF_VECTOR) { - swprintf(pData->szFormat, L" (Vector)"); + _swprintf(pData->szFormat, L" (Vector)"); } else { - swprintf(pData->szFormat, L" (Raster)"); + _swprintf(pData->szFormat, L" (Raster)"); } for (i = 0; i < MAX_SIZES; i++) @@ -518,7 +518,7 @@ Display_GetFullName(HWND hwnd, INT length, PWSTR ptr) if (ptr != NULL && length >= len) { - swprintf(ptr, L"%s%s", pData->szTypeFaceName, pData->szFormat); + _swprintf(ptr, L"%s%s", pData->szTypeFaceName, pData->szFormat); } return (LRESULT)len; diff --git a/base/applications/mscutils/eventvwr/eventvwr.c b/base/applications/mscutils/eventvwr/eventvwr.c index 1171734340c..2e5f54654b9 100644 --- a/base/applications/mscutils/eventvwr/eventvwr.c +++ b/base/applications/mscutils/eventvwr/eventvwr.c @@ -1109,7 +1109,7 @@ FormatInteger(LONGLONG Num, LPWSTR pwszResult, UINT cchResultMax) INT i; // Print the number in uniform mode - swprintf(wszNumber, L"%I64u", Num); + _swprintf(wszNumber, L"%I64u", Num); // Get system strings for decimal and thousand separators. GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, wszDecimalSep, _countof(wszDecimalSep)); diff --git a/base/applications/mscutils/eventvwr/evtdetctl.c b/base/applications/mscutils/eventvwr/evtdetctl.c index e1948399291..d76bd2511aa 100644 --- a/base/applications/mscutils/eventvwr/evtdetctl.c +++ b/base/applications/mscutils/eventvwr/evtdetctl.c @@ -131,25 +131,25 @@ PrintByteDataLine(PWCHAR pBuffer, UINT uOffset, PBYTE pData, UINT uLength) if (uOffset != 0) { - n = swprintf(p, L"\r\n"); + n = _swprintf(p, L"\r\n"); p += n; r += n; } - n = swprintf(p, L"%04lx:", uOffset); + n = _swprintf(p, L"%04lx:", uOffset); p += n; r += n; for (i = 0; i < uLength; i++) { - n = swprintf(p, L" %02x", pData[i]); + n = _swprintf(p, L" %02x", pData[i]); p += n; r += n; } for (i = 0; i < 9 - uLength; i++) { - n = swprintf(p, L" "); + n = _swprintf(p, L" "); p += n; r += n; } @@ -157,7 +157,7 @@ PrintByteDataLine(PWCHAR pBuffer, UINT uOffset, PBYTE pData, UINT uLength) for (i = 0; i < uLength; i++) { // NOTE: Normally iswprint should return FALSE for tabs... - n = swprintf(p, L"%c", (iswprint(pData[i]) && (pData[i] != L'\t')) ? pData[i] : L'.'); + n = _swprintf(p, L"%c", (iswprint(pData[i]) && (pData[i] != L'\t')) ? pData[i] : L'.'); p += n; r += n; } @@ -174,18 +174,18 @@ PrintWordDataLine(PWCHAR pBuffer, UINT uOffset, PULONG pData, UINT uLength) if (uOffset != 0) { - n = swprintf(p, L"\r\n"); + n = _swprintf(p, L"\r\n"); p += n; r += n; } - n = swprintf(p, L"%04lx:", uOffset); + n = _swprintf(p, L"%04lx:", uOffset); p += n; r += n; for (i = 0; i < uLength / sizeof(ULONG); i++) { - n = swprintf(p, L" %08lx", pData[i]); + n = _swprintf(p, L" %08lx", pData[i]); p += n; r += n; } @@ -193,7 +193,7 @@ PrintWordDataLine(PWCHAR pBuffer, UINT uOffset, PULONG pData, UINT uLength) /* Display the remaining bytes if uLength was not a multiple of sizeof(ULONG) */ for (i = (uLength / sizeof(ULONG)) * sizeof(ULONG); i < uLength; i++) { - n = swprintf(p, L" %02x", ((PBYTE)pData)[i]); + n = _swprintf(p, L" %02x", ((PBYTE)pData)[i]); p += n; r += n; } diff --git a/base/applications/network/ipconfig/ipconfig.c b/base/applications/network/ipconfig/ipconfig.c index ff693e1cde4..3e56c754dcc 100644 --- a/base/applications/network/ipconfig/ipconfig.c +++ b/base/applications/network/ipconfig/ipconfig.c @@ -115,7 +115,7 @@ GetRecordTypeName(WORD wType) return TypeArray[i].pszRecordName; } - swprintf(szType, L"%hu", wType); + _swprintf(szType, L"%hu", wType); return szType; } @@ -289,7 +289,7 @@ GetInterfaceFriendlyName( if (PathSize > _countof(Path)) return; - swprintf(Path, L"%s%s%s", PrePath, &lpDeviceName[dwPrefixLength], PostPath); + _swprintf(Path, L"%s%s%s", PrePath, &lpDeviceName[dwPrefixLength], PostPath); if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, Path, @@ -366,7 +366,7 @@ PrintAdapterDescription(PSTR lpClass) if (lpPath == NULL) goto CLEANUP; - swprintf(lpPath, L"%s%s", szPrePath, szName); + _swprintf(lpPath, L"%s%s", szPrePath, szName); //MessageBox(NULL, lpPath, NULL, 0); @@ -1276,9 +1276,9 @@ SetClassId( if (pFoundAdapter) { - swprintf(szKeyName, - L"System\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\%S", - pFoundAdapter->AdapterName); + _swprintf(szKeyName, + L"System\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\%S", + pFoundAdapter->AdapterName); ret = RegOpenKeyExW(HKEY_LOCAL_MACHINE, szKeyName, diff --git a/base/applications/network/net/cmdUse.c b/base/applications/network/net/cmdUse.c index 2cec69f9e8c..e75fab20230 100644 --- a/base/applications/network/net/cmdUse.c +++ b/base/applications/network/net/cmdUse.c @@ -70,7 +70,7 @@ PrintError(DWORD Status) WCHAR szStatusBuffer[16]; LPWSTR Buffer; - swprintf(szStatusBuffer, L"%lu", Status); + _swprintf(szStatusBuffer, L"%lu", Status); PrintMessageStringV(3502, szStatusBuffer); if (FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | diff --git a/base/applications/network/net/main.c b/base/applications/network/net/main.c index 3c33d1fbedd..53312521574 100644 --- a/base/applications/network/net/main.c +++ b/base/applications/network/net/main.c @@ -182,7 +182,7 @@ PrintErrorMessage( if (dwError != ERROR_SUCCESS) { /* Format insert for the 3514 message */ - swprintf(szErrorBuffer, L"%lu", dwError); + _swprintf(szErrorBuffer, L"%lu", dwError); pErrorInserts[0] = szErrorBuffer; /* Format and print the 3514 message */ diff --git a/base/applications/network/netsh/help.c b/base/applications/network/netsh/help.c index d06599c5d84..e153cdf8dd3 100644 --- a/base/applications/network/netsh/help.c +++ b/base/applications/network/netsh/help.c @@ -90,7 +90,7 @@ PrintShortGroupCommands( pCommand = pGroup->pCommandListHead; while (pCommand != NULL) { - swprintf(szBuffer1, L"%s %s", pGroup->pwszCmdGroupToken, pCommand->pwszCmdToken); + _swprintf(szBuffer1, L"%s %s", pGroup->pwszCmdGroupToken, pCommand->pwszCmdToken); LoadStringW(pContext->hModule, pCommand->dwShortCmdHelpToken, szBuffer2, _countof(szBuffer2)); ConPrintf(StdOut, L"%-15s - %s", szBuffer1, szBuffer2); diff --git a/base/applications/network/netsh/netsh.c b/base/applications/network/netsh/netsh.c index c7e48e94552..e7544c5d46d 100644 --- a/base/applications/network/netsh/netsh.c +++ b/base/applications/network/netsh/netsh.c @@ -296,7 +296,7 @@ MakeQuotedString( if (pszQuotedString == NULL) return NULL; - swprintf(pszQuotedString, L"\"%s\"", pszString); + _swprintf(pszQuotedString, L"\"%s\"", pszString); return pszQuotedString; } diff --git a/base/applications/rapps/integrity.cpp b/base/applications/rapps/integrity.cpp index caae4c96dfe..e77bb2dbd37 100644 --- a/base/applications/rapps/integrity.cpp +++ b/base/applications/rapps/integrity.cpp @@ -49,7 +49,7 @@ VerifyInteg(LPCWSTR lpSHA1Hash, LPCWSTR lpFileName) WCHAR buf[(sizeof(sha) * 2) + 1]; for (UINT i = 0; i < sizeof(sha); i++) - swprintf(buf + 2 * i, L"%02x", ((unsigned char *)sha)[i]); + _swprintf(buf + 2 * i, L"%02x", ((unsigned char *)sha)[i]); /* does the resulting SHA1 match with the provided one? */ if (!_wcsicmp(buf, lpSHA1Hash)) ret = TRUE; diff --git a/base/services/dnsrslvr/hostsfile.c b/base/services/dnsrslvr/hostsfile.c index 62554b91aa2..469f469e873 100644 --- a/base/services/dnsrslvr/hostsfile.c +++ b/base/services/dnsrslvr/hostsfile.c @@ -112,12 +112,12 @@ AddIpv4HostEntries( ARecord.Data.A.IpAddress = pAddress->S_un.S_addr; /* Prepare the PTR record */ - swprintf(szReverseName, - L"%u.%u.%u.%u.in-addr.arpa.", - pAddress->S_un.S_un_b.s_b4, - pAddress->S_un.S_un_b.s_b3, - pAddress->S_un.S_un_b.s_b2, - pAddress->S_un.S_un_b.s_b1); + _swprintf(szReverseName, + L"%u.%u.%u.%u.in-addr.arpa.", + pAddress->S_un.S_un_b.s_b4, + pAddress->S_un.S_un_b.s_b3, + pAddress->S_un.S_un_b.s_b2, + pAddress->S_un.S_un_b.s_b1); ZeroMemory(&PtrRecord, sizeof(DNS_RECORDW)); diff --git a/base/services/schedsvc/job.c b/base/services/schedsvc/job.c index cdf84f7f8c7..f5579838d12 100644 --- a/base/services/schedsvc/job.c +++ b/base/services/schedsvc/job.c @@ -192,7 +192,7 @@ GetJobName( for (;;) { ulValue = RtlRandomEx(&ulSeed); - swprintf(szNameBuffer, L"%08lx", ulValue); + _swprintf(szNameBuffer, L"%08lx", ulValue); hKey = NULL; lError = RegOpenKeyEx(hJobsKey, diff --git a/base/services/tcpsvcs/discard.c b/base/services/tcpsvcs/discard.c index fc5b972f06e..2f0a477b676 100644 --- a/base/services/tcpsvcs/discard.c +++ b/base/services/tcpsvcs/discard.c @@ -24,7 +24,7 @@ ReceiveIncomingPackets(SOCKET sock) { TCHAR logBuf[256]; - swprintf(logBuf, L"Discard: Received %d bytes from client", readBytes); + _swprintf(logBuf, L"Discard: Received %d bytes from client", readBytes); LogEvent(logBuf, 0, 0, LOG_FILE); } else if (readBytes == SOCKET_ERROR) diff --git a/base/services/tcpsvcs/echo.c b/base/services/tcpsvcs/echo.c index 7f273c6622b..aa3aebf8bb5 100644 --- a/base/services/tcpsvcs/echo.c +++ b/base/services/tcpsvcs/echo.c @@ -25,7 +25,7 @@ EchoIncomingPackets(SOCKET sock) readBytes = recv(sock, readBuffer, RECV_BUF, 0); if (readBytes > 0) { - swprintf(logBuf, L"Received %d bytes from client", readBytes); + _swprintf(logBuf, L"Received %d bytes from client", readBytes); LogEvent(logBuf, 0, 0, LOG_FILE); totalSentBytes = 0; @@ -34,7 +34,7 @@ EchoIncomingPackets(SOCKET sock) retVal = send(sock, readBuffer + totalSentBytes, readBytes - totalSentBytes, 0); if (retVal > 0) { - swprintf(logBuf, L"Sent %d bytes back to client", retVal); + _swprintf(logBuf, L"Sent %d bytes back to client", retVal); LogEvent(logBuf, 0, 0, LOG_FILE); totalSentBytes += retVal; } diff --git a/base/services/tcpsvcs/skelserver.c b/base/services/tcpsvcs/skelserver.c index 326809c4c96..2cc6b46ad4b 100644 --- a/base/services/tcpsvcs/skelserver.c +++ b/base/services/tcpsvcs/skelserver.c @@ -84,14 +84,14 @@ AcceptConnections(SOCKET listeningSocket, sock = accept(listeningSocket, (SOCKADDR*)&client, &addrSize); if (sock != INVALID_SOCKET) { - swprintf(logBuf, - L"Accepted connection to %s server from %S:%d", - lpName, - inet_ntoa(client.sin_addr), - ntohs(client.sin_port)); + _swprintf(logBuf, + L"Accepted connection to %s server from %S:%d", + lpName, + inet_ntoa(client.sin_addr), + ntohs(client.sin_port)); LogEvent(logBuf, 0, 0, LOG_FILE); - swprintf(logBuf, L"Creating worker thread for %s", lpName); + _swprintf(logBuf, L"Creating worker thread for %s", lpName); LogEvent(logBuf, 0, 0, LOG_FILE); if (!bShutdown) @@ -103,8 +103,8 @@ AcceptConnections(SOCKET listeningSocket, } else { - swprintf(logBuf, L"Failed to start worker thread for the %s server", - lpName); + _swprintf(logBuf, L"Failed to start worker thread for the %s server", + lpName); LogEvent(logBuf, 0, 0, LOG_FILE); } } @@ -149,7 +149,7 @@ ShutdownConnection(SOCKET sock, ret = recv(sock, readBuffer, BUF, 0); if (ret >= 0) { - swprintf(logBuf, L"FYI, received %d unexpected bytes during shutdown", ret); + _swprintf(logBuf, L"FYI, received %d unexpected bytes during shutdown", ret); LogEvent(logBuf, 0, 0, LOG_FILE); } } while (ret > 0); @@ -170,7 +170,7 @@ StartServer(LPVOID lpParam) pServices = (PSERVICES)lpParam; - swprintf(logBuf, L"Starting %s server", pServices->lpName); + _swprintf(logBuf, L"Starting %s server", pServices->lpName); LogEvent(logBuf, 0, 0, LOG_FILE); if (!bShutdown) @@ -178,10 +178,10 @@ StartServer(LPVOID lpParam) listeningSocket = SetUpListener(htons(pServices->Port)); if (!bShutdown && listeningSocket != INVALID_SOCKET) { - swprintf(logBuf, - L"%s is waiting for connections on port %d", - pServices->lpName, - pServices->Port); + _swprintf(logBuf, + L"%s is waiting for connections on port %d", + pServices->lpName, + pServices->Port); LogEvent(logBuf, 0, 0, LOG_FILE); AcceptConnections(listeningSocket, pServices->lpService, pServices->lpName); @@ -192,7 +192,7 @@ StartServer(LPVOID lpParam) } } - swprintf(logBuf, L"Exiting %s thread", pServices->lpName); + _swprintf(logBuf, L"Exiting %s thread", pServices->lpName); LogEvent(logBuf, 0, 0, LOG_FILE); ExitThread(0); } diff --git a/base/services/tcpsvcs/tcpsvcs.c b/base/services/tcpsvcs/tcpsvcs.c index dee2fbbf6aa..061467bf04a 100644 --- a/base/services/tcpsvcs/tcpsvcs.c +++ b/base/services/tcpsvcs/tcpsvcs.c @@ -72,7 +72,7 @@ CreateServers(PSERVICEINFO pServInfo) if ((RetVal = WSAStartup(MAKEWORD(2, 2), &wsaData)) != 0) { - swprintf(buf, L"WSAStartup() failed : %lu\n", RetVal); + _swprintf(buf, L"WSAStartup() failed : %lu\n", RetVal); LogEvent(buf, 0, 100, LOG_ALL); return FALSE; } @@ -84,7 +84,7 @@ CreateServers(PSERVICEINFO pServInfo) /* Create worker threads. */ for (i = 0; i < NUM_SERVICES; i++) { - swprintf(buf, L"Creating thread for %s server", Services[i].lpName); + _swprintf(buf, L"Creating thread for %s server", Services[i].lpName); LogEvent(buf, 0, 0, LOG_FILE); hThread[i] = CreateThread(NULL, @@ -96,7 +96,7 @@ CreateServers(PSERVICEINFO pServInfo) if (hThread[i] == NULL) { - swprintf(buf, L"\nError creating %s server thread\n", Services[i].lpName); + _swprintf(buf, L"\nError creating %s server thread\n", Services[i].lpName); LogEvent(buf, GetLastError(), 0, LOG_ALL); return FALSE; } diff --git a/base/services/umpnpmgr/install.c b/base/services/umpnpmgr/install.c index b717d08646a..26ab4847f10 100644 --- a/base/services/umpnpmgr/install.c +++ b/base/services/umpnpmgr/install.c @@ -119,7 +119,7 @@ InstallDevice(PCWSTR DeviceInstance, BOOL ShowWizard) /* Create a random UUID for the named pipe & event*/ UuidCreate(&RandomUuid); - swprintf(UuidString, L"{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", + _swprintf(UuidString, L"{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", RandomUuid.Data1, RandomUuid.Data2, RandomUuid.Data3, RandomUuid.Data4[0], RandomUuid.Data4[1], RandomUuid.Data4[2], RandomUuid.Data4[3], RandomUuid.Data4[4], RandomUuid.Data4[5], diff --git a/base/services/umpnpmgr/rpcserver.c b/base/services/umpnpmgr/rpcserver.c index 7d40cbcf447..2e03d91440b 100644 --- a/base/services/umpnpmgr/rpcserver.c +++ b/base/services/umpnpmgr/rpcserver.c @@ -3266,8 +3266,8 @@ GenerateDeviceID( if (dwInstanceNumber >= 10000) return CR_FAILURE; - swprintf(szGeneratedInstance, L"Root\\%ls\\%04lu", - pszDeviceID, dwInstanceNumber); + _swprintf(szGeneratedInstance, L"Root\\%ls\\%04lu", + pszDeviceID, dwInstanceNumber); /* Try to open the enum key of the device instance */ dwError = RegOpenKeyEx(hEnumKey, szGeneratedInstance, 0, KEY_QUERY_VALUE, &hKey); @@ -4142,9 +4142,9 @@ PNP_HwProfFlags( } else { - swprintf(szKeyName, - L"System\\CurrentControlSet\\HardwareProfiles\\%04lu\\System\\CurrentControlSet\\Enum", - ulConfig); + _swprintf(szKeyName, + L"System\\CurrentControlSet\\HardwareProfiles\\%04lu\\System\\CurrentControlSet\\Enum", + ulConfig); } if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, @@ -4287,7 +4287,7 @@ PNP_GetHwProfInfo( goto done; } - swprintf(szProfileName, L"%04lu", pHWProfileInfo->HWPI_ulHWProfile); + _swprintf(szProfileName, L"%04lu", pHWProfileInfo->HWPI_ulHWProfile); lError = RegOpenKeyExW(hKeyProfiles, szProfileName, diff --git a/base/setup/usetup/cmdcons.c b/base/setup/usetup/cmdcons.c index a4cb6afe5bd..8de6f67f532 100644 --- a/base/setup/usetup/cmdcons.c +++ b/base/setup/usetup/cmdcons.c @@ -376,8 +376,8 @@ CommandDumpSector( Sector.QuadPart = _atoi64(argv[1]); /* Build full drive name */ -// swprintf(DriveName, L"\\\\.\\PHYSICALDRIVE%lu", ulDrive); - swprintf(DriveName, L"\\Device\\Harddisk%lu\\Partition0", ulDrive); +// _swprintf(DriveName, L"\\\\.\\PHYSICALDRIVE%lu", ulDrive); + _swprintf(DriveName, L"\\Device\\Harddisk%lu\\Partition0", ulDrive); RtlInitUnicodeString(&PathName, DriveName); @@ -603,7 +603,7 @@ CommandPartInfo( ulDrive = strtoul(argv[0], NULL, 0); /* Build full drive name */ - swprintf(DriveName, L"\\Device\\Harddisk%lu\\Partition0", ulDrive); + _swprintf(DriveName, L"\\Device\\Harddisk%lu\\Partition0", ulDrive); RtlInitUnicodeString(&PathName, DriveName); diff --git a/base/setup/usetup/usetup.c b/base/setup/usetup/usetup.c index d3c62e6b490..cd7325ed6f7 100644 --- a/base/setup/usetup/usetup.c +++ b/base/setup/usetup/usetup.c @@ -1896,7 +1896,7 @@ ShowPartitionSizeInputBox(SHORT Left, coPos, &Written); - swprintf(InputBuffer, L"%lu", MaxSize); + _swprintf(InputBuffer, L"%lu", MaxSize); Length = wcslen(InputBuffer); Pos = Length; CONSOLE_SetInputTextXY(iLeft, diff --git a/base/shell/cmd/console.c b/base/shell/cmd/console.c index 047c744c79f..89cdab5127e 100644 --- a/base/shell/cmd/console.c +++ b/base/shell/cmd/console.c @@ -157,7 +157,7 @@ BOOL ConPrintfVPaging(PCON_PAGER Pager, BOOL StartPaging, LPWSTR szFormat, va_li if (szFormat == NULL) return TRUE; - /*len =*/ vswprintf(szOut, szFormat, arg_ptr); + /*len =*/ _vswprintf(szOut, szFormat, arg_ptr); // return ConPutsPaging(Pager, PagePrompt, StartPaging, szOut); return ConWritePaging(Pager, PagePrompt, StartPaging, diff --git a/base/shell/cmd/error.c b/base/shell/cmd/error.c index e2cec983055..7bbac77550b 100644 --- a/base/shell/cmd/error.c +++ b/base/shell/cmd/error.c @@ -40,7 +40,7 @@ ErrorMessage( if (szFormat) { va_start(arg_ptr, szFormat); - vswprintf(szMessage, szFormat, arg_ptr); + _vswprintf(szMessage, szFormat, arg_ptr); va_end(arg_ptr); } diff --git a/base/system/autochk/autochk.c b/base/system/autochk/autochk.c index 8983668064e..cc5fe30951d 100644 --- a/base/system/autochk/autochk.c +++ b/base/system/autochk/autochk.c @@ -658,7 +658,7 @@ _main( if ((DeviceMap.Query.DriveMap & (1 << i)) && (DeviceMap.Query.DriveType[i] == DOSDEVICE_DRIVE_FIXED)) { - swprintf(VolumePath, L"\\??\\%c:", L'A' + i); + _swprintf(VolumePath, L"\\??\\%c:", L'A' + i); CheckVolume(VolumePath, TimeOut, CheckOnlyIfDirty); } } diff --git a/base/system/diskpart/detail.c b/base/system/diskpart/detail.c index faf8e7b2fc0..7c9a7130540 100644 --- a/base/system/diskpart/detail.c +++ b/base/system/diskpart/detail.c @@ -94,7 +94,7 @@ DetailDisk( if (CurrentDisk->LayoutBuffer->PartitionStyle == PARTITION_STYLE_GPT) PrintGUID(szBuffer, &CurrentDisk->LayoutBuffer->Gpt.DiskId); else if (CurrentDisk->LayoutBuffer->PartitionStyle == PARTITION_STYLE_MBR) - swprintf(szBuffer, L"%08lx", CurrentDisk->LayoutBuffer->Mbr.Signature); + _swprintf(szBuffer, L"%08lx", CurrentDisk->LayoutBuffer->Mbr.Signature); else wcscpy(szBuffer, L"00000000"); ConResPrintf(StdOut, IDS_DETAIL_DISK_ID, szBuffer); @@ -194,7 +194,7 @@ DetailPartition( } else if (CurrentDisk->PartitionStyle == PARTITION_STYLE_MBR) { - swprintf(szBuffer, L"%02x", PartEntry->Mbr.PartitionType); + _swprintf(szBuffer, L"%02x", PartEntry->Mbr.PartitionType); ConResPrintf(StdOut, IDS_DETAIL_PARTITION_TYPE, szBuffer); ConResPrintf(StdOut, IDS_DETAIL_PARTITION_HIDDEN, ""); LoadStringW(GetModuleHandle(NULL), diff --git a/base/system/diskpart/dump.c b/base/system/diskpart/dump.c index 637d9f3161c..5d405eb0a5b 100644 --- a/base/system/diskpart/dump.c +++ b/base/system/diskpart/dump.c @@ -90,9 +90,9 @@ DumpDisk( goto done; } - swprintf(Buffer, - L"\\Device\\Harddisk%d\\Partition0", - CurrentDisk->DiskNumber); + _swprintf(Buffer, + L"\\Device\\Harddisk%d\\Partition0", + CurrentDisk->DiskNumber); RtlInitUnicodeString(&Name, Buffer); @@ -195,10 +195,10 @@ DumpPartition( goto done; } - swprintf(Buffer, - L"\\Device\\Harddisk%d\\Partition%d", - CurrentDisk->DiskNumber, - CurrentPartition->PartitionNumber); + _swprintf(Buffer, + L"\\Device\\Harddisk%d\\Partition%d", + CurrentDisk->DiskNumber, + CurrentPartition->PartitionNumber); RtlInitUnicodeString(&Name, Buffer); diff --git a/base/system/diskpart/list.c b/base/system/diskpart/list.c index 7e57cf77816..b77fee6be59 100644 --- a/base/system/diskpart/list.c +++ b/base/system/diskpart/list.c @@ -52,7 +52,7 @@ PrintSize( nUnitId, szUnitBuffer, ARRAYSIZE(szUnitBuffer)); - swprintf(pszOutBuffer, L"%4I64u %-2s", ullSize, szUnitBuffer); + _swprintf(pszOutBuffer, L"%4I64u %-2s", ullSize, szUnitBuffer); StringCchPrintfW(pszOutBuffer, ulOutBufferSize, L"%4I64u %-2s", ullSize, szUnitBuffer); diff --git a/base/system/diskpart/misc.c b/base/system/diskpart/misc.c index 3f576dfeb10..a260675a146 100644 --- a/base/system/diskpart/misc.c +++ b/base/system/diskpart/misc.c @@ -188,19 +188,19 @@ PrintGUID( _Out_ PWSTR pszBuffer, _In_ GUID *pGuid) { - swprintf(pszBuffer, - L"%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", - pGuid->Data1, - pGuid->Data2, - pGuid->Data3, - pGuid->Data4[0], - pGuid->Data4[1], - pGuid->Data4[2], - pGuid->Data4[3], - pGuid->Data4[4], - pGuid->Data4[5], - pGuid->Data4[6], - pGuid->Data4[7]); + _swprintf(pszBuffer, + L"%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", + pGuid->Data1, + pGuid->Data2, + pGuid->Data3, + pGuid->Data4[0], + pGuid->Data4[1], + pGuid->Data4[2], + pGuid->Data4[3], + pGuid->Data4[4], + pGuid->Data4[5], + pGuid->Data4[6], + pGuid->Data4[7]); } static diff --git a/base/system/diskpart/mountmgr.c b/base/system/diskpart/mountmgr.c index e23868eaf61..0e6af150983 100644 --- a/base/system/diskpart/mountmgr.c +++ b/base/system/diskpart/mountmgr.c @@ -195,7 +195,7 @@ AssignDriveLetter( DeviceNameLength = wcslen(DeviceName) * sizeof(WCHAR); - swprintf(DosDeviceName, L"\\DosDevices\\%c:", DriveLetter); + _swprintf(DosDeviceName, L"\\DosDevices\\%c:", DriveLetter); DosDeviceNameLength = wcslen(DosDeviceName) * sizeof(WCHAR); /* Allocate the input buffer for the MountMgr */ @@ -345,7 +345,7 @@ DeleteDriveLetter( DPRINT("DeleteDriveLetter(%c)\n", DriveLetter); /* Setup the device name of the letter to delete */ - swprintf(DosDeviceName, L"\\DosDevices\\%c:", DriveLetter); + _swprintf(DosDeviceName, L"\\DosDevices\\%c:", DriveLetter); DosDeviceNameLength = wcslen(DosDeviceName) * sizeof(WCHAR); /* Allocate the input buffer for MountMgr */ diff --git a/base/system/diskpart/uniqueid.c b/base/system/diskpart/uniqueid.c index 9f281f6fb66..86a753be81f 100644 --- a/base/system/diskpart/uniqueid.c +++ b/base/system/diskpart/uniqueid.c @@ -35,7 +35,7 @@ UniqueIdDisk( if (CurrentDisk->LayoutBuffer->PartitionStyle == PARTITION_STYLE_GPT) PrintGUID(szBuffer, &CurrentDisk->LayoutBuffer->Gpt.DiskId); else if (CurrentDisk->LayoutBuffer->PartitionStyle == PARTITION_STYLE_MBR) - swprintf(szBuffer, L"%08lx", CurrentDisk->LayoutBuffer->Mbr.Signature); + _swprintf(szBuffer, L"%08lx", CurrentDisk->LayoutBuffer->Mbr.Signature); else wcscpy(szBuffer, L"00000000"); ConPrintf(StdOut, L"Disk ID: %s\n", szBuffer); diff --git a/base/system/services/controlset.c b/base/system/services/controlset.c index e9fdc967e12..e446d950e45 100644 --- a/base/system/services/controlset.c +++ b/base/system/services/controlset.c @@ -187,11 +187,11 @@ ScmCopyControlSet( DWORD dwError; /* Create the source control set name */ - swprintf(szSourceControlSetName, L"SYSTEM\\ControlSet%03lu", dwSourceControlSet); + _swprintf(szSourceControlSetName, L"SYSTEM\\ControlSet%03lu", dwSourceControlSet); DPRINT("Source control set: %S\n", szSourceControlSetName); /* Create the destination control set name */ - swprintf(szDestinationControlSetName, L"SYSTEM\\ControlSet%03lu", dwDestinationControlSet); + _swprintf(szDestinationControlSetName, L"SYSTEM\\ControlSet%03lu", dwDestinationControlSet); DPRINT("Destination control set: %S\n", szDestinationControlSetName); /* Open the source control set key */ @@ -248,7 +248,7 @@ ScmDeleteControlSet( DPRINT("ScmDeleteControSet(%lu)\n", dwControlSet); /* Create the control set name */ - swprintf(szControlSetName, L"SYSTEM\\ControlSet%03lu", dwControlSet); + _swprintf(szControlSetName, L"SYSTEM\\ControlSet%03lu", dwControlSet); DPRINT("Control set: %S\n", szControlSetName); /* Open the system key */ diff --git a/base/system/smss/sminit.c b/base/system/smss/sminit.c index 4a31b6b20df..f84eb528f1d 100644 --- a/base/system/smss/sminit.c +++ b/base/system/smss/sminit.c @@ -1797,7 +1797,7 @@ SmpCreateDynamicEnvironmentVariables(VOID) /* And now let's write the processor level */ RtlInitUnicodeString(&ValueName, L"PROCESSOR_LEVEL"); - swprintf(ValueBuffer, L"%u", ProcessorInfo.ProcessorLevel); + _swprintf(ValueBuffer, L"%u", ProcessorInfo.ProcessorLevel); DPRINT("Setting %wZ to %S\n", &ValueName, ValueBuffer); Status = NtSetValueKey(KeyHandle, &ValueName, @@ -1906,7 +1906,7 @@ SmpCreateDynamicEnvironmentVariables(VOID) if ((ProcessorInfo.ProcessorRevision >> 8) == 0xFF) { /* These guys used a revision + stepping, so get the rev only */ - swprintf(ValueBuffer, L"%02x", ProcessorInfo.ProcessorRevision & 0xFF); + _swprintf(ValueBuffer, L"%02x", ProcessorInfo.ProcessorRevision & 0xFF); _wcsupr(ValueBuffer); break; } @@ -1914,12 +1914,12 @@ SmpCreateDynamicEnvironmentVariables(VOID) /* Modern Intel, as well as 64-bit CPUs use a revision without stepping */ case PROCESSOR_ARCHITECTURE_IA64: case PROCESSOR_ARCHITECTURE_AMD64: - swprintf(ValueBuffer, L"%04x", ProcessorInfo.ProcessorRevision); + _swprintf(ValueBuffer, L"%04x", ProcessorInfo.ProcessorRevision); break; /* And anything else we'll just read the whole revision identifier */ default: - swprintf(ValueBuffer, L"%u", ProcessorInfo.ProcessorRevision); + _swprintf(ValueBuffer, L"%u", ProcessorInfo.ProcessorRevision); break; } @@ -1941,7 +1941,7 @@ SmpCreateDynamicEnvironmentVariables(VOID) /* And finally, write the number of CPUs */ RtlInitUnicodeString(&ValueName, L"NUMBER_OF_PROCESSORS"); - swprintf(ValueBuffer, L"%d", BasicInfo.NumberOfProcessors); + _swprintf(ValueBuffer, L"%d", BasicInfo.NumberOfProcessors); DPRINT("Setting %wZ to %S\n", &ValueName, ValueBuffer); Status = NtSetValueKey(KeyHandle, &ValueName, diff --git a/base/system/userinit/livecd.c b/base/system/userinit/livecd.c index 25322e46a9f..9229cd3c7fc 100644 --- a/base/system/userinit/livecd.c +++ b/base/system/userinit/livecd.c @@ -318,7 +318,7 @@ SetKeyboardLayout( if (ulLayoutId == (ULONG)CB_ERR) return; - swprintf(szLayoutId, L"%08lx", ulLayoutId); + _swprintf(szLayoutId, L"%08lx", ulLayoutId); hKl = LoadKeyboardLayoutW(szLayoutId, KLF_ACTIVATE | KLF_REPLACELANG | KLF_SETFORPROCESS); SystemParametersInfoW(SPI_SETDEFAULTINPUTLANG, 0, &hKl, SPIF_SENDCHANGE); @@ -519,7 +519,7 @@ InitializeDefaultUserLocale( { lcid = *pNewLcid; - swprintf(szBuffer, L"%08lx", lcid); + _swprintf(szBuffer, L"%08lx", lcid); RegSetValueExW(hLocaleKey, L"Locale", 0, diff --git a/base/system/winlogon/shutdown.c b/base/system/winlogon/shutdown.c index 5190ad0faa2..d310fcb2248 100644 --- a/base/system/winlogon/shutdown.c +++ b/base/system/winlogon/shutdown.c @@ -143,14 +143,14 @@ OnTimer( iSeconds -= iMinutes * 60; LoadStringW(hAppInstance, IDS_TIMEOUTSHORTFORMAT, szFormatBuffer, ARRAYSIZE(szFormatBuffer)); - swprintf(szBuffer, szFormatBuffer, iHours, iMinutes, iSeconds); + _swprintf(szBuffer, szFormatBuffer, iHours, iMinutes, iSeconds); } else { iDays = (INT)(pShutdownParams->dwTimeout / SECONDS_PER_DAY); LoadStringW(hAppInstance, IDS_TIMEOUTLONGFORMAT, szFormatBuffer, ARRAYSIZE(szFormatBuffer)); - swprintf(szBuffer, szFormatBuffer, iDays); + _swprintf(szBuffer, szFormatBuffer, iDays); } SetDlgItemTextW(hwndDlg, IDC_SYSSHUTDOWNTIMELEFT, szBuffer); diff --git a/base/system/winlogon/winlogon.c b/base/system/winlogon/winlogon.c index f19036dfca0..9bf6d844bcf 100644 --- a/base/system/winlogon/winlogon.c +++ b/base/system/winlogon/winlogon.c @@ -320,7 +320,7 @@ InitKeyboardLayouts(VOID) while (TRUE) { /* Read values with integer names only */ - swprintf(wszKeyName, L"%d", i++); + _swprintf(wszKeyName, L"%d", i++); if (RegQueryValueExW(hKey, wszKeyName, NULL, &dwType, (LPBYTE)wszKLID, &dwSize) != ERROR_SUCCESS) { /* There is no more entries */ diff --git a/dll/cpl/sysdm/hardprof.c b/dll/cpl/sysdm/hardprof.c index 50a686c25dd..38b61d1c4f2 100644 --- a/dll/cpl/sysdm/hardprof.c +++ b/dll/cpl/sysdm/hardprof.c @@ -160,7 +160,7 @@ CopyHardwareProfile( LoadStringW(hApplet, IDS_HWPROFILE_PROFILE, szBuffer, sizeof(szBuffer) / sizeof(WCHAR)); wcscpy(ProfileNames.szSourceName, pProfile->szFriendlyName); - swprintf(ProfileNames.szDestinationName, L"%s %lu", szBuffer, pProfileData->dwProfileCount); + _swprintf(ProfileNames.szDestinationName, L"%s %lu", szBuffer, pProfileData->dwProfileCount); ProfileNames.pProfileData = pProfileData; @@ -196,7 +196,7 @@ CopyHardwareProfile( wcscpy(pNewProfile->szFriendlyName, ProfileNames.szDestinationName); pNewProfile->dwProfileNumber = ++pProfileData->dwLastProfile; - swprintf(pNewProfile->szName, L"%04lu", pNewProfile->dwProfileNumber); + _swprintf(pNewProfile->szName, L"%04lu", pNewProfile->dwProfileNumber); pNewProfile->dwPreferenceOrder = pNewProfile->dwProfileNumber; @@ -281,7 +281,7 @@ RenameHardwareProfile( LoadStringW(hApplet, IDS_HWPROFILE_PROFILE, szBuffer, sizeof(szBuffer) / sizeof(WCHAR)); wcscpy(ProfileNames.szSourceName, pProfile->szFriendlyName); - swprintf(ProfileNames.szDestinationName, L"%s %lu", szBuffer, pProfileData->dwProfileCount); + _swprintf(ProfileNames.szDestinationName, L"%s %lu", szBuffer, pProfileData->dwProfileCount); ProfileNames.pProfileData = pProfileData; diff --git a/dll/cpl/sysdm/startrec.c b/dll/cpl/sysdm/startrec.c index a0bc3a8213c..9f6d5c41927 100644 --- a/dll/cpl/sysdm/startrec.c +++ b/dll/cpl/sysdm/startrec.c @@ -738,7 +738,7 @@ StartRecDlgProc(HWND hwndDlg, iTimeout = SendDlgItemMessage(hwndDlg, IDC_STRRECLISTUPDWN, UDM_GETPOS, (WPARAM)0, (LPARAM)0); else iTimeout = 0; - swprintf(szTimeout, L"%i", iTimeout); + _swprintf(szTimeout, L"%i", iTimeout); lResult = SendDlgItemMessageW(hwndDlg, IDC_STRECOSCOMBO, CB_GETCURSEL, (WPARAM)0, (LPARAM)0); if (lResult == CB_ERR) diff --git a/dll/cpl/sysdm/userprofile.c b/dll/cpl/sysdm/userprofile.c index 25e0277b2de..1de0862714e 100644 --- a/dll/cpl/sysdm/userprofile.c +++ b/dll/cpl/sysdm/userprofile.c @@ -48,7 +48,7 @@ OnProfileTypeInit( if (pszCookedBuffer == NULL) goto done; - swprintf(pszCookedBuffer, pszRawBuffer, pProfileData->pszFullName); + _swprintf(pszCookedBuffer, pszRawBuffer, pProfileData->pszFullName); /* Set the full text */ SetDlgItemText(hwndDlg, IDC_USERPROFILE_TYPE_TEXT, pszCookedBuffer); diff --git a/dll/cpl/timedate/monthcal.c b/dll/cpl/timedate/monthcal.c index 33be29e3149..66440fca977 100644 --- a/dll/cpl/timedate/monthcal.c +++ b/dll/cpl/timedate/monthcal.c @@ -541,9 +541,7 @@ MonthCalPaint(IN PMONTHCALWND infoPtr, RECT rcText; SIZE TextSize; - szDayLen = swprintf(szDay, - L"%lu", - Day); + szDayLen = _swprintf(szDay, L"%lu", Day); if (GetTextExtentPoint32W(hDC, szDay, diff --git a/dll/cpl/timedate/timedate.c b/dll/cpl/timedate/timedate.c index e3f03fdf7ca..993b0477aba 100644 --- a/dll/cpl/timedate/timedate.c +++ b/dll/cpl/timedate/timedate.c @@ -44,7 +44,7 @@ VOID DisplayWin32Error(DWORD dwErrorCode) NULL ); #if DBG - if (swprintf(szMsg, L"%hs:%d: %s", file, line, (PWSTR)lpMsgBuf)) + if (_swprintf(szMsg, L"%hs:%d: %s", file, line, (PWSTR)lpMsgBuf)) { MessageBoxW(NULL, szMsg, NULL, MB_OK | MB_ICONERROR); } diff --git a/dll/directx/bdaplgin/controlnode.cpp b/dll/directx/bdaplgin/controlnode.cpp index b9f13e638e7..e210ee78987 100644 --- a/dll/directx/bdaplgin/controlnode.cpp +++ b/dll/directx/bdaplgin/controlnode.cpp @@ -78,7 +78,7 @@ CControlNode::QueryInterface( WCHAR Buffer[MAX_PATH]; LPOLESTR lpstr; StringFromCLSID(refiid, &lpstr); - swprintf(Buffer, L"CControlNode::QueryInterface: NoInterface for %s", lpstr); + _swprintf(Buffer, L"CControlNode::QueryInterface: NoInterface for %s", lpstr); OutputDebugStringW(Buffer); CoTaskMemFree(lpstr); #endif @@ -102,7 +102,7 @@ CControlNode_fnConstructor( IKsPropertySet * pProperty; // store pin id - swprintf(Buffer, L"%u", PinId); + _swprintf(Buffer, L"%u", PinId); // try find target pin hr = pFilter->FindPin(Buffer, &pPin); @@ -110,7 +110,7 @@ CControlNode_fnConstructor( if (FAILED(hr)) { #ifdef BDAPLGIN_TRACE - swprintf(Buffer, L"CControlNode_fnConstructor failed find pin %lu with %lx\n", PinId, hr); + _swprintf(Buffer, L"CControlNode_fnConstructor failed find pin %lu with %lx\n", PinId, hr); OutputDebugStringW(Buffer); #endif return hr; @@ -122,7 +122,7 @@ CControlNode_fnConstructor( return hr; #ifdef BDAPLGIN_TRACE - swprintf(Buffer, L"CControlNode_fnConstructor get IID_IKsObject status %lx\n", hr); + _swprintf(Buffer, L"CControlNode_fnConstructor get IID_IKsObject status %lx\n", hr); OutputDebugStringW(Buffer); #endif diff --git a/dll/directx/bdaplgin/devicecontrol.cpp b/dll/directx/bdaplgin/devicecontrol.cpp index 0d0af0f4a2b..8420edbde98 100644 --- a/dll/directx/bdaplgin/devicecontrol.cpp +++ b/dll/directx/bdaplgin/devicecontrol.cpp @@ -132,7 +132,7 @@ CBDADeviceControl::StartChanges( void) #ifdef BDAPLGIN_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CBDADeviceControl::StartChanges: hr %lx, BytesReturned %lu\n", hr, BytesReturned); + _swprintf(Buffer, L"CBDADeviceControl::StartChanges: hr %lx, BytesReturned %lu\n", hr, BytesReturned); OutputDebugStringW(Buffer); #endif @@ -158,7 +158,7 @@ CBDADeviceControl::CheckChanges( void) #ifdef BDAPLGIN_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CBDADeviceControl::CheckChanges: hr %lx, BytesReturned %lu\n", hr, BytesReturned); + _swprintf(Buffer, L"CBDADeviceControl::CheckChanges: hr %lx, BytesReturned %lu\n", hr, BytesReturned); OutputDebugStringW(Buffer); #endif @@ -184,7 +184,7 @@ CBDADeviceControl::CommitChanges( void) #ifdef BDAPLGIN_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CBDADeviceControl::CommitChanges: hr %lx, BytesReturned %lu\n", hr, BytesReturned); + _swprintf(Buffer, L"CBDADeviceControl::CommitChanges: hr %lx, BytesReturned %lu\n", hr, BytesReturned); OutputDebugStringW(Buffer); #endif @@ -229,14 +229,14 @@ CBDADeviceControl::GetNodeTypes(ULONG *pulcNodeTypes, ULONG ulcNodeTypesMax, ULO #ifdef BDAPLGIN_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CBDADeviceControl::GetNodeTypes: hr %lx, BytesReturned %lu\n", hr, BytesReturned); + _swprintf(Buffer, L"CBDADeviceControl::GetNodeTypes: hr %lx, BytesReturned %lu\n", hr, BytesReturned); OutputDebugStringW(Buffer); if (SUCCEEDED(hr)) { for(ULONG Index = 0; Index < *pulcNodeTypes; Index++) { - swprintf(Buffer, L"CBDADeviceControl::GetPinTypes: Index %lu Value %lx\n", Index, rgulNodeTypes[Index]); + _swprintf(Buffer, L"CBDADeviceControl::GetPinTypes: Index %lu Value %lx\n", Index, rgulNodeTypes[Index]); OutputDebugStringW(Buffer); } } @@ -266,7 +266,7 @@ CBDADeviceControl::GetNodeDescriptors(ULONG *ulcNodeDescriptors, ULONG ulcNodeDe #ifdef BDAPLGIN_TRACE WCHAR Buffer[1000]; - swprintf(Buffer, L"CBDADeviceControl::GetNodeDescriptors: hr %lx, BytesReturned %lu\n", hr, BytesReturned); + _swprintf(Buffer, L"CBDADeviceControl::GetNodeDescriptors: hr %lx, BytesReturned %lu\n", hr, BytesReturned); OutputDebugStringW(Buffer); @@ -279,7 +279,7 @@ CBDADeviceControl::GetNodeDescriptors(ULONG *ulcNodeDescriptors, ULONG ulcNodeDe StringFromCLSID(rgNodeDescriptors[Index].guidFunction, &pGUIDFunction); StringFromCLSID(rgNodeDescriptors[Index].guidName, &pGUIDName); - swprintf(Buffer, L"CBDADeviceControl::GetPinTypes: Index %lu Value %lx\nFunction %s\n Name %s\n-----\n", Index, rgNodeDescriptors[Index].ulBdaNodeType, pGUIDFunction, pGUIDName); + _swprintf(Buffer, L"CBDADeviceControl::GetPinTypes: Index %lu Value %lx\nFunction %s\n Name %s\n-----\n", Index, rgNodeDescriptors[Index].ulBdaNodeType, pGUIDFunction, pGUIDName); OutputDebugStringW(Buffer); } } @@ -312,7 +312,7 @@ CBDADeviceControl::GetNodeInterfaces(ULONG ulNodeType, ULONG *pulcInterfaces, UL #ifdef BDAPLGIN_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CBDADeviceControl::GetNodeInterfaces: hr %lx, BytesReturned %lu ulNodeType %lu\n", hr, BytesReturned, ulNodeType); + _swprintf(Buffer, L"CBDADeviceControl::GetNodeInterfaces: hr %lx, BytesReturned %lu ulNodeType %lu\n", hr, BytesReturned, ulNodeType); OutputDebugStringW(Buffer); if (SUCCEEDED(hr)) @@ -323,7 +323,7 @@ CBDADeviceControl::GetNodeInterfaces(ULONG ulNodeType, ULONG *pulcInterfaces, UL StringFromCLSID(rgguidInterfaces[Index], &pstr); - swprintf(Buffer, L"CBDADeviceControl::GetNodeInterfaces: Index %lu Name %s\n", Index, pstr); + _swprintf(Buffer, L"CBDADeviceControl::GetNodeInterfaces: Index %lu Name %s\n", Index, pstr); OutputDebugStringW(Buffer); } } @@ -352,14 +352,14 @@ CBDADeviceControl::GetPinTypes(ULONG *pulcPinTypes, ULONG ulcPinTypesMax, ULONG #ifdef BDAPLGIN_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CBDADeviceControl::GetPinTypes: hr %lx, BytesReturned %lu\n", hr, BytesReturned); + _swprintf(Buffer, L"CBDADeviceControl::GetPinTypes: hr %lx, BytesReturned %lu\n", hr, BytesReturned); OutputDebugStringW(Buffer); if (SUCCEEDED(hr)) { for(ULONG Index = 0; Index < *pulcPinTypes; Index++) { - swprintf(Buffer, L"CBDADeviceControl::GetPinTypes: Index %lu Value %lx\n", Index, rgulPinTypes[Index]); + _swprintf(Buffer, L"CBDADeviceControl::GetPinTypes: Index %lu Value %lx\n", Index, rgulPinTypes[Index]); OutputDebugStringW(Buffer); } } @@ -441,7 +441,7 @@ CBDADeviceControl::CreateTopology(ULONG ulInputPinId, ULONG ulOutputPinId) #ifdef BDAPLGIN_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CBDADeviceControl::CreateTopology: hr %lx, BytesReturned %lu\n", hr, BytesReturned); + _swprintf(Buffer, L"CBDADeviceControl::CreateTopology: hr %lx, BytesReturned %lu\n", hr, BytesReturned); OutputDebugStringW(Buffer); #endif @@ -473,7 +473,7 @@ CBDADeviceControl::GetControlNode(ULONG ulInputPinId, ULONG ulOutputPinId, ULONG #ifdef BDAPLGIN_TRACE WCHAR Buffer[200]; - swprintf(Buffer, L"CBDADeviceControl::GetControlNode: hr %lx, BytesReturned %lu PinId %lu ulInputPinId %lu ulOutputPinId %lu ulNodeType %lu\n", hr, BytesReturned, PinId, ulInputPinId, ulOutputPinId, ulNodeType); + _swprintf(Buffer, L"CBDADeviceControl::GetControlNode: hr %lx, BytesReturned %lu PinId %lu ulInputPinId %lu ulOutputPinId %lu ulNodeType %lu\n", hr, BytesReturned, PinId, ulInputPinId, ulOutputPinId, ulNodeType); OutputDebugStringW(Buffer); #endif @@ -483,7 +483,7 @@ CBDADeviceControl::GetControlNode(ULONG ulInputPinId, ULONG ulOutputPinId, ULONG hr = CControlNode_fnConstructor(m_pFilter, ulNodeType, PinId, IID_IUnknown, (LPVOID*)ppControlNode); #ifdef BDAPLGIN_TRACE - swprintf(Buffer, L"CBDADeviceControl::GetControlNode: hr %lx\n", hr); + _swprintf(Buffer, L"CBDADeviceControl::GetControlNode: hr %lx\n", hr); OutputDebugStringW(Buffer); #endif diff --git a/dll/directx/bdaplgin/digitaldemo.cpp b/dll/directx/bdaplgin/digitaldemo.cpp index 01845e8f3a7..9350ea4af32 100644 --- a/dll/directx/bdaplgin/digitaldemo.cpp +++ b/dll/directx/bdaplgin/digitaldemo.cpp @@ -85,7 +85,7 @@ CBDADigitalDemodulator::QueryInterface( WCHAR Buffer[MAX_PATH]; LPOLESTR lpstr; StringFromCLSID(refiid, &lpstr); - swprintf(Buffer, L"CBDADigitalDemodulator::QueryInterface: NoInterface for %s", lpstr); + _swprintf(Buffer, L"CBDADigitalDemodulator::QueryInterface: NoInterface for %s", lpstr); OutputDebugStringW(Buffer); CoTaskMemFree(lpstr); DebugBreak(); @@ -111,7 +111,7 @@ CBDADigitalDemodulator::put_ModulationType(ModulationType *pModulationType) #ifdef BDAPLGIN_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CBDADigitalDemodulator::put_ModulationType: pModulationType %lu hr %lx\n", *pModulationType, hr); + _swprintf(Buffer, L"CBDADigitalDemodulator::put_ModulationType: pModulationType %lu hr %lx\n", *pModulationType, hr); OutputDebugStringW(Buffer); #endif @@ -142,7 +142,7 @@ CBDADigitalDemodulator::put_InnerFECMethod(FECMethod *pFECMethod) #ifdef BDAPLGIN_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CBDADigitalDemodulator::put_InnerFECMethod: pFECMethod %lu hr %lx\n", *pFECMethod, hr); + _swprintf(Buffer, L"CBDADigitalDemodulator::put_InnerFECMethod: pFECMethod %lu hr %lx\n", *pFECMethod, hr); OutputDebugStringW(Buffer); #endif @@ -172,7 +172,7 @@ CBDADigitalDemodulator::put_InnerFECRate(BinaryConvolutionCodeRate *pFECRate) #ifdef BDAPLGIN_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CBDADigitalDemodulator::put_InnerFECRate: pFECRate %lu hr %lx\n", *pFECRate, hr); + _swprintf(Buffer, L"CBDADigitalDemodulator::put_InnerFECRate: pFECRate %lu hr %lx\n", *pFECRate, hr); OutputDebugStringW(Buffer); #endif @@ -202,7 +202,7 @@ CBDADigitalDemodulator::put_OuterFECMethod(FECMethod *pFECMethod) #ifdef BDAPLGIN_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CBDADigitalDemodulator::put_OuterFECMethod: pFECMethod %lu hr %lx\n", *pFECMethod, hr); + _swprintf(Buffer, L"CBDADigitalDemodulator::put_OuterFECMethod: pFECMethod %lu hr %lx\n", *pFECMethod, hr); OutputDebugStringW(Buffer); #endif @@ -232,7 +232,7 @@ CBDADigitalDemodulator::put_OuterFECRate(BinaryConvolutionCodeRate *pFECRate) #ifdef BDAPLGIN_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CBDADigitalDemodulator::put_OuterFECRate: pFECRate %lu hr %lx\n", *pFECRate, hr); + _swprintf(Buffer, L"CBDADigitalDemodulator::put_OuterFECRate: pFECRate %lu hr %lx\n", *pFECRate, hr); OutputDebugStringW(Buffer); #endif @@ -262,7 +262,7 @@ CBDADigitalDemodulator::put_SymbolRate(ULONG *pSymbolRate) #ifdef BDAPLGIN_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CBDADigitalDemodulator::put_SymbolRate: pSymbolRate %lu hr %lx\n", *pSymbolRate, hr); + _swprintf(Buffer, L"CBDADigitalDemodulator::put_SymbolRate: pSymbolRate %lu hr %lx\n", *pSymbolRate, hr); OutputDebugStringW(Buffer); #endif @@ -292,7 +292,7 @@ CBDADigitalDemodulator::put_SpectralInversion(SpectralInversion *pSpectralInvers #ifdef BDAPLGIN_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CBDADigitalDemodulator::put_SpectralInversion: pSpectralInversion %lu hr %lx\n", *pSpectralInversion, hr); + _swprintf(Buffer, L"CBDADigitalDemodulator::put_SpectralInversion: pSpectralInversion %lu hr %lx\n", *pSpectralInversion, hr); OutputDebugStringW(Buffer); #endif diff --git a/dll/directx/bdaplgin/frequencyfilter.cpp b/dll/directx/bdaplgin/frequencyfilter.cpp index 9b8f3707ac2..d67f22b7d2e 100644 --- a/dll/directx/bdaplgin/frequencyfilter.cpp +++ b/dll/directx/bdaplgin/frequencyfilter.cpp @@ -83,7 +83,7 @@ CBDAFrequencyFilter::QueryInterface( WCHAR Buffer[MAX_PATH]; LPOLESTR lpstr; StringFromCLSID(refiid, &lpstr); - swprintf(Buffer, L"CControlNode::QueryInterface: NoInterface for %s", lpstr); + _swprintf(Buffer, L"CControlNode::QueryInterface: NoInterface for %s", lpstr); OutputDebugStringW(Buffer); CoTaskMemFree(lpstr); DebugBreak(); @@ -122,7 +122,7 @@ CBDAFrequencyFilter::put_Frequency(ULONG ulFrequency) #ifdef BDAPLGIN_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CBDAFrequencyFilter::put_Frequency: m_NodeId %lu ulFrequency %lu hr %lx\n", m_NodeId, ulFrequency, hr); + _swprintf(Buffer, L"CBDAFrequencyFilter::put_Frequency: m_NodeId %lu ulFrequency %lu hr %lx\n", m_NodeId, ulFrequency, hr); OutputDebugStringW(Buffer); #endif @@ -152,7 +152,7 @@ CBDAFrequencyFilter::put_Polarity(Polarisation Polarity) #ifdef BDAPLGIN_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CBDAFrequencyFilter::put_Polarity: m_NodeId %lu Polarity %lu hr %lx\n", m_NodeId, Polarity, hr); + _swprintf(Buffer, L"CBDAFrequencyFilter::put_Polarity: m_NodeId %lu Polarity %lu hr %lx\n", m_NodeId, Polarity, hr); OutputDebugStringW(Buffer); #endif @@ -182,7 +182,7 @@ CBDAFrequencyFilter::put_Range(ULONG ulRange) #ifdef BDAPLGIN_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CBDAFrequencyFilter::put_Range: m_NodeId %lu ulRange %lu hr %lx\n", m_NodeId, ulRange, hr); + _swprintf(Buffer, L"CBDAFrequencyFilter::put_Range: m_NodeId %lu ulRange %lu hr %lx\n", m_NodeId, ulRange, hr); OutputDebugStringW(Buffer); #endif @@ -212,7 +212,7 @@ CBDAFrequencyFilter::put_Bandwidth(ULONG ulBandwidth) #ifdef BDAPLGIN_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CBDAFrequencyFilter::put_Bandwidth: m_NodeId %lu ulBandwidth %lu hr %lx\n", m_NodeId, ulBandwidth, hr); + _swprintf(Buffer, L"CBDAFrequencyFilter::put_Bandwidth: m_NodeId %lu ulBandwidth %lu hr %lx\n", m_NodeId, ulBandwidth, hr); OutputDebugStringW(Buffer); #endif @@ -241,7 +241,7 @@ CBDAFrequencyFilter::put_FrequencyMultiplier(ULONG ulMultiplier) #ifdef BDAPLGIN_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CBDAFrequencyFilter::put_FrequencyMultiplier: m_NodeId %lu ulMultiplier %lu hr %lx\n", m_NodeId, ulMultiplier, hr); + _swprintf(Buffer, L"CBDAFrequencyFilter::put_FrequencyMultiplier: m_NodeId %lu ulMultiplier %lu hr %lx\n", m_NodeId, ulMultiplier, hr); OutputDebugStringW(Buffer); #endif diff --git a/dll/directx/bdaplgin/lnbinfo.cpp b/dll/directx/bdaplgin/lnbinfo.cpp index 811a5eede59..d7b6abda9c0 100644 --- a/dll/directx/bdaplgin/lnbinfo.cpp +++ b/dll/directx/bdaplgin/lnbinfo.cpp @@ -78,7 +78,7 @@ CBDALNBInfo::QueryInterface( WCHAR Buffer[100]; LPOLESTR lpstr; StringFromCLSID(refiid, &lpstr); - swprintf(Buffer, L"CBDALNBInfo::QueryInterface: NoInterface for %s", lpstr); + _swprintf(Buffer, L"CBDALNBInfo::QueryInterface: NoInterface for %s", lpstr); OutputDebugStringW(Buffer); CoTaskMemFree(lpstr); #endif @@ -102,7 +102,7 @@ CBDALNBInfo::put_LocalOscillatorFrequencyLowBand(ULONG ulLOFLow) #ifdef BDAPLGIN_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CBDALNBInfo::put_LocalOscillatorFrequencyLowBand: m_NodeId %lu ulLOFLow %lu hr %lx\n", m_NodeId, ulLOFLow, hr); + _swprintf(Buffer, L"CBDALNBInfo::put_LocalOscillatorFrequencyLowBand: m_NodeId %lu ulLOFLow %lu hr %lx\n", m_NodeId, ulLOFLow, hr); OutputDebugStringW(Buffer); #endif @@ -132,7 +132,7 @@ CBDALNBInfo::put_LocalOscillatorFrequencyHighBand(ULONG ulLOFHigh) #ifdef BDAPLGIN_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CBDALNBInfo::put_LocalOscillatorFrequencyHighBand: m_NodeId %lu ulLOFHigh %lu hr %lx\n", m_NodeId, ulLOFHigh, hr); + _swprintf(Buffer, L"CBDALNBInfo::put_LocalOscillatorFrequencyHighBand: m_NodeId %lu ulLOFHigh %lu hr %lx\n", m_NodeId, ulLOFHigh, hr); OutputDebugStringW(Buffer); #endif @@ -162,7 +162,7 @@ CBDALNBInfo::put_HighLowSwitchFrequency(ULONG ulSwitchFrequency) #ifdef BDAPLGIN_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CBDALNBInfo::put_HighLowSwitchFrequency: m_NodeId %lu ulSwitchFrequency %lu hr %lx\n", m_NodeId, ulSwitchFrequency, hr); + _swprintf(Buffer, L"CBDALNBInfo::put_HighLowSwitchFrequency: m_NodeId %lu ulSwitchFrequency %lu hr %lx\n", m_NodeId, ulSwitchFrequency, hr); OutputDebugStringW(Buffer); #endif diff --git a/dll/directx/bdaplgin/pincontrol.cpp b/dll/directx/bdaplgin/pincontrol.cpp index c2ea461fff3..1415f51b486 100644 --- a/dll/directx/bdaplgin/pincontrol.cpp +++ b/dll/directx/bdaplgin/pincontrol.cpp @@ -100,7 +100,7 @@ CBDAPinControl::GetPinID(ULONG *pulPinID) #ifdef BDAPLGIN_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CBDAPinControl::GetPinID: hr %lx pulPinID %lu BytesReturned %lx\n", hr, *pulPinID, BytesReturned); + _swprintf(Buffer, L"CBDAPinControl::GetPinID: hr %lx pulPinID %lu BytesReturned %lx\n", hr, *pulPinID, BytesReturned); OutputDebugStringW(Buffer); #endif @@ -125,7 +125,7 @@ CBDAPinControl::GetPinType(ULONG *pulPinType) #ifdef BDAPLGIN_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CBDAPinControl::GetPinType: hr %lx pulPinType %lu BytesReturned %lx\n", hr, *pulPinType, BytesReturned); + _swprintf(Buffer, L"CBDAPinControl::GetPinType: hr %lx pulPinType %lu BytesReturned %lx\n", hr, *pulPinType, BytesReturned); OutputDebugStringW(Buffer); #endif @@ -360,7 +360,7 @@ CBDAPinControl_fnConstructor( else { WCHAR Buffer[100]; - swprintf(Buffer, L"CBDAPinControl_fnConstructor failed to register filter with %lx\n", hr); + _swprintf(Buffer, L"CBDAPinControl_fnConstructor failed to register filter with %lx\n", hr); OutputDebugStringW(Buffer); } } diff --git a/dll/directx/bdaplgin/signalstatistics.cpp b/dll/directx/bdaplgin/signalstatistics.cpp index deaa9844595..56878b0ad26 100644 --- a/dll/directx/bdaplgin/signalstatistics.cpp +++ b/dll/directx/bdaplgin/signalstatistics.cpp @@ -106,7 +106,7 @@ CBDASignalStatistics::get_SignalStrength(LONG *plDbStrength) #ifdef BDAPLGIN_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CBDASignalStatistics::get_SignalStrength: m_NodeId %lu hr %lx, BytesReturned %lu plDbStrength %ld\n", m_NodeId, hr, BytesReturned, *plDbStrength); + _swprintf(Buffer, L"CBDASignalStatistics::get_SignalStrength: m_NodeId %lu hr %lx, BytesReturned %lu plDbStrength %ld\n", m_NodeId, hr, BytesReturned, *plDbStrength); OutputDebugStringW(Buffer); #endif @@ -137,7 +137,7 @@ CBDASignalStatistics::get_SignalQuality(LONG *plPercentQuality) #ifdef BDAPLGIN_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CBDASignalStatistics::get_SignalQuality: m_NodeId %lu hr %lx, BytesReturned %lu plPercentQuality %lu\n", m_NodeId, hr, BytesReturned, *plPercentQuality); + _swprintf(Buffer, L"CBDASignalStatistics::get_SignalQuality: m_NodeId %lu hr %lx, BytesReturned %lu plPercentQuality %lu\n", m_NodeId, hr, BytesReturned, *plPercentQuality); OutputDebugStringW(Buffer); #endif @@ -172,7 +172,7 @@ CBDASignalStatistics::get_SignalPresent(BOOLEAN *pfPresent) #ifdef BDAPLGIN_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CBDASignalStatistics::get_SignalPresent: m_NodeId %lu hr %lx, BytesReturned %lu Present %lu\n", m_NodeId, hr, BytesReturned, Present); + _swprintf(Buffer, L"CBDASignalStatistics::get_SignalPresent: m_NodeId %lu hr %lx, BytesReturned %lu Present %lu\n", m_NodeId, hr, BytesReturned, Present); OutputDebugStringW(Buffer); #endif @@ -206,7 +206,7 @@ CBDASignalStatistics::get_SignalLocked(BOOLEAN *pfLocked) #ifdef BDAPLGIN_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CBDASignalStatistics::get_SignalLocked: m_NodeId %lu hr %lx, BytesReturned %lu Locked %lu\n", m_NodeId, hr, BytesReturned, Locked); + _swprintf(Buffer, L"CBDASignalStatistics::get_SignalLocked: m_NodeId %lu hr %lx, BytesReturned %lu Locked %lu\n", m_NodeId, hr, BytesReturned, Locked); OutputDebugStringW(Buffer); #endif @@ -229,7 +229,7 @@ CBDASignalStatistics::put_SampleTime(LONG lmsSampleTime) #ifdef BDAPLGIN_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CBDASignalStatistics::put_SampleTime: m_NodeId %lu hr %lx\n", m_NodeId, hr); + _swprintf(Buffer, L"CBDASignalStatistics::put_SampleTime: m_NodeId %lu hr %lx\n", m_NodeId, hr); OutputDebugStringW(Buffer); #endif @@ -253,7 +253,7 @@ CBDASignalStatistics::get_SampleTime(LONG *plmsSampleTime) #ifdef BDAPLGIN_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CBDASignalStatistics::get_SampleTime: m_NodeId %lu hr %lx, BytesReturned %lu \n", m_NodeId, hr, BytesReturned); + _swprintf(Buffer, L"CBDASignalStatistics::get_SampleTime: m_NodeId %lu hr %lx, BytesReturned %lu \n", m_NodeId, hr, BytesReturned); OutputDebugStringW(Buffer); #endif diff --git a/dll/directx/ksproxy/classfactory.cpp b/dll/directx/ksproxy/classfactory.cpp index ee8dd7eaaf0..211c5a0b293 100644 --- a/dll/directx/ksproxy/classfactory.cpp +++ b/dll/directx/ksproxy/classfactory.cpp @@ -74,7 +74,7 @@ CClassFactory::CreateInstance( StringFromCLSID(riid, &lpstr); - swprintf(Buffer, L"riid %s", lpstr); + _swprintf(Buffer, L"riid %s", lpstr); OutputDebugStringW(Buffer); diff --git a/dll/directx/ksproxy/clockforward.cpp b/dll/directx/ksproxy/clockforward.cpp index d7cde7b21a4..b55dca48552 100644 --- a/dll/directx/ksproxy/clockforward.cpp +++ b/dll/directx/ksproxy/clockforward.cpp @@ -118,7 +118,7 @@ CKsClockForwarder::Stop() { #ifdef KSPROXY_TRACE WCHAR Buffer[200]; - swprintf(Buffer, L"CKsClockForwarder::Stop m_ThreadStarted %u m_PendingStop %u m_hThread %p m_hEvent %p m_Handle %p\n", m_ThreadStarted, m_PendingStop, m_hThread, m_hEvent, m_Handle); + _swprintf(Buffer, L"CKsClockForwarder::Stop m_ThreadStarted %u m_PendingStop %u m_hThread %p m_hEvent %p m_Handle %p\n", m_ThreadStarted, m_PendingStop, m_hThread, m_hEvent, m_Handle); OutputDebugStringW(Buffer); #endif @@ -287,7 +287,7 @@ CKsClockForwarder::SetClockState(KSSTATE State) #ifdef KSPROXY_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CKsClockForwarder::SetClockState m_State %u State %u hr %lx\n", m_State, State, hr); + _swprintf(Buffer, L"CKsClockForwarder::SetClockState m_State %u State %u hr %lx\n", m_State, State, hr); OutputDebugStringW(Buffer); #endif diff --git a/dll/directx/ksproxy/enum_mediatypes.cpp b/dll/directx/ksproxy/enum_mediatypes.cpp index f3a449caa8b..a6462603cdd 100644 --- a/dll/directx/ksproxy/enum_mediatypes.cpp +++ b/dll/directx/ksproxy/enum_mediatypes.cpp @@ -184,7 +184,7 @@ CEnumMediaTypes_fnConstructor( WCHAR Buffer[MAX_PATH]; LPOLESTR lpstr; StringFromCLSID(riid, &lpstr); - swprintf(Buffer, L"CEnumMediaTypes_fnConstructor riid %s\n", lpstr); + _swprintf(Buffer, L"CEnumMediaTypes_fnConstructor riid %s\n", lpstr); OutputDebugStringW(Buffer); #endif diff --git a/dll/directx/ksproxy/enumpins.cpp b/dll/directx/ksproxy/enumpins.cpp index 147ce1d3b76..5617b077535 100644 --- a/dll/directx/ksproxy/enumpins.cpp +++ b/dll/directx/ksproxy/enumpins.cpp @@ -67,7 +67,7 @@ CEnumPins::QueryInterface( WCHAR Buffer[100]; LPOLESTR lpstr; StringFromCLSID(refiid, &lpstr); - swprintf(Buffer, L"CEnumPins::QueryInterface: NoInterface for %s\n", lpstr); + _swprintf(Buffer, L"CEnumPins::QueryInterface: NoInterface for %s\n", lpstr); OutputDebugStringW(Buffer); CoTaskMemFree(lpstr); diff --git a/dll/directx/ksproxy/input_pin.cpp b/dll/directx/ksproxy/input_pin.cpp index 97f952de65d..33e8f54d66b 100644 --- a/dll/directx/ksproxy/input_pin.cpp +++ b/dll/directx/ksproxy/input_pin.cpp @@ -324,7 +324,7 @@ CInputPin::QueryInterface( LPOLESTR lpstr; StringFromCLSID(refiid, &lpstr); - swprintf(Buffer, L"CInputPin::QueryInterface: NoInterface for %s\n", lpstr); + _swprintf(Buffer, L"CInputPin::QueryInterface: NoInterface for %s\n", lpstr); OutputDebugStringW(Buffer); CoTaskMemFree(lpstr); @@ -619,7 +619,7 @@ CInputPin::NotifyAllocator(IMemAllocator *pAllocator, BOOL bReadOnly) #ifdef KSPROXY_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CInputPin::NotifyAllocator hr %lx bReadOnly, %u cbAlign %u cbBuffer %u cbPrefix %u cBuffers %u\n", hr, bReadOnly, Properties.cbAlign, Properties.cbBuffer, Properties.cbPrefix, Properties.cBuffers); + _swprintf(Buffer, L"CInputPin::NotifyAllocator hr %lx bReadOnly, %u cbAlign %u cbBuffer %u cbPrefix %u cBuffers %u\n", hr, bReadOnly, Properties.cbAlign, Properties.cbBuffer, Properties.cbPrefix, Properties.cBuffers); OutputDebugStringW(Buffer); #endif @@ -664,7 +664,7 @@ CInputPin::GetAllocatorRequirements(ALLOCATOR_PROPERTIES *pProps) #ifdef KSPROXY_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CInputPin::GetAllocatorRequirements hr %lx m_hPin %p cBuffers %u cbBuffer %u cbAlign %u cbPrefix %u\n", hr, m_hPin, pProps->cBuffers, pProps->cbBuffer, pProps->cbAlign, pProps->cbPrefix); + _swprintf(Buffer, L"CInputPin::GetAllocatorRequirements hr %lx m_hPin %p cBuffers %u cbBuffer %u cbAlign %u cbPrefix %u\n", hr, m_hPin, pProps->cBuffers, pProps->cbBuffer, pProps->cbAlign, pProps->cbPrefix); OutputDebugStringW(Buffer); #endif @@ -1465,7 +1465,7 @@ CInputPin::CreatePin( { #ifdef KSPROXY_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CInputPin::CreatePin unexpected communication %u %s\n", m_Communication, m_PinName); + _swprintf(Buffer, L"CInputPin::CreatePin unexpected communication %u %s\n", m_Communication, m_PinName); OutputDebugStringW(Buffer); #endif hr = E_FAIL; @@ -1570,7 +1570,7 @@ CInputPin::CreatePinHandle( StringFromIID(m_MediaFormat.formattype, &pFormat); WCHAR Buffer[200]; - swprintf(Buffer, L"CInputPin::CreatePinHandle Major %s SubType %s Format %s pbFormat %p cbFormat %u\n", pMajor, pSub, pFormat, pmt->pbFormat, pmt->cbFormat); + _swprintf(Buffer, L"CInputPin::CreatePinHandle Major %s SubType %s Format %s pbFormat %p cbFormat %u\n", pMajor, pSub, pFormat, pmt->pbFormat, pmt->cbFormat); CoTaskMemFree(pMajor); CoTaskMemFree(pSub); CoTaskMemFree(pFormat); @@ -1669,7 +1669,7 @@ CInputPin::GetSupportedSets( #ifdef KSPROXY_TRACE WCHAR Buffer[200]; - swprintf(Buffer, L"CInputPin::GetSupportedSets NumProperty %lu NumMethods %lu NumEvents %lu\n", NumProperty, NumMethods, NumEvents); + _swprintf(Buffer, L"CInputPin::GetSupportedSets NumProperty %lu NumMethods %lu NumEvents %lu\n", NumProperty, NumMethods, NumEvents); OutputDebugStringW(Buffer); #endif diff --git a/dll/directx/ksproxy/interface.cpp b/dll/directx/ksproxy/interface.cpp index 156ff86e9ff..484eb606bc3 100644 --- a/dll/directx/ksproxy/interface.cpp +++ b/dll/directx/ksproxy/interface.cpp @@ -287,7 +287,7 @@ CKsInterfaceHandler::KsProcessMediaSamples( } #ifdef KSPROXY_TRACE WCHAR Buffer[200]; - swprintf(Buffer, L"CKsInterfaceHandler::KsProcessMediaSamples PinName %s BufferLength %lu Property Buffer %p ExtendedSize %u lActual %u dwSampleFlags %lx\n", m_PinName, Properties.cbBuffer, Properties.pbBuffer, ExtendedSize, Properties.lActual, Properties.dwSampleFlags); + _swprintf(Buffer, L"CKsInterfaceHandler::KsProcessMediaSamples PinName %s BufferLength %lu Property Buffer %p ExtendedSize %u lActual %u dwSampleFlags %lx\n", m_PinName, Properties.cbBuffer, Properties.pbBuffer, ExtendedSize, Properties.lActual, Properties.dwSampleFlags); OutputDebugStringW(Buffer); #endif diff --git a/dll/directx/ksproxy/output_pin.cpp b/dll/directx/ksproxy/output_pin.cpp index 3bb089360b2..796ab351d3c 100644 --- a/dll/directx/ksproxy/output_pin.cpp +++ b/dll/directx/ksproxy/output_pin.cpp @@ -252,7 +252,7 @@ COutputPin::COutputPin( #ifdef KSPROXY_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"COutputPin::COutputPin Format %p pbFormat %lu\n", &m_MediaFormat, m_MediaFormat.cbFormat); + _swprintf(Buffer, L"COutputPin::COutputPin Format %p pbFormat %lu\n", &m_MediaFormat, m_MediaFormat.cbFormat); OutputDebugStringW(Buffer); #endif @@ -398,7 +398,7 @@ COutputPin::QueryInterface( WCHAR Buffer[MAX_PATH]; LPOLESTR lpstr; StringFromCLSID(refiid, &lpstr); - swprintf(Buffer, L"COutputPin::QueryInterface: NoInterface for %s PinId %u PinName %s\n", lpstr, m_PinId, m_PinName); + _swprintf(Buffer, L"COutputPin::QueryInterface: NoInterface for %s PinId %u PinName %s\n", lpstr, m_PinId, m_PinName); OutputDebugStringW(Buffer); CoTaskMemFree(lpstr); #endif @@ -1363,7 +1363,7 @@ COutputPin::KsProperty( WCHAR Buffer[100]; LPOLESTR pstr; StringFromCLSID(Property->Set, &pstr); - swprintf(Buffer, L"COutputPin::KsProperty Set %s Id %lu Flags %x hr %x\n", pstr, Property->Id, Property->Flags, hr); + _swprintf(Buffer, L"COutputPin::KsProperty Set %s Id %lu Flags %x hr %x\n", pstr, Property->Id, Property->Flags, hr); OutputDebugStringW(Buffer); #endif @@ -1556,7 +1556,7 @@ COutputPin::Connect(IPin *pReceivePin, const AM_MEDIA_TYPE *pmt) if (FAILED(hr)) { #ifdef KSPROXY_TRACE - swprintf(Buffer, L"COutputPin::Connect CreatePin handle failed with %lx\n", hr); + _swprintf(Buffer, L"COutputPin::Connect CreatePin handle failed with %lx\n", hr); OutputDebugStringW(Buffer); #endif return hr; @@ -1607,7 +1607,7 @@ COutputPin::Connect(IPin *pReceivePin, const AM_MEDIA_TYPE *pmt) if (FAILED(hr)) { #ifdef KSPROXY_TRACE - swprintf(Buffer, L"COutputPin::Connect IMemAllocator::SetProperties failed with hr %lx\n", hr); + _swprintf(Buffer, L"COutputPin::Connect IMemAllocator::SetProperties failed with hr %lx\n", hr); OutputDebugStringW(Buffer); #endif m_MemAllocator->Release(); @@ -1621,7 +1621,7 @@ COutputPin::Connect(IPin *pReceivePin, const AM_MEDIA_TYPE *pmt) if (FAILED(hr)) { #ifdef KSPROXY_TRACE - swprintf(Buffer, L"COutputPin::Connect IMemAllocator::Commit failed with hr %lx\n", hr); + _swprintf(Buffer, L"COutputPin::Connect IMemAllocator::Commit failed with hr %lx\n", hr); OutputDebugStringW(Buffer); #endif m_MemAllocator->Release(); @@ -1634,7 +1634,7 @@ COutputPin::Connect(IPin *pReceivePin, const AM_MEDIA_TYPE *pmt) if (FAILED(hr)) { #ifdef KSPROXY_TRACE - swprintf(Buffer, L"COutputPin::Connect No IMemAllocatorCallbackTemp interface hr %lx\n", hr); + _swprintf(Buffer, L"COutputPin::Connect No IMemAllocatorCallbackTemp interface hr %lx\n", hr); OutputDebugStringW(Buffer); #endif m_MemAllocator->Release(); @@ -1651,7 +1651,7 @@ COutputPin::Connect(IPin *pReceivePin, const AM_MEDIA_TYPE *pmt) if (FAILED(hr)) { #ifdef KSPROXY_TRACE - swprintf(Buffer, L"COutputPin::Connect IMemAllocatorNotifyCallbackTemp::SetNotify failed hr %lx\n", hr); + _swprintf(Buffer, L"COutputPin::Connect IMemAllocatorNotifyCallbackTemp::SetNotify failed hr %lx\n", hr); OutputDebugStringW(Buffer); #endif m_MemAllocator->Release(); @@ -1664,7 +1664,7 @@ COutputPin::Connect(IPin *pReceivePin, const AM_MEDIA_TYPE *pmt) if (FAILED(hr)) { #ifdef KSPROXY_TRACE - swprintf(Buffer, L"COutputPin::Connect IMemInputPin::NotifyAllocator failed with hr %lx\n", hr); + _swprintf(Buffer, L"COutputPin::Connect IMemInputPin::NotifyAllocator failed with hr %lx\n", hr); OutputDebugStringW(Buffer); #endif m_MemAllocator->Release(); @@ -1986,7 +1986,7 @@ COutputPin::CreatePin( { #ifdef KSPROXY_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"COutputPin::CreatePin KsQueryMediums failed %lx\n", hr); + _swprintf(Buffer, L"COutputPin::CreatePin KsQueryMediums failed %lx\n", hr); OutputDebugStringW(Buffer); #endif return hr; @@ -1999,7 +1999,7 @@ COutputPin::CreatePin( // failed #ifdef KSPROXY_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"COutputPin::CreatePin KsQueryInterfaces failed %lx\n", hr); + _swprintf(Buffer, L"COutputPin::CreatePin KsQueryInterfaces failed %lx\n", hr); OutputDebugStringW(Buffer); #endif @@ -2037,7 +2037,7 @@ COutputPin::CreatePin( { #ifdef KSPROXY_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"COutputPin::CreatePinHandle failed with %lx\n", hr); + _swprintf(Buffer, L"COutputPin::CreatePinHandle failed with %lx\n", hr); OutputDebugStringW(Buffer); #endif return hr; @@ -2055,7 +2055,7 @@ COutputPin::CreatePin( #ifdef KSPROXY_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"COutputPin::CreatePin failed to create interface handler %lx\n", hr); + _swprintf(Buffer, L"COutputPin::CreatePin failed to create interface handler %lx\n", hr); OutputDebugStringW(Buffer); #endif @@ -2069,7 +2069,7 @@ COutputPin::CreatePin( // failed to initialize interface handler plugin #ifdef KSPROXY_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"COutputPin::CreatePin failed to initialize interface handler %lx\n", hr); + _swprintf(Buffer, L"COutputPin::CreatePin failed to initialize interface handler %lx\n", hr); OutputDebugStringW(Buffer); #endif InterfaceHandler->Release(); @@ -2086,7 +2086,7 @@ COutputPin::CreatePin( { #ifdef KSPROXY_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"COutputPin::CreatePin unexpected communication %u %s\n", m_Communication, m_PinName); + _swprintf(Buffer, L"COutputPin::CreatePin unexpected communication %u %s\n", m_Communication, m_PinName); OutputDebugStringW(Buffer); #endif @@ -2099,7 +2099,7 @@ COutputPin::CreatePin( #ifdef KSPROXY_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"COutputPin::CreatePin Result %lx\n", hr); + _swprintf(Buffer, L"COutputPin::CreatePin Result %lx\n", hr); OutputDebugStringW(Buffer); #endif @@ -2172,7 +2172,7 @@ COutputPin::CreatePinHandle( { // copy extended format WCHAR Buffer[100]; - swprintf(Buffer, L"COutputPin::CreatePinHandle copy format %p pbFormat %lu\n", pmt, pmt->cbFormat); + _swprintf(Buffer, L"COutputPin::CreatePinHandle copy format %p pbFormat %lu\n", pmt, pmt->cbFormat); OutputDebugStringW(Buffer); CopyMemory((DataFormat + 1), pmt->pbFormat, pmt->cbFormat); } @@ -2216,7 +2216,7 @@ COutputPin::CreatePinHandle( StringFromIID(m_MediaFormat.subtype , &pSub); StringFromIID(m_MediaFormat.formattype, &pFormat); WCHAR Buffer[200]; - swprintf(Buffer, L"COutputPin::CreatePinHandle Major %s SubType %s Format %s pbFormat %p cbFormat %u\n", pMajor, pSub, pFormat, pmt->pbFormat, pmt->cbFormat); + _swprintf(Buffer, L"COutputPin::CreatePinHandle Major %s SubType %s Format %s pbFormat %p cbFormat %u\n", pMajor, pSub, pFormat, pmt->pbFormat, pmt->cbFormat); CoTaskMemFree(pMajor); CoTaskMemFree(pSub); CoTaskMemFree(pFormat); @@ -2343,7 +2343,7 @@ COutputPin::GetSupportedSets( #ifdef KSPROXY_TRACE WCHAR Buffer[200]; - swprintf(Buffer, L"NumProperty %lu NumMethods %lu NumEvents %lu\n", NumProperty, NumMethods, NumEvents); + _swprintf(Buffer, L"NumProperty %lu NumMethods %lu NumEvents %lu\n", NumProperty, NumMethods, NumEvents); OutputDebugStringW(Buffer); #endif @@ -2487,7 +2487,7 @@ COutputPin::IoProcessRoutine() if (FAILED(hr) || !StreamSegment) { #ifdef KSPROXY_TRACE - swprintf(Buffer, L"COutputPin::IoProcessRoutine KsProcessMediaSamples FAILED PinName %s hr %lx\n", m_PinName, hr); + _swprintf(Buffer, L"COutputPin::IoProcessRoutine KsProcessMediaSamples FAILED PinName %s hr %lx\n", m_PinName, hr); OutputDebugStringW(Buffer); #endif break; @@ -2496,7 +2496,7 @@ COutputPin::IoProcessRoutine() // interface handle should increment pending i/o count assert(m_IoCount >= 1); - swprintf(Buffer, L"COutputPin::IoProcessRoutine m_IoCount %lu NumHandles %lu\n", m_IoCount, NumHandles); + _swprintf(Buffer, L"COutputPin::IoProcessRoutine m_IoCount %lu NumHandles %lu\n", m_IoCount, NumHandles); OutputDebugStringW(Buffer); if (m_IoCount != NumHandles) @@ -2508,7 +2508,7 @@ COutputPin::IoProcessRoutine() // wait for i/o completion dwStatus = WaitForSingleObject(hEvent, INFINITE); - swprintf(Buffer, L"COutputPin::IoProcessRoutine dwStatus %lx Error %lx NumHandles %lu\n", dwStatus, GetLastError(), NumHandles); + _swprintf(Buffer, L"COutputPin::IoProcessRoutine dwStatus %lx Error %lx NumHandles %lu\n", dwStatus, GetLastError(), NumHandles); OutputDebugStringW(Buffer); // perform completion @@ -2525,7 +2525,7 @@ COutputPin::IoProcessRoutine() hr = m_MemInputPin->Receive(Samples[0]); #ifdef KSPROXY_TRACE - swprintf(Buffer, L"COutputPin::IoProcessRoutine PinName %s IMemInputPin::Receive hr %lx Sample %p m_MemAllocator %p\n", m_PinName, hr, Sample, m_MemAllocator); + _swprintf(Buffer, L"COutputPin::IoProcessRoutine PinName %s IMemInputPin::Receive hr %lx Sample %p m_MemAllocator %p\n", m_PinName, hr, Sample, m_MemAllocator); OutputDebugStringW(Buffer); #endif @@ -2642,7 +2642,7 @@ COutputPin_SetState( hr = pPin->KsProperty(&Property, sizeof(KSPROPERTY), &CurState, sizeof(KSSTATE), &BytesReturned); #ifdef KSPROXY_TRACE - swprintf(Buffer, L"COutputPin_SetState Setting State CurState: KSSTATE_STOP KSSTATE_ACQUIRE PinName %s hr %lx\n", pPin->m_PinName, hr); + _swprintf(Buffer, L"COutputPin_SetState Setting State CurState: KSSTATE_STOP KSSTATE_ACQUIRE PinName %s hr %lx\n", pPin->m_PinName, hr); OutputDebugStringW(Buffer); #endif @@ -2666,7 +2666,7 @@ COutputPin_SetState( hr = pPin->KsProperty(&Property, sizeof(KSPROPERTY), &CurState, sizeof(KSSTATE), &BytesReturned); #ifdef KSPROXY_TRACE - swprintf(Buffer, L"COutputPin_SetState Setting State CurState KSSTATE_ACQUIRE KSSTATE_PAUSE PinName %s hr %lx\n", pPin->m_PinName, hr); + _swprintf(Buffer, L"COutputPin_SetState Setting State CurState KSSTATE_ACQUIRE KSSTATE_PAUSE PinName %s hr %lx\n", pPin->m_PinName, hr); OutputDebugStringW(Buffer); #endif @@ -2690,7 +2690,7 @@ COutputPin_SetState( hr = pPin->KsProperty(&Property, sizeof(KSPROPERTY), &CurState, sizeof(KSSTATE), &BytesReturned); #ifdef KSPROXY_TRACE - swprintf(Buffer, L"COutputPin_SetState Setting State CurState: KSSTATE_PAUSE KSSTATE_RUN PinName %s hr %lx\n", pPin->m_PinName, hr); + _swprintf(Buffer, L"COutputPin_SetState Setting State CurState: KSSTATE_PAUSE KSSTATE_RUN PinName %s hr %lx\n", pPin->m_PinName, hr); OutputDebugStringW(Buffer); #endif @@ -2722,7 +2722,7 @@ COutputPin_SetState( hr = pPin->KsProperty(&Property, sizeof(KSPROPERTY), &CurState, sizeof(KSSTATE), &BytesReturned); #ifdef KSPROXY_TRACE - swprintf(Buffer, L"COutputPin_SetState Setting State CurState: KSSTATE_RUN KSSTATE_PAUSE PinName %s hr %lx\n", pPin->m_PinName, hr); + _swprintf(Buffer, L"COutputPin_SetState Setting State CurState: KSSTATE_RUN KSSTATE_PAUSE PinName %s hr %lx\n", pPin->m_PinName, hr); OutputDebugStringW(Buffer); #endif @@ -2746,7 +2746,7 @@ COutputPin_SetState( hr = pPin->KsProperty(&Property, sizeof(KSPROPERTY), &CurState, sizeof(KSSTATE), &BytesReturned); #ifdef KSPROXY_TRACE - swprintf(Buffer, L"COutputPin_SetState Setting State CurState: KSSTATE_PAUSE KSSTATE_ACQUIRE PinName %s hr %lx\n", pPin->m_PinName, hr); + _swprintf(Buffer, L"COutputPin_SetState Setting State CurState: KSSTATE_PAUSE KSSTATE_ACQUIRE PinName %s hr %lx\n", pPin->m_PinName, hr); OutputDebugStringW(Buffer); #endif @@ -2778,7 +2778,7 @@ COutputPin_SetState( hr = pPin->KsProperty(&Property, sizeof(KSPROPERTY), &CurState, sizeof(KSSTATE), &BytesReturned); #ifdef KSPROXY_TRACE - swprintf(Buffer, L"COutputPin_SetState Setting State CurState: KSSTATE_ACQUIRE KSSTATE_STOP PinName %s hr %lx\n", pPin->m_PinName, hr); + _swprintf(Buffer, L"COutputPin_SetState Setting State CurState: KSSTATE_ACQUIRE KSSTATE_STOP PinName %s hr %lx\n", pPin->m_PinName, hr); OutputDebugStringW(Buffer); #endif diff --git a/dll/directx/ksproxy/proxy.cpp b/dll/directx/ksproxy/proxy.cpp index 3f38d6d5f0f..a2d501db89d 100644 --- a/dll/directx/ksproxy/proxy.cpp +++ b/dll/directx/ksproxy/proxy.cpp @@ -343,7 +343,7 @@ CKsProxy::QueryInterface( WCHAR Buffer[100]; LPOLESTR lpstr; StringFromCLSID(refiid, &lpstr); - swprintf(Buffer, L"CKsProxy::QueryInterface plugin %lu supports interface %s\n", Index, lpstr); + _swprintf(Buffer, L"CKsProxy::QueryInterface plugin %lu supports interface %s\n", Index, lpstr); OutputDebugStringW(Buffer); CoTaskMemFree(lpstr); #endif @@ -355,7 +355,7 @@ CKsProxy::QueryInterface( WCHAR Buffer[MAX_PATH]; LPOLESTR lpstr; StringFromCLSID(refiid, &lpstr); - swprintf(Buffer, L"CKsProxy::QueryInterface: NoInterface for %s !!!\n", lpstr); + _swprintf(Buffer, L"CKsProxy::QueryInterface: NoInterface for %s !!!\n", lpstr); OutputDebugStringW(Buffer); CoTaskMemFree(lpstr); #endif @@ -968,7 +968,7 @@ CKsProxy::IsFormatSupported( WCHAR Buffer[100]; LPOLESTR pstr; StringFromCLSID(*pFormat, &pstr); - swprintf(Buffer, L"CKsProxy::IsFormatSupported %s\n",pstr); + _swprintf(Buffer, L"CKsProxy::IsFormatSupported %s\n",pstr); OutputDebugStringW(Buffer); #endif @@ -980,7 +980,7 @@ CKsProxy::IsFormatSupported( if (SUCCEEDED(hr)) { #ifdef KSPROXY_TRACE - swprintf(Buffer, L"CKsProxy::IsFormatSupported NumFormat %lu\n",FormatList->Count); + _swprintf(Buffer, L"CKsProxy::IsFormatSupported NumFormat %lu\n",FormatList->Count); OutputDebugStringW(Buffer); #endif @@ -1694,7 +1694,7 @@ CKsProxy::GetMiscFlags() #ifdef KSPROXY_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CKsProxy::GetMiscFlags stub Flags %x\n", Flags); + _swprintf(Buffer, L"CKsProxy::GetMiscFlags stub Flags %x\n", Flags); OutputDebugStringW(Buffer); #endif @@ -1975,13 +1975,13 @@ CKsProxy::Load( #endif hr = pStm->Read(&Length, sizeof(ULONG), &BytesReturned); - swprintf(Buffer, L"Length hr %x hr length %lu\n", hr, Length); + _swprintf(Buffer, L"Length hr %x hr length %lu\n", hr, Length); OutputDebugStringW(Buffer); do { hr = pStm->Read(&PinId, sizeof(ULONG), &BytesReturned); - swprintf(Buffer, L"Read: hr %08x PinId %lx BytesReturned %lu\n", hr, PinId, BytesReturned); + _swprintf(Buffer, L"Read: hr %08x PinId %lx BytesReturned %lu\n", hr, PinId, BytesReturned); OutputDebugStringW(Buffer); if (FAILED(hr) || !BytesReturned) @@ -1992,7 +1992,7 @@ CKsProxy::Load( hr = pStm->Read(&MediaType, sizeof(AM_MEDIA_TYPE), &BytesReturned); if (FAILED(hr) || BytesReturned != sizeof(AM_MEDIA_TYPE)) { - swprintf(Buffer, L"Read failed with %lx\n", hr); + _swprintf(Buffer, L"Read failed with %lx\n", hr); OutputDebugStringW(Buffer); break; } @@ -2002,7 +2002,7 @@ CKsProxy::Load( StringFromIID(MediaType.subtype , &pSub); StringFromIID(MediaType.formattype, &pFormat); - swprintf(Buffer, L"BytesReturned %lu majortype %s subtype %s bFixedSizeSamples %u bTemporalCompression %u lSampleSize %u formattype %s, pUnk %p cbFormat %u pbFormat %p\n", BytesReturned, pMajor, pSub, MediaType.bFixedSizeSamples, MediaType.bTemporalCompression, MediaType.lSampleSize, pFormat, MediaType.pUnk, MediaType.cbFormat, MediaType.pbFormat); + _swprintf(Buffer, L"BytesReturned %lu majortype %s subtype %s bFixedSizeSamples %u bTemporalCompression %u lSampleSize %u formattype %s, pUnk %p cbFormat %u pbFormat %p\n", BytesReturned, pMajor, pSub, MediaType.bFixedSizeSamples, MediaType.bTemporalCompression, MediaType.lSampleSize, pFormat, MediaType.pUnk, MediaType.cbFormat, MediaType.pbFormat); OutputDebugStringW(Buffer); Length -= BytesReturned; @@ -2017,7 +2017,7 @@ CKsProxy::Load( hr = pStm->Read(&MediaType.pbFormat, sizeof(MediaType.cbFormat), &BytesReturned); if (FAILED(hr)) { - swprintf(Buffer, L"ReadFormat failed with %lx\n", hr); + _swprintf(Buffer, L"ReadFormat failed with %lx\n", hr); OutputDebugStringW(Buffer); break; } @@ -2243,7 +2243,7 @@ CKsProxy::GetSupportedSets( #ifdef KSPROXY_TRACE WCHAR Buffer[200]; - swprintf(Buffer, L"NumProperty %lu NumMethods %lu NumEvents %lu\n", NumProperty, NumMethods, NumEvents); + _swprintf(Buffer, L"NumProperty %lu NumMethods %lu NumEvents %lu\n", NumProperty, NumMethods, NumEvents); OutputDebugStringW(Buffer); #endif @@ -2424,11 +2424,11 @@ CKsProxy::GetPinName( if (DataFlow == KSPIN_DATAFLOW_IN) { - swprintf(Buffer, L"Input%lu", PinCount); + _swprintf(Buffer, L"Input%lu", PinCount); } else { - swprintf(Buffer, L"Output%lu", PinCount); + _swprintf(Buffer, L"Output%lu", PinCount); } // allocate pin name @@ -2472,7 +2472,7 @@ CKsProxy::CreatePins() { #ifdef KSPROXY_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CKsProxy::CreatePins GetPinInstanceCount failed with %lx\n", hr); + _swprintf(Buffer, L"CKsProxy::CreatePins GetPinInstanceCount failed with %lx\n", hr); OutputDebugStringW(Buffer); #endif continue; @@ -2485,7 +2485,7 @@ CKsProxy::CreatePins() { #ifdef KSPROXY_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CKsProxy::CreatePins GetPinCommunication failed with %lx\n", hr); + _swprintf(Buffer, L"CKsProxy::CreatePins GetPinCommunication failed with %lx\n", hr); OutputDebugStringW(Buffer); #endif continue; @@ -2496,7 +2496,7 @@ CKsProxy::CreatePins() // already maximum reached for this pin #ifdef KSPROXY_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CKsProxy::CreatePins Instances.CurrentCount == Instances.PossibleCount\n"); + _swprintf(Buffer, L"CKsProxy::CreatePins Instances.CurrentCount == Instances.PossibleCount\n"); OutputDebugStringW(Buffer); #endif continue; @@ -2508,7 +2508,7 @@ CKsProxy::CreatePins() { #ifdef KSPROXY_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CKsProxy::CreatePins GetPinDataflow failed with %lx\n", hr); + _swprintf(Buffer, L"CKsProxy::CreatePins GetPinDataflow failed with %lx\n", hr); OutputDebugStringW(Buffer); #endif continue; @@ -2523,7 +2523,7 @@ CKsProxy::CreatePins() { #ifdef KSPROXY_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CKsProxy::CreatePins GetPinName failed with %lx\n", hr); + _swprintf(Buffer, L"CKsProxy::CreatePins GetPinName failed with %lx\n", hr); OutputDebugStringW(Buffer); #endif continue; @@ -2537,7 +2537,7 @@ CKsProxy::CreatePins() { #ifdef KSPROXY_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CKsProxy::CreatePins CInputPin_Constructor failed with %lx\n", hr); + _swprintf(Buffer, L"CKsProxy::CreatePins CInputPin_Constructor failed with %lx\n", hr); OutputDebugStringW(Buffer); #endif CoTaskMemFree(PinName); @@ -2552,7 +2552,7 @@ CKsProxy::CreatePins() { #ifdef KSPROXY_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CKsProxy::CreatePins COutputPin_Constructor failed with %lx\n", hr); + _swprintf(Buffer, L"CKsProxy::CreatePins COutputPin_Constructor failed with %lx\n", hr); OutputDebugStringW(Buffer); #endif CoTaskMemFree(PinName); @@ -2566,7 +2566,7 @@ CKsProxy::CreatePins() #ifdef KSPROXY_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"Index %lu DataFlow %lu Name %s\n", Index, DataFlow, PinName); + _swprintf(Buffer, L"Index %lu DataFlow %lu Name %s\n", Index, DataFlow, PinName); OutputDebugStringW(Buffer); #endif @@ -2598,7 +2598,7 @@ CKsProxy::Load(IPropertyBag *pPropBag, IErrorLog *pErrorLog) if (FAILED(hr)) { #ifdef KSPROXY_TRACE - swprintf(Buffer, L"CKsProxy::Load Read %lx\n", hr); + _swprintf(Buffer, L"CKsProxy::Load Read %lx\n", hr); OutputDebugStringW(Buffer); #endif return MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, GetLastError()); @@ -2638,7 +2638,7 @@ CKsProxy::Load(IPropertyBag *pPropBag, IErrorLog *pErrorLog) { // failed to open device #ifdef KSPROXY_TRACE - swprintf(Buffer, L"CKsProxy:: failed to open device with %lx\n", GetLastError()); + _swprintf(Buffer, L"CKsProxy:: failed to open device with %lx\n", GetLastError()); OutputDebugStringW(Buffer); #endif return MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, GetLastError()); @@ -2675,7 +2675,7 @@ CKsProxy::Load(IPropertyBag *pPropBag, IErrorLog *pErrorLog) hr = CreatePins(); #ifdef KSPROXY_TRACE - swprintf(Buffer, L"CKsProxy::Load CreatePins %lx\n", hr); + _swprintf(Buffer, L"CKsProxy::Load CreatePins %lx\n", hr); OutputDebugStringW(Buffer); #endif @@ -2866,7 +2866,7 @@ CKsProxy::SetPinState( #ifdef KSPROXY_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CKsProxy::SetPinState Index %u State %u hr %lx\n", Index, State, hr); + _swprintf(Buffer, L"CKsProxy::SetPinState Index %u State %u hr %lx\n", Index, State, hr); OutputDebugStringW(Buffer); #endif @@ -2967,7 +2967,7 @@ CKsProxy::SetSyncSource( // failed to set master clock pObject->Release(); WCHAR Buffer[100]; - swprintf(Buffer, L"CKsProxy::SetSyncSource KSPROPERTY_STREAM_MASTERCLOCK failed with %lx\n", hr); + _swprintf(Buffer, L"CKsProxy::SetSyncSource KSPROPERTY_STREAM_MASTERCLOCK failed with %lx\n", hr); OutputDebugStringW(Buffer); return hr; } @@ -3099,7 +3099,7 @@ CKsProxy::JoinFilterGraph( { #ifdef KSPROXY_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CKsProxy::JoinFilterGraph pName %s pGraph %p m_Ref %u\n", pName, pGraph, m_Ref); + _swprintf(Buffer, L"CKsProxy::JoinFilterGraph pName %s pGraph %p m_Ref %u\n", pName, pGraph, m_Ref); OutputDebugStringW(Buffer); #endif @@ -3165,7 +3165,7 @@ CKsProxy_Constructor( WCHAR Buffer[100]; LPOLESTR pstr; StringFromCLSID(riid, &pstr); - swprintf(Buffer, L"CKsProxy_Constructor pUnkOuter %p riid %s\n", pUnkOuter, pstr); + _swprintf(Buffer, L"CKsProxy_Constructor pUnkOuter %p riid %s\n", pUnkOuter, pstr); OutputDebugStringW(Buffer); #endif diff --git a/dll/directx/msdvbnp/enum_mediatypes.cpp b/dll/directx/msdvbnp/enum_mediatypes.cpp index 22478ec948b..a5549b981f6 100644 --- a/dll/directx/msdvbnp/enum_mediatypes.cpp +++ b/dll/directx/msdvbnp/enum_mediatypes.cpp @@ -67,7 +67,7 @@ CEnumMediaTypes::QueryInterface( WCHAR Buffer[MAX_PATH]; LPOLESTR lpstr; StringFromCLSID(refiid, &lpstr); - swprintf(Buffer, L"CEnumMediaTypes::QueryInterface: NoInterface for %s\n", lpstr); + _swprintf(Buffer, L"CEnumMediaTypes::QueryInterface: NoInterface for %s\n", lpstr); OutputDebugStringW(Buffer); CoTaskMemFree(lpstr); @@ -167,7 +167,7 @@ CEnumMediaTypes_fnConstructor( WCHAR Buffer[MAX_PATH]; LPOLESTR lpstr; StringFromCLSID(riid, &lpstr); - swprintf(Buffer, L"CEnumMediaTypes_fnConstructor riid %s pUnknown %p\n", lpstr, pUnknown); + _swprintf(Buffer, L"CEnumMediaTypes_fnConstructor riid %s pUnknown %p\n", lpstr, pUnknown); OutputDebugStringW(Buffer); #endif diff --git a/dll/directx/msdvbnp/enumpins.cpp b/dll/directx/msdvbnp/enumpins.cpp index 17a74723e4f..1dbccc769e7 100644 --- a/dll/directx/msdvbnp/enumpins.cpp +++ b/dll/directx/msdvbnp/enumpins.cpp @@ -67,7 +67,7 @@ CEnumPins::QueryInterface( WCHAR Buffer[MAX_PATH]; LPOLESTR lpstr; StringFromCLSID(refiid, &lpstr); - swprintf(Buffer, L"CEnumPins::QueryInterface: NoInterface for %s\n", lpstr); + _swprintf(Buffer, L"CEnumPins::QueryInterface: NoInterface for %s\n", lpstr); OutputDebugStringW(Buffer); CoTaskMemFree(lpstr); diff --git a/dll/directx/msdvbnp/networkprovider.cpp b/dll/directx/msdvbnp/networkprovider.cpp index ec97523fc46..275b65e65ca 100644 --- a/dll/directx/msdvbnp/networkprovider.cpp +++ b/dll/directx/msdvbnp/networkprovider.cpp @@ -187,7 +187,7 @@ CNetworkProvider::QueryInterface( WCHAR Buffer[MAX_PATH]; LPOLESTR lpstr; StringFromCLSID(refiid, &lpstr); - swprintf(Buffer, L"CNetworkProvider::QueryInterface: DeviceFilter %lu supports %s !!!\n", Index, lpstr); + _swprintf(Buffer, L"CNetworkProvider::QueryInterface: DeviceFilter %lu supports %s !!!\n", Index, lpstr); OutputDebugStringW(Buffer); CoTaskMemFree(lpstr); #endif @@ -198,7 +198,7 @@ CNetworkProvider::QueryInterface( WCHAR Buffer[MAX_PATH]; LPOLESTR lpstr; StringFromCLSID(refiid, &lpstr); - swprintf(Buffer, L"CNetworkProvider::QueryInterface: NoInterface for %s !!!\n", lpstr); + _swprintf(Buffer, L"CNetworkProvider::QueryInterface: NoInterface for %s !!!\n", lpstr); OutputDebugStringW(Buffer); CoTaskMemFree(lpstr); @@ -560,7 +560,7 @@ CNetworkProvider_fnConstructor( WCHAR Buffer[MAX_PATH]; LPOLESTR lpstr; StringFromCLSID(riid, &lpstr); - swprintf(Buffer, L"CNetworkProvider_fnConstructor riid %s pUnknown %p\n", lpstr, pUnknown); + _swprintf(Buffer, L"CNetworkProvider_fnConstructor riid %s pUnknown %p\n", lpstr, pUnknown); OutputDebugStringW(Buffer); #endif diff --git a/dll/directx/msdvbnp/pin.cpp b/dll/directx/msdvbnp/pin.cpp index e5a71f6ba0d..bf53f910214 100644 --- a/dll/directx/msdvbnp/pin.cpp +++ b/dll/directx/msdvbnp/pin.cpp @@ -106,7 +106,7 @@ CPin::QueryInterface( WCHAR Buffer[MAX_PATH]; LPOLESTR lpstr; StringFromCLSID(refiid, &lpstr); - swprintf(Buffer, L"CPin::QueryInterface: NoInterface for %s\n", lpstr); + _swprintf(Buffer, L"CPin::QueryInterface: NoInterface for %s\n", lpstr); OutputDebugStringW(Buffer); CoTaskMemFree(lpstr); @@ -327,7 +327,7 @@ CPin_fnConstructor( WCHAR Buffer[MAX_PATH]; LPOLESTR lpstr; StringFromCLSID(riid, &lpstr); - swprintf(Buffer, L"CPin_fnConstructor riid %s pUnknown %p\n", lpstr, pUnknown); + _swprintf(Buffer, L"CPin_fnConstructor riid %s pUnknown %p\n", lpstr, pUnknown); OutputDebugStringW(Buffer); #endif diff --git a/dll/directx/msdvbnp/scanningtuner.cpp b/dll/directx/msdvbnp/scanningtuner.cpp index ffa1ebaa135..a8a65ecdf3f 100644 --- a/dll/directx/msdvbnp/scanningtuner.cpp +++ b/dll/directx/msdvbnp/scanningtuner.cpp @@ -92,7 +92,7 @@ CScanningTunner::QueryInterface( WCHAR Buffer[MAX_PATH]; LPOLESTR lpstr; StringFromCLSID(refiid, &lpstr); - swprintf(Buffer, L"CScanningTunner::QueryInterface: NoInterface for %s\n", lpstr); + _swprintf(Buffer, L"CScanningTunner::QueryInterface: NoInterface for %s\n", lpstr); OutputDebugStringW(Buffer); CoTaskMemFree(lpstr); @@ -312,8 +312,8 @@ CScanningTunner::performDVBTTune( WCHAR Buffer[1000]; - swprintf(Buffer, L"BandWidth %lu Frequency %lu Rate %lu InnerFEC %ld OuterFEC %ld InnerFECRate %ld OuterFECRate %ld Modulation %lu\n", - BandWidth, Frequency, SymbolRate, InnerFEC, OuterFEC, InnerFECRate, OuterFECRate, Modulation); + _swprintf(Buffer, L"BandWidth %lu Frequency %lu Rate %lu InnerFEC %ld OuterFEC %ld InnerFECRate %ld OuterFECRate %ld Modulation %lu\n", + BandWidth, Frequency, SymbolRate, InnerFEC, OuterFEC, InnerFECRate, OuterFECRate, Modulation); OutputDebugStringW(Buffer); @@ -335,7 +335,7 @@ CScanningTunner::performDVBTTune( hr = pTopo->GetControlNode(0, 1, 0, &pNode); //HACK WCHAR Buffer[100]; - swprintf(Buffer, L"CScanningTunner::performDVBTTune GetControlNode %lx\n", hr); + _swprintf(Buffer, L"CScanningTunner::performDVBTTune GetControlNode %lx\n", hr); OutputDebugStringW(Buffer); if (FAILED(hr)) @@ -347,7 +347,7 @@ CScanningTunner::performDVBTTune( hr = pNode->QueryInterface(IID_IBDA_FrequencyFilter, (void**)&pFrequency); - swprintf(Buffer, L"CScanningTunner::performDVBTTune IID_IBDA_FrequencyFilter hr %lx\n", hr); + _swprintf(Buffer, L"CScanningTunner::performDVBTTune IID_IBDA_FrequencyFilter hr %lx\n", hr); OutputDebugStringW(Buffer); // sanity check @@ -355,7 +355,7 @@ CScanningTunner::performDVBTTune( hr = SetFrequency(pFrequency, 1000 /* FIXME */, Frequency, BDA_POLARISATION_NOT_DEFINED /* FIXME */, BDA_RANGE_NOT_SET /* FIXME */, BandWidth); - swprintf(Buffer, L"CScanningTunner::performDVBTTune SetFrequency hr %lx\n", hr); + _swprintf(Buffer, L"CScanningTunner::performDVBTTune SetFrequency hr %lx\n", hr); OutputDebugStringW(Buffer); //sanity check @@ -367,7 +367,7 @@ CScanningTunner::performDVBTTune( hr = pNode->QueryInterface(IID_IBDA_LNBInfo, (void**)&pLnbInfo); - swprintf(Buffer, L"CScanningTunner::performDVBTTune IID_IBDA_LNBInfo hr %lx\n", hr); + _swprintf(Buffer, L"CScanningTunner::performDVBTTune IID_IBDA_LNBInfo hr %lx\n", hr); OutputDebugStringW(Buffer); // sanity check @@ -376,7 +376,7 @@ CScanningTunner::performDVBTTune( hr = SetLnbInfo(pLnbInfo, ULONG_MAX /* FIXME */, ULONG_MAX /* FIXME*/, ULONG_MAX /*FIXME*/); - swprintf(Buffer, L"CScanningTunner::performDVBTTune SetLnbInfo hr %lx\n", hr); + _swprintf(Buffer, L"CScanningTunner::performDVBTTune SetLnbInfo hr %lx\n", hr); OutputDebugStringW(Buffer); // sanity check @@ -387,7 +387,7 @@ CScanningTunner::performDVBTTune( hr = pNode->QueryInterface(IID_IBDA_DigitalDemodulator, (void**)&pDigitalDemo); - swprintf(Buffer, L"CScanningTunner::performDVBTTune IID_IBDA_DigitalDemodulator hr %lx\n", hr); + _swprintf(Buffer, L"CScanningTunner::performDVBTTune IID_IBDA_DigitalDemodulator hr %lx\n", hr); OutputDebugStringW(Buffer); // sanity check @@ -395,7 +395,7 @@ CScanningTunner::performDVBTTune( hr = SetDigitalDemodulator(pDigitalDemo, Modulation, InnerFEC, InnerFECRate, OuterFEC, OuterFECRate, SymbolRate); - swprintf(Buffer, L"CScanningTunner::performDVBTTune SetDigitalDemodulator hr %lx\n", hr); + _swprintf(Buffer, L"CScanningTunner::performDVBTTune SetDigitalDemodulator hr %lx\n", hr); OutputDebugStringW(Buffer); // sanity check @@ -704,7 +704,7 @@ CScanningTunner_fnConstructor( WCHAR Buffer[MAX_PATH]; LPOLESTR lpstr; StringFromCLSID(riid, &lpstr); - swprintf(Buffer, L"CScanningTunner_fnConstructor riid %s\n", lpstr); + _swprintf(Buffer, L"CScanningTunner_fnConstructor riid %s\n", lpstr); OutputDebugStringW(Buffer); #endif diff --git a/dll/directx/msvidctl/enumtuningspaces.cpp b/dll/directx/msvidctl/enumtuningspaces.cpp index b40cbad8b96..1041a45afbc 100644 --- a/dll/directx/msvidctl/enumtuningspaces.cpp +++ b/dll/directx/msvidctl/enumtuningspaces.cpp @@ -66,7 +66,7 @@ CEnumTuningSpaces::QueryInterface( WCHAR Buffer[MAX_PATH]; LPOLESTR lpstr; StringFromCLSID(refiid, &lpstr); - swprintf(Buffer, L"CEnumTuningSpaces::QueryInterface: NoInterface for %s\n", lpstr); + _swprintf(Buffer, L"CEnumTuningSpaces::QueryInterface: NoInterface for %s\n", lpstr); OutputDebugStringW(Buffer); CoTaskMemFree(lpstr); @@ -123,7 +123,7 @@ CEnumTuningSpaces_fnConstructor( WCHAR Buffer[MAX_PATH]; LPOLESTR lpstr; StringFromCLSID(riid, &lpstr); - swprintf(Buffer, L"CEnumTuningSpaces_fnConstructor riid %s pUnknown %p\n", lpstr, pUnknown); + _swprintf(Buffer, L"CEnumTuningSpaces_fnConstructor riid %s pUnknown %p\n", lpstr, pUnknown); OutputDebugStringW(Buffer); #endif diff --git a/dll/directx/msvidctl/tunerequest.cpp b/dll/directx/msvidctl/tunerequest.cpp index 364c56c0609..b5dae409f0a 100644 --- a/dll/directx/msvidctl/tunerequest.cpp +++ b/dll/directx/msvidctl/tunerequest.cpp @@ -26,7 +26,7 @@ public: OutputDebugStringW(L"CTuneRequest::Release : delete\n"); WCHAR Buffer[100]; - swprintf(Buffer, L"CTuneRequest::Release : m_TuningSpace %p delete\n", m_TuningSpace); + _swprintf(Buffer, L"CTuneRequest::Release : m_TuningSpace %p delete\n", m_TuningSpace); OutputDebugStringW(Buffer); @@ -113,7 +113,7 @@ CTuneRequest::QueryInterface( WCHAR Buffer[MAX_PATH]; LPOLESTR lpstr; StringFromCLSID(refiid, &lpstr); - swprintf(Buffer, L"CTuneRequest::QueryInterface: NoInterface for %s", lpstr); + _swprintf(Buffer, L"CTuneRequest::QueryInterface: NoInterface for %s", lpstr); OutputDebugStringW(Buffer); CoTaskMemFree(lpstr); @@ -186,7 +186,7 @@ CTuneRequest::Clone(ITuneRequest **NewTuneRequest) { #ifdef MSVIDCTL_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CTuneRequest::Clone %p\n", NewTuneRequest); + _swprintf(Buffer, L"CTuneRequest::Clone %p\n", NewTuneRequest); OutputDebugStringW(Buffer); #endif @@ -238,7 +238,7 @@ CTuneRequest::put_ONID(long ONID) { #ifdef MSVIDCTL_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CTuneRequest::put_ONID : %lu\n", ONID); + _swprintf(Buffer, L"CTuneRequest::put_ONID : %lu\n", ONID); OutputDebugStringW(Buffer); #endif @@ -264,7 +264,7 @@ CTuneRequest::put_TSID(long TSID) { #ifdef MSVIDCTL_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CTuneRequest::put_TSID : %lu\n", TSID); + _swprintf(Buffer, L"CTuneRequest::put_TSID : %lu\n", TSID); OutputDebugStringW(Buffer); #endif @@ -290,7 +290,7 @@ CTuneRequest::put_SID(long SID) { #ifdef MSVIDCTL_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CTuneRequest::put_SID : %lu\n", SID); + _swprintf(Buffer, L"CTuneRequest::put_SID : %lu\n", SID); OutputDebugStringW(Buffer); #endif @@ -313,7 +313,7 @@ CTuneRequest_fnConstructor( WCHAR Buffer[MAX_PATH]; LPOLESTR lpstr; StringFromCLSID(riid, &lpstr); - swprintf(Buffer, L"CTuneRequest_fnConstructor riid %s pUnknown %p\n", lpstr, pUnknown); + _swprintf(Buffer, L"CTuneRequest_fnConstructor riid %s pUnknown %p\n", lpstr, pUnknown); OutputDebugStringW(Buffer); #endif diff --git a/dll/directx/msvidctl/tuningspace.cpp b/dll/directx/msvidctl/tuningspace.cpp index 3505356c2ab..e271aa7dd45 100644 --- a/dll/directx/msvidctl/tuningspace.cpp +++ b/dll/directx/msvidctl/tuningspace.cpp @@ -25,7 +25,7 @@ public: InterlockedDecrement(&m_Ref); WCHAR Buffer[100]; - swprintf(Buffer, L"CTuningSpace::Release : %p Ref %lu\n", this, m_Ref); + _swprintf(Buffer, L"CTuningSpace::Release : %p Ref %lu\n", this, m_Ref); OutputDebugStringW(Buffer); if (!m_Ref) @@ -106,7 +106,7 @@ CTuningSpace::QueryInterface( WCHAR Buffer[MAX_PATH]; LPOLESTR lpstr; StringFromCLSID(refiid, &lpstr); - swprintf(Buffer, L"CTuningSpace::QueryInterface: NoInterface for %s", lpstr); + _swprintf(Buffer, L"CTuningSpace::QueryInterface: NoInterface for %s", lpstr); OutputDebugStringW(Buffer); CoTaskMemFree(lpstr); @@ -215,7 +215,7 @@ CTuningSpace::get__NetworkType(GUID *NetworkTypeGuid) { #ifdef MSVIDCTL_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CTuningSpace::get__NetworkType : %p stub\n", NetworkTypeGuid); + _swprintf(Buffer, L"CTuningSpace::get__NetworkType : %p stub\n", NetworkTypeGuid); OutputDebugStringW(Buffer); #endif @@ -345,7 +345,7 @@ CTuningSpace_fnConstructor( WCHAR Buffer[MAX_PATH]; LPOLESTR lpstr; StringFromCLSID(riid, &lpstr); - swprintf(Buffer, L"CTuningSpace_fnConstructor riid %s pUnknown %p\n", lpstr, pUnknown); + _swprintf(Buffer, L"CTuningSpace_fnConstructor riid %s pUnknown %p\n", lpstr, pUnknown); OutputDebugStringW(Buffer); #endif diff --git a/dll/directx/msvidctl/tuningspace_container.cpp b/dll/directx/msvidctl/tuningspace_container.cpp index 94fcf978dde..7eae0755e91 100644 --- a/dll/directx/msvidctl/tuningspace_container.cpp +++ b/dll/directx/msvidctl/tuningspace_container.cpp @@ -86,7 +86,7 @@ CTuningSpaceContainer::QueryInterface( WCHAR Buffer[MAX_PATH]; LPOLESTR lpstr; StringFromCLSID(refiid, &lpstr); - swprintf(Buffer, L"CTuningSpaceContainer::QueryInterface: NoInterface for %s", lpstr); + _swprintf(Buffer, L"CTuningSpaceContainer::QueryInterface: NoInterface for %s", lpstr); OutputDebugStringW(Buffer); CoTaskMemFree(lpstr); @@ -254,7 +254,7 @@ CTuningSpaceContainer_fnConstructor( WCHAR Buffer[MAX_PATH]; LPOLESTR lpstr; StringFromCLSID(riid, &lpstr); - swprintf(Buffer, L"CTuningSpaceContainer_fnConstructor riid %s pUnknown %p\n", lpstr, pUnknown); + _swprintf(Buffer, L"CTuningSpaceContainer_fnConstructor riid %s pUnknown %p\n", lpstr, pUnknown); OutputDebugStringW(Buffer); #endif diff --git a/dll/shellext/netshell/connectmanager.cpp b/dll/shellext/netshell/connectmanager.cpp index fd934b09b09..790a5dd1ecd 100644 --- a/dll/shellext/netshell/connectmanager.cpp +++ b/dll/shellext/netshell/connectmanager.cpp @@ -143,7 +143,7 @@ CNetConnection::Disconnect() } SetupDiDestroyDeviceInfoList(hInfo); - swprintf(szPath, L"SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}\\%s\\Connection", pDisplayName); + _swprintf(szPath, L"SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}\\%s\\Connection", pDisplayName); CoTaskMemFree(pDisplayName); if (FAILED_UNEXPECTEDLY(hr)) @@ -174,7 +174,7 @@ CNetConnection::Disconnect() } RegCloseKey(hKey); - swprintf(szPath, L"System\\CurrentControlSet\\Hardware Profiles\\Current\\System\\CurrentControlSet\\Enum\\%s", pPnp); + _swprintf(szPath, L"System\\CurrentControlSet\\Hardware Profiles\\Current\\System\\CurrentControlSet\\Enum\\%s", pPnp); CoTaskMemFree(pPnp); if (RegCreateKeyExW(HKEY_LOCAL_MACHINE, szPath, 0, NULL, 0, KEY_WRITE, NULL, &hKey, NULL) != ERROR_SUCCESS) diff --git a/dll/shellext/netshell/lanconnectui.cpp b/dll/shellext/netshell/lanconnectui.cpp index 8213eb284a5..6f3b78a5eb5 100644 --- a/dll/shellext/netshell/lanconnectui.cpp +++ b/dll/shellext/netshell/lanconnectui.cpp @@ -314,7 +314,7 @@ CNetConnectionPropertyUi::LANPropertiesUIDlg( //NOTE: Windows write these setting with the undocumented INetLanConnection::SetInfo if (StringFromCLSID((CLSID)This->m_pProperties->guidId, &pStr) == ERROR_SUCCESS) { - swprintf(szKey, L"SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}\\%s\\Connection", pStr); + _swprintf(szKey, L"SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}\\%s\\Connection", pStr); CoTaskMemFree(pStr); if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, szKey, 0, KEY_WRITE, &hKey) == ERROR_SUCCESS) { @@ -540,7 +540,7 @@ CNetConnectionPropertyUi::Disconnect( DWORD dwFlags) { WCHAR szBuffer[100]; - swprintf(szBuffer, L"INetConnectionConnectUi_fnDisconnect flags %x\n", dwFlags); + _swprintf(szBuffer, L"INetConnectionConnectUi_fnDisconnect flags %x\n", dwFlags); MessageBoxW(NULL, szBuffer, NULL, MB_OK); return S_OK; diff --git a/dll/shellext/netshell/lanstatusui.cpp b/dll/shellext/netshell/lanstatusui.cpp index a88d4f84ebc..f2a84a950d1 100644 --- a/dll/shellext/netshell/lanstatusui.cpp +++ b/dll/shellext/netshell/lanstatusui.cpp @@ -41,7 +41,7 @@ UpdateLanStatusUiDlg( { if (LoadStringW(netshell_hInstance, IDS_FORMAT_BIT, szFormat, sizeof(szFormat)/sizeof(WCHAR))) { - swprintf(szBuffer, szFormat, IfEntry->dwSpeed); + _swprintf(szBuffer, szFormat, IfEntry->dwSpeed); SendDlgItemMessageW(hwndDlg, IDC_SPEED, WM_SETTEXT, 0, (LPARAM)szBuffer); } } @@ -49,7 +49,7 @@ UpdateLanStatusUiDlg( { if (LoadStringW(netshell_hInstance, IDS_FORMAT_KBIT, szFormat, sizeof(szFormat)/sizeof(WCHAR))) { - swprintf(szBuffer, szFormat, IfEntry->dwSpeed/1000); + _swprintf(szBuffer, szFormat, IfEntry->dwSpeed/1000); SendDlgItemMessageW(hwndDlg, IDC_SPEED, WM_SETTEXT, 0, (LPARAM)szBuffer); } } @@ -57,7 +57,7 @@ UpdateLanStatusUiDlg( { if (LoadStringW(netshell_hInstance, IDS_FORMAT_MBIT, szFormat, sizeof(szFormat)/sizeof(WCHAR))) { - swprintf(szBuffer, szFormat, IfEntry->dwSpeed/1000000); + _swprintf(szBuffer, szFormat, IfEntry->dwSpeed/1000000); SendDlgItemMessageW(hwndDlg, IDC_SPEED, WM_SETTEXT, 0, (LPARAM)szBuffer); } } @@ -65,7 +65,7 @@ UpdateLanStatusUiDlg( { if (LoadStringW(netshell_hInstance, IDS_FORMAT_GBIT, szFormat, sizeof(szFormat)/sizeof(WCHAR))) { - swprintf(szBuffer, szFormat, IfEntry->dwSpeed/1000000000); + _swprintf(szBuffer, szFormat, IfEntry->dwSpeed/1000000000); SendDlgItemMessageW(hwndDlg, IDC_SPEED, WM_SETTEXT, 0, (LPARAM)szBuffer); } } @@ -111,7 +111,7 @@ UpdateLanStatusUiDlg( if (!LoadStringW(netshell_hInstance, IDS_DURATION_DAYS, DayBuffer, sizeof(DayBuffer) / sizeof(DayBuffer[0]))) DayBuffer[0] = L'\0'; } - swprintf(Buffer, DayBuffer, TimeConnected.wDay, LocBuffer); + _swprintf(Buffer, DayBuffer, TimeConnected.wDay, LocBuffer); SendDlgItemMessageW(hwndDlg, IDC_DURATION, WM_SETTEXT, 0, (LPARAM)Buffer); } @@ -469,8 +469,8 @@ LANStatusUiDetailsDlg( li.iItem = InsertItemToListView(hDlgCtrl, IDS_PHYSICAL_ADDRESS); if (li.iItem >= 0) { - swprintf(szBuffer, L"%02x-%02x-%02x-%02x-%02x-%02x",pCurAdapter->Address[0], pCurAdapter->Address[1], - pCurAdapter->Address[2], pCurAdapter->Address[3], pCurAdapter->Address[4], pCurAdapter->Address[5]); + _swprintf(szBuffer, L"%02x-%02x-%02x-%02x-%02x-%02x",pCurAdapter->Address[0], pCurAdapter->Address[1], + pCurAdapter->Address[2], pCurAdapter->Address[3], pCurAdapter->Address[4], pCurAdapter->Address[5]); SendMessageW(hDlgCtrl, LVM_SETITEMW, 0, (LPARAM)&li); } li.iItem = InsertItemToListView(hDlgCtrl, IDS_IP_ADDRESS); @@ -590,20 +590,20 @@ LANStatusUiAdvancedDlg( dwIpAddr = ntohl(pContext->IpAddress); - swprintf(szBuffer, L"%u.%u.%u.%u", FIRST_IPADDRESS(dwIpAddr), SECOND_IPADDRESS(dwIpAddr), - THIRD_IPADDRESS(dwIpAddr), FOURTH_IPADDRESS(dwIpAddr)); + _swprintf(szBuffer, L"%u.%u.%u.%u", FIRST_IPADDRESS(dwIpAddr), SECOND_IPADDRESS(dwIpAddr), + THIRD_IPADDRESS(dwIpAddr), FOURTH_IPADDRESS(dwIpAddr)); SendDlgItemMessageW(hwndDlg, IDC_DETAILSIP, WM_SETTEXT, 0, (LPARAM)szBuffer); dwIpAddr = ntohl(pContext->SubnetMask); - swprintf(szBuffer, L"%u.%u.%u.%u", FIRST_IPADDRESS(dwIpAddr), SECOND_IPADDRESS(dwIpAddr), - THIRD_IPADDRESS(dwIpAddr), FOURTH_IPADDRESS(dwIpAddr)); + _swprintf(szBuffer, L"%u.%u.%u.%u", FIRST_IPADDRESS(dwIpAddr), SECOND_IPADDRESS(dwIpAddr), + THIRD_IPADDRESS(dwIpAddr), FOURTH_IPADDRESS(dwIpAddr)); SendDlgItemMessageW(hwndDlg, IDC_DETAILSSUBNET, WM_SETTEXT, 0, (LPARAM)szBuffer); dwIpAddr = ntohl(pContext->Gateway); if (dwIpAddr) { - swprintf(szBuffer, L"%u.%u.%u.%u", FIRST_IPADDRESS(dwIpAddr), SECOND_IPADDRESS(dwIpAddr), - THIRD_IPADDRESS(dwIpAddr), FOURTH_IPADDRESS(dwIpAddr)); + _swprintf(szBuffer, L"%u.%u.%u.%u", FIRST_IPADDRESS(dwIpAddr), SECOND_IPADDRESS(dwIpAddr), + THIRD_IPADDRESS(dwIpAddr), FOURTH_IPADDRESS(dwIpAddr)); SendDlgItemMessageW(hwndDlg, IDC_DETAILSGATEWAY, WM_SETTEXT, 0, (LPARAM)szBuffer); } return TRUE; diff --git a/dll/shellext/stobject/hotplug.cpp b/dll/shellext/stobject/hotplug.cpp index b33f35b3adb..81cf224ffe1 100644 --- a/dll/shellext/stobject/hotplug.cpp +++ b/dll/shellext/stobject/hotplug.cpp @@ -194,7 +194,7 @@ static void _ShowContextMenu(CSysTray * pSysTray) if (cr != CR_SUCCESS) { WCHAR strInfo[128]; - swprintf(strInfo, L"Problem Ejecting %wS", g_strMenuSel); + _swprintf(strInfo, L"Problem Ejecting %wS", g_strMenuSel); MessageBox(0, L"The device cannot be stopped right now! Try stopping it again later!", strInfo, MB_OK | MB_ICONEXCLAMATION); } else @@ -342,7 +342,7 @@ HRESULT STDMETHODCALLTYPE Hotplug_Message(_In_ CSysTray * pSysTray, UINT uMsg, W break; case DBT_DEVICEREMOVECOMPLETE: WCHAR strInfo[128]; - swprintf(strInfo, L"The %wS can now be safely removed from the system.", g_strMenuSel); + _swprintf(strInfo, L"The %wS can now be safely removed from the system.", g_strMenuSel); NotifyBalloon(pSysTray, L"Safe to Remove Hardware", strInfo); lResult = true; diff --git a/dll/win32/advapi32/misc/hwprofiles.c b/dll/win32/advapi32/misc/hwprofiles.c index ff4b54580fd..aef49754036 100644 --- a/dll/win32/advapi32/misc/hwprofiles.c +++ b/dll/win32/advapi32/misc/hwprofiles.c @@ -121,9 +121,9 @@ GetCurrentHwProfileW(LPHW_PROFILE_INFOW lpHwProfileInfo) return FALSE; } - swprintf(szKeyName, - L"Hardware Profile\\%04lu", - dwConfigId); + _swprintf(szKeyName, + L"Hardware Profile\\%04lu", + dwConfigId); if (RegOpenKeyExW(hDbKey, szKeyName, @@ -158,15 +158,14 @@ GetCurrentHwProfileW(LPHW_PROFILE_INFOW lpHwProfileInfo) { /* Create a new GUID */ UuidCreate(&uuid); - swprintf( - lpHwProfileInfo->szHwProfileGuid, - L"{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", - uuid.Data1, - uuid.Data2, - uuid.Data3, - uuid.Data4[0], uuid.Data4[1], - uuid.Data4[2], uuid.Data4[3], uuid.Data4[4], uuid.Data4[5], - uuid.Data4[6], uuid.Data4[7]); + _swprintf(lpHwProfileInfo->szHwProfileGuid, + L"{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", + uuid.Data1, + uuid.Data2, + uuid.Data3, + uuid.Data4[0], uuid.Data4[1], + uuid.Data4[2], uuid.Data4[3], uuid.Data4[4], uuid.Data4[5], + uuid.Data4[6], uuid.Data4[7]); dwLength = (wcslen(lpHwProfileInfo->szHwProfileGuid) + 1) * sizeof(WCHAR); RegSetValueExW(hProfileKey, diff --git a/dll/win32/advapi32/service/sctrl.c b/dll/win32/advapi32/service/sctrl.c index ad5f94969f5..ed76f5f8b68 100644 --- a/dll/win32/advapi32/service/sctrl.c +++ b/dll/win32/advapi32/service/sctrl.c @@ -264,7 +264,7 @@ ScConnectControlPipe(HANDLE *hPipe) dwServiceCurrent = 0; } - swprintf(NtControlPipeName, L"\\\\.\\pipe\\net\\NtControlPipe%u", dwServiceCurrent); + _swprintf(NtControlPipeName, L"\\\\.\\pipe\\net\\NtControlPipe%u", dwServiceCurrent); TRACE("PipeName: %S\n", NtControlPipeName); if (!WaitNamedPipeW(NtControlPipeName, 30000)) diff --git a/dll/win32/avicap32/avicap32.c b/dll/win32/avicap32/avicap32.c index 12912ca2e0d..f1fd5638778 100644 --- a/dll/win32/avicap32/avicap32.c +++ b/dll/win32/avicap32/avicap32.c @@ -226,11 +226,11 @@ capGetDriverDescriptionW(WORD wDriverIndex, if (VerQueryValueW(Version, L"\\", &Ms, &Ls)) { memmove(&FileInfo, Ms, Ls); - swprintf(szVersion, L"Version: %d.%d.%d.%d", - HIWORD(FileInfo.dwFileVersionMS), - LOWORD(FileInfo.dwFileVersionMS), - HIWORD(FileInfo.dwFileVersionLS), - LOWORD(FileInfo.dwFileVersionLS)); + _swprintf(szVersion, L"Version: %d.%d.%d.%d", + HIWORD(FileInfo.dwFileVersionMS), + LOWORD(FileInfo.dwFileVersionMS), + HIWORD(FileInfo.dwFileVersionLS), + LOWORD(FileInfo.dwFileVersionLS)); lstrcpynW(lpszVer, szVersion, cbVer); } diff --git a/dll/win32/devmgr/properties/advprop.cpp b/dll/win32/devmgr/properties/advprop.cpp index 1c776069465..55086e57900 100644 --- a/dll/win32/devmgr/properties/advprop.cpp +++ b/dll/win32/devmgr/properties/advprop.cpp @@ -226,8 +226,8 @@ UpdateDriverVersionInfoDetails(IN HWND hwndDlg, goto done; dwLangId = *(LPDWORD)lpInfo; - swprintf(szLangInfo, L"\\StringFileInfo\\%04x%04x\\", - LOWORD(dwLangId), HIWORD(dwLangId)); + _swprintf(szLangInfo, L"\\StringFileInfo\\%04x%04x\\", + LOWORD(dwLangId), HIWORD(dwLangId)); /* read CompanyName */ wcscpy(szLangPath, szLangInfo); @@ -900,7 +900,7 @@ DisplayDevicePropertyText(IN PDEVADVPROP_INFO dap, { if (GetLastError() != ERROR_FILE_NOT_FOUND) { - swprintf(dap->szTemp, L"Error: Getting the size failed! (Error: %ld)", GetLastError()); + _swprintf(dap->szTemp, L"Error: Getting the size failed! (Error: %ld)", GetLastError()); SetListViewText(hwndListView, 0, dap->szTemp); } return; @@ -952,7 +952,7 @@ DisplayDevicePropertyText(IN PDEVADVPROP_INFO dap, { case SPDRP_CAPABILITIES: index = 0; - swprintf(dap->szTemp, L"%08lx", dwValue); + _swprintf(dap->szTemp, L"%08lx", dwValue); SetListViewText(hwndListView, index++, dap->szTemp); if (dwValue & CM_DEVCAP_LOCKSUPPORTED) SetListViewText(hwndListView, index++, L"CM_DEVCAP_LOCKSUPPORTED"); @@ -978,7 +978,7 @@ DisplayDevicePropertyText(IN PDEVADVPROP_INFO dap, case SPDRP_CONFIGFLAGS: index = 0; - swprintf(dap->szTemp, L"%08lx", dwValue); + _swprintf(dap->szTemp, L"%08lx", dwValue); SetListViewText(hwndListView, index++, dap->szTemp); if (dwValue & CONFIGFLAG_DISABLED) SetListViewText(hwndListView, index++, L"CONFIGFLAG_DISABLED"); @@ -1003,7 +1003,7 @@ DisplayDevicePropertyText(IN PDEVADVPROP_INFO dap, break; default: - swprintf(dap->szTemp, L"0x%08lx", dwValue); + _swprintf(dap->szTemp, L"0x%08lx", dwValue); SetListViewText(hwndListView, 0, dap->szTemp); break; } @@ -1039,7 +1039,7 @@ DisplayDevNodeFlags(IN PDEVADVPROP_INFO dap, dap->hMachine); index = 0; - swprintf(dap->szTemp, L"%08lx", dwStatus); + _swprintf(dap->szTemp, L"%08lx", dwStatus); SetListViewText(hwndListView, index++, dap->szTemp); if (dwStatus & DN_ROOT_ENUMERATED) SetListViewText(hwndListView, index++, L"DN_ROOT_ENUMERATED"); @@ -1155,7 +1155,7 @@ DisplayCsFlags(IN PDEVADVPROP_INFO dap, dap->hMachine); index = 0; - swprintf(dap->szTemp, L"%08lx", dwValue); + _swprintf(dap->szTemp, L"%08lx", dwValue); SetListViewText(hwndListView, index++, dap->szTemp); if (dwValue & CSCONFIGFLAG_DISABLED) @@ -1689,7 +1689,7 @@ DisplayPowerStateMappings( PowerState = PowerData.PD_PowerStateMapping[i]; if ((PowerState >= PowerDeviceUnspecified) && (PowerState <= PowerDeviceD3)) { - swprintf(szSystemStateBuffer, L"S%u", i - 1); + _swprintf(szSystemStateBuffer, L"S%u", i - 1); switch (PowerState) { @@ -1717,7 +1717,7 @@ DisplayPowerStateMappings( break; } - swprintf(szOutBuffer, L"%s -> %s", szSystemStateBuffer, szDeviceStateBuffer); + _swprintf(szOutBuffer, L"%s -> %s", szSystemStateBuffer, szDeviceStateBuffer); SetListViewText(hwndListView, i, szOutBuffer); } } diff --git a/dll/win32/kernel32/client/dllmain.c b/dll/win32/kernel32/client/dllmain.c index fe173bb10d8..5a506fa4c1e 100644 --- a/dll/win32/kernel32/client/dllmain.c +++ b/dll/win32/kernel32/client/dllmain.c @@ -128,11 +128,11 @@ DllMain(HANDLE hDll, else { /* Use the session path */ - swprintf(SessionDir, - L"%ws\\%ld%ws", - SESSION_DIR, - SessionId, - WIN_OBJ_DIR); + _swprintf(SessionDir, + L"%ws\\%ld%ws", + SESSION_DIR, + SessionId, + WIN_OBJ_DIR); } /* Connect to the Base Server */ diff --git a/dll/win32/kernel32/client/file/npipe.c b/dll/win32/kernel32/client/file/npipe.c index 4af4965627a..d7d7939d3b7 100644 --- a/dll/win32/kernel32/client/file/npipe.c +++ b/dll/win32/kernel32/client/file/npipe.c @@ -141,10 +141,10 @@ CreatePipe(PHANDLE hReadPipe, PipeId = InterlockedIncrement(&ProcessPipeId); /* Create the pipe name */ - swprintf(Buffer, - L"\\Device\\NamedPipe\\Win32Pipes.%p.%08x", - NtCurrentTeb()->ClientId.UniqueProcess, - PipeId); + _swprintf(Buffer, + L"\\Device\\NamedPipe\\Win32Pipes.%p.%08x", + NtCurrentTeb()->ClientId.UniqueProcess, + PipeId); RtlInitUnicodeString(&PipeName, Buffer); /* Always use case insensitive */ diff --git a/dll/win32/msafd/misc/dllmain.c b/dll/win32/msafd/misc/dllmain.c index 504e691d1dd..0e4dd446674 100644 --- a/dll/win32/msafd/misc/dllmain.c +++ b/dll/win32/msafd/misc/dllmain.c @@ -3403,13 +3403,13 @@ WSPAddressToString(IN LPSOCKADDR lpsaAddress, if (lpErrno) *lpErrno = WSAEINVAL; return SOCKET_ERROR; } - swprintf(buffer, - L"%u.%u.%u.%u:%u", - (unsigned int)(ntohl(((SOCKADDR_IN *)lpsaAddress)->sin_addr.s_addr) >> 24 & 0xff), - (unsigned int)(ntohl(((SOCKADDR_IN *)lpsaAddress)->sin_addr.s_addr) >> 16 & 0xff), - (unsigned int)(ntohl(((SOCKADDR_IN *)lpsaAddress)->sin_addr.s_addr) >> 8 & 0xff), - (unsigned int)(ntohl(((SOCKADDR_IN *)lpsaAddress)->sin_addr.s_addr) & 0xff), - ntohs(((SOCKADDR_IN *)lpsaAddress)->sin_port)); + _swprintf(buffer, + L"%u.%u.%u.%u:%u", + (unsigned int)(ntohl(((SOCKADDR_IN *)lpsaAddress)->sin_addr.s_addr) >> 24 & 0xff), + (unsigned int)(ntohl(((SOCKADDR_IN *)lpsaAddress)->sin_addr.s_addr) >> 16 & 0xff), + (unsigned int)(ntohl(((SOCKADDR_IN *)lpsaAddress)->sin_addr.s_addr) >> 8 & 0xff), + (unsigned int)(ntohl(((SOCKADDR_IN *)lpsaAddress)->sin_addr.s_addr) & 0xff), + ntohs(((SOCKADDR_IN *)lpsaAddress)->sin_port)); p = wcschr(buffer, L':'); if (!((SOCKADDR_IN *)lpsaAddress)->sin_port) diff --git a/dll/win32/msports/classinst.c b/dll/win32/msports/classinst.c index 5a6a00462d6..52aecfcd3ec 100644 --- a/dll/win32/msports/classinst.c +++ b/dll/win32/msports/classinst.c @@ -346,7 +346,7 @@ InstallSerialPort(IN HDEVINFO DeviceInfoSet, } /* Build the name of the port device */ - swprintf(szPortName, L"%s%u", pszCom, dwPortNumber); + _swprintf(szPortName, L"%s%u", pszCom, dwPortNumber); /* Close the com port database */ if (hComDB != HCOMDB_INVALID_HANDLE_VALUE) @@ -389,17 +389,17 @@ InstallSerialPort(IN HDEVINFO DeviceInfoSet, NULL)) { /* ... and use it to build a new friendly name */ - swprintf(szFriendlyName, - L"%s (%s)", - szDeviceDescription, - szPortName); + _swprintf(szFriendlyName, + L"%s (%s)", + szDeviceDescription, + szPortName); } else { /* ... or build a generic friendly name */ - swprintf(szFriendlyName, - L"Serial Port (%s)", - szPortName); + _swprintf(szFriendlyName, + L"Serial Port (%s)", + szPortName); } /* Set the friendly name for the device */ @@ -474,7 +474,7 @@ InstallParallelPort(IN HDEVINFO DeviceInfoSet, if (dwPortNumber != 0) { - swprintf(szPortName, L"%s%u", pszLpt, dwPortNumber); + _swprintf(szPortName, L"%s%u", pszLpt, dwPortNumber); } else { @@ -538,17 +538,17 @@ InstallParallelPort(IN HDEVINFO DeviceInfoSet, NULL)) { /* ... and use it to build a new friendly name */ - swprintf(szFriendlyName, - L"%s (%s)", - szDeviceDescription, - szPortName); + _swprintf(szFriendlyName, + L"%s (%s)", + szDeviceDescription, + szPortName); } else { /* ... or build a generic friendly name */ - swprintf(szFriendlyName, - L"Parallel Port (%s)", - szPortName); + _swprintf(szFriendlyName, + L"Parallel Port (%s)", + szPortName); } TRACE("Friendly name: %S\n", szFriendlyName); diff --git a/dll/win32/msports/parallel.c b/dll/win32/msports/parallel.c index abf2d7fa6ee..0f3249f4944 100644 --- a/dll/win32/msports/parallel.c +++ b/dll/win32/msports/parallel.c @@ -176,7 +176,7 @@ ChangePortNumber( return ERROR_SUCCESS; /* Build the new port name */ - swprintf(szNewPortName, L"LPT%lu", dwNewPortNumber); + _swprintf(szNewPortName, L"LPT%lu", dwNewPortNumber); /* Open the devices hardware key */ hDeviceKey = SetupDiOpenDevRegKey(pPortData->DeviceInfoSet, @@ -214,17 +214,17 @@ ChangePortNumber( NULL)) { /* ... and use it to build a new friendly name */ - swprintf(szFriendlyName, - L"%s (%s)", - szDeviceDescription, - szNewPortName); + _swprintf(szFriendlyName, + L"%s (%s)", + szDeviceDescription, + szNewPortName); } else { /* ... or build a generic friendly name */ - swprintf(szFriendlyName, - L"Parallel Port (%s)", - szNewPortName); + _swprintf(szFriendlyName, + L"Parallel Port (%s)", + szNewPortName); } /* Set the friendly name for the device */ @@ -424,7 +424,7 @@ OnInitDialog(HWND hwnd, for (i = 1; i < 4; i++) { - swprintf(szBuffer, L"LPT%lu", i); + _swprintf(szBuffer, L"LPT%lu", i); if ((dwPortMap & (1 << i)) && (pPortData->dwPortNumber != i)) wcscat(szBuffer, szPortInUse); diff --git a/dll/win32/msports/serial.c b/dll/win32/msports/serial.c index 0ce500389b8..a6fb2729ffc 100644 --- a/dll/win32/msports/serial.c +++ b/dll/win32/msports/serial.c @@ -284,12 +284,12 @@ WritePortSettings( nFlowControlIndex = ComboBox_GetCurSel(hwndControl); } - swprintf(szPortData, - L"%lu,%s,%s,%s", - BaudRates[nBaudRateIndex], - Paritys[nParityIndex], - DataBits[nDataBitsIndex], - StopBits[nStopBitsIndex]); + _swprintf(szPortData, + L"%lu,%s,%s,%s", + BaudRates[nBaudRateIndex], + Paritys[nParityIndex], + DataBits[nDataBitsIndex], + StopBits[nStopBitsIndex]); if (nFlowControlIndex < 2) { wcscat(szPortData, L","); diff --git a/dll/win32/netcfgx/netcfg_iface.c b/dll/win32/netcfgx/netcfg_iface.c index 3d0ce2273b3..a9222d48321 100644 --- a/dll/win32/netcfgx/netcfg_iface.c +++ b/dll/win32/netcfgx/netcfg_iface.c @@ -414,7 +414,7 @@ EnumerateNetworkComponent( hr = StringFromCLSID(pGuid, &pszGuid); if (SUCCEEDED(hr)) { - swprintf(szName, L"SYSTEM\\CurrentControlSet\\Control\\Network\\%s", pszGuid); + _swprintf(szName, L"SYSTEM\\CurrentControlSet\\Control\\Network\\%s", pszGuid); if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, szName, 0, KEY_READ, &hKey) == ERROR_SUCCESS) { hr = EnumClientServiceProtocol(hKey, pGuid, pHead); @@ -711,7 +711,7 @@ ApplyOrCancelChanges( { if (StringFromCLSID(&pHead->InstanceId, &pszGuid) == NOERROR) { - swprintf(szName, L"SYSTEM\\CurrentControlSet\\Control\\Network\\%s", pszGuid); + _swprintf(szName, L"SYSTEM\\CurrentControlSet\\Control\\Network\\%s", pszGuid); CoTaskMemFree(pszGuid); if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, szName, 0, KEY_READ, &hKey) == ERROR_SUCCESS) diff --git a/dll/win32/netcfgx/tcpipconf_notify.c b/dll/win32/netcfgx/tcpipconf_notify.c index 8311b2d5f99..d42094c5173 100644 --- a/dll/win32/netcfgx/tcpipconf_notify.c +++ b/dll/win32/netcfgx/tcpipconf_notify.c @@ -988,8 +988,8 @@ InsertIpAddressToListView( li.iItem = itemCount; li.iSubItem = 0; dwIpAddr = pAddr->IpAddress; - swprintf(szBuffer, L"%lu.%lu.%lu.%lu", - FIRST_IPADDRESS(dwIpAddr), SECOND_IPADDRESS(dwIpAddr), THIRD_IPADDRESS(dwIpAddr), FOURTH_IPADDRESS(dwIpAddr)); + _swprintf(szBuffer, L"%lu.%lu.%lu.%lu", + FIRST_IPADDRESS(dwIpAddr), SECOND_IPADDRESS(dwIpAddr), THIRD_IPADDRESS(dwIpAddr), FOURTH_IPADDRESS(dwIpAddr)); li.pszText = szBuffer; li.iItem = SendMessageW(hDlgCtrl, LVM_INSERTITEMW, 0, (LPARAM)&li); @@ -998,13 +998,13 @@ InsertIpAddressToListView( if (bSubMask) { dwIpAddr = pAddr->u.SubnetMask; - swprintf(szBuffer, L"%lu.%lu.%lu.%lu", - FIRST_IPADDRESS(dwIpAddr), SECOND_IPADDRESS(dwIpAddr), THIRD_IPADDRESS(dwIpAddr), FOURTH_IPADDRESS(dwIpAddr)); + _swprintf(szBuffer, L"%lu.%lu.%lu.%lu", + FIRST_IPADDRESS(dwIpAddr), SECOND_IPADDRESS(dwIpAddr), THIRD_IPADDRESS(dwIpAddr), FOURTH_IPADDRESS(dwIpAddr)); } else { if (pAddr->u.Metric) - swprintf(szBuffer, L"%u", pAddr->u.Metric); + _swprintf(szBuffer, L"%u", pAddr->u.Metric); else LoadStringW(netcfgx_hInstance, IDS_AUTOMATIC, szBuffer, sizeof(szBuffer)/sizeof(WCHAR)); } @@ -1791,7 +1791,7 @@ TcpipAdvancedIpDlg( { if (Gw.Metric) { - swprintf(szBuffer, L"%u", Gw.Metric); + _swprintf(szBuffer, L"%u", Gw.Metric); li.iSubItem = 1; li.pszText = szBuffer; SendDlgItemMessageW(hwndDlg, IDC_GWLIST, LVM_SETITEMW, 0, (LPARAM)&li); @@ -1833,7 +1833,7 @@ TcpipAdvancedIpDlg( (void)SendDlgItemMessageW(hwndDlg, IDC_GWLIST, LVM_SETITEMW, 0, (LPARAM)&li); if (Gw.Metric) { - swprintf(szBuffer, L"%u", Gw.Metric); + _swprintf(szBuffer, L"%u", Gw.Metric); li.iSubItem = 1; li.pszText = szBuffer; SendDlgItemMessageW(hwndDlg, IDC_GWLIST, LVM_SETITEMW, 0, (LPARAM)&li); @@ -1959,8 +1959,8 @@ InitializeTcpipAdvancedDNSDlg( while(pAddr) { dwIpAddr = pAddr->IpAddress; - swprintf(szBuffer, L"%lu.%lu.%lu.%lu", - FIRST_IPADDRESS(dwIpAddr), SECOND_IPADDRESS(dwIpAddr), THIRD_IPADDRESS(dwIpAddr), FOURTH_IPADDRESS(dwIpAddr)); + _swprintf(szBuffer, L"%lu.%lu.%lu.%lu", + FIRST_IPADDRESS(dwIpAddr), SECOND_IPADDRESS(dwIpAddr), THIRD_IPADDRESS(dwIpAddr), FOURTH_IPADDRESS(dwIpAddr)); SendDlgItemMessageW(hwndDlg, IDC_DNSADDRLIST, LB_ADDSTRING, 0, (LPARAM)szBuffer); pAddr = pAddr->Next; @@ -2228,7 +2228,7 @@ TcpipAdvancedDnsDlg( if (LoadStringW(netcfgx_hInstance, IDS_DNS_SUFFIX, szFormat, sizeof(szFormat)/sizeof(WCHAR))) { szFormat[(sizeof(szFormat)/sizeof(WCHAR))-1] = L'\0'; - swprintf(szBuffer, szFormat, szSuffix); + _swprintf(szBuffer, szFormat, szSuffix); if (LoadStringW(netcfgx_hInstance, IDS_TCPIP, szFormat, sizeof(szFormat)/sizeof(WCHAR))) szFormat[(sizeof(szFormat)/sizeof(WCHAR))-1] = L'\0'; else @@ -4003,17 +4003,17 @@ CreateMultiSzString(IP_ADDR * pAddr, COPY_TYPE Type, LPDWORD Size, BOOL bComma) if (Type == IPADDR) { dwIpAddr = pTemp->IpAddress; - swprintf(szBuffer, L"%lu.%lu.%lu.%lu", - FIRST_IPADDRESS(dwIpAddr), SECOND_IPADDRESS(dwIpAddr), THIRD_IPADDRESS(dwIpAddr), FOURTH_IPADDRESS(dwIpAddr)); + _swprintf(szBuffer, L"%lu.%lu.%lu.%lu", + FIRST_IPADDRESS(dwIpAddr), SECOND_IPADDRESS(dwIpAddr), THIRD_IPADDRESS(dwIpAddr), FOURTH_IPADDRESS(dwIpAddr)); }else if (Type == SUBMASK) { dwIpAddr = pTemp->u.SubnetMask; - swprintf(szBuffer, L"%lu.%lu.%lu.%lu", - FIRST_IPADDRESS(dwIpAddr), SECOND_IPADDRESS(dwIpAddr), THIRD_IPADDRESS(dwIpAddr), FOURTH_IPADDRESS(dwIpAddr)); + _swprintf(szBuffer, L"%lu.%lu.%lu.%lu", + FIRST_IPADDRESS(dwIpAddr), SECOND_IPADDRESS(dwIpAddr), THIRD_IPADDRESS(dwIpAddr), FOURTH_IPADDRESS(dwIpAddr)); } else if (Type == METRIC) { - swprintf(szBuffer, L"%u", pTemp->u.Metric); + _swprintf(szBuffer, L"%u", pTemp->u.Metric); } dwSize += wcslen(szBuffer) + 1; @@ -4033,17 +4033,17 @@ CreateMultiSzString(IP_ADDR * pAddr, COPY_TYPE Type, LPDWORD Size, BOOL bComma) if (Type == IPADDR) { dwIpAddr = pTemp->IpAddress; - swprintf(pStr, L"%lu.%lu.%lu.%lu", - FIRST_IPADDRESS(dwIpAddr), SECOND_IPADDRESS(dwIpAddr), THIRD_IPADDRESS(dwIpAddr), FOURTH_IPADDRESS(dwIpAddr)); + _swprintf(pStr, L"%lu.%lu.%lu.%lu", + FIRST_IPADDRESS(dwIpAddr), SECOND_IPADDRESS(dwIpAddr), THIRD_IPADDRESS(dwIpAddr), FOURTH_IPADDRESS(dwIpAddr)); }else if (Type == SUBMASK) { dwIpAddr = pTemp->u.SubnetMask; - swprintf(pStr, L"%lu.%lu.%lu.%lu", - FIRST_IPADDRESS(dwIpAddr), SECOND_IPADDRESS(dwIpAddr), THIRD_IPADDRESS(dwIpAddr), FOURTH_IPADDRESS(dwIpAddr)); + _swprintf(pStr, L"%lu.%lu.%lu.%lu", + FIRST_IPADDRESS(dwIpAddr), SECOND_IPADDRESS(dwIpAddr), THIRD_IPADDRESS(dwIpAddr), FOURTH_IPADDRESS(dwIpAddr)); } else if (Type == METRIC) { - swprintf(pStr, L"%u", pTemp->u.Metric); + _swprintf(pStr, L"%u", pTemp->u.Metric); } if (bComma) diff --git a/dll/win32/newdev/newdev.c b/dll/win32/newdev/newdev.c index 1635bc663fb..a2c6403b0c0 100644 --- a/dll/win32/newdev/newdev.c +++ b/dll/win32/newdev/newdev.c @@ -521,7 +521,7 @@ PrepareFoldersToScan( nType = GetDriveTypeW(drive); if (nType == DRIVE_REMOVABLE || nType == DRIVE_CDROM) { - Buffer += 1 + swprintf(Buffer, drive); + Buffer += 1 + _swprintf(Buffer, drive); } } } diff --git a/dll/win32/samsrv/alias.c b/dll/win32/samsrv/alias.c index e731a932538..dd7c3a2c599 100644 --- a/dll/win32/samsrv/alias.c +++ b/dll/win32/samsrv/alias.c @@ -22,7 +22,7 @@ SampOpenAliasObject(IN PSAM_DB_OBJECT DomainObject, DomainObject, AliasId, DesiredAccess, AliasObject); /* Convert the RID into a string (hex) */ - swprintf(szRid, L"%08lX", AliasId); + _swprintf(szRid, L"%08lX", AliasId); /* Create the user object */ return SampOpenDbObject(DomainObject, diff --git a/dll/win32/samsrv/group.c b/dll/win32/samsrv/group.c index 1fdcd58026e..a1bf43d0af0 100644 --- a/dll/win32/samsrv/group.c +++ b/dll/win32/samsrv/group.c @@ -22,7 +22,7 @@ SampOpenGroupObject(IN PSAM_DB_OBJECT DomainObject, DomainObject, GroupId, DesiredAccess, GroupObject); /* Convert the RID into a string (hex) */ - swprintf(szRid, L"%08lX", GroupId); + _swprintf(szRid, L"%08lX", GroupId); /* Create the user object */ return SampOpenDbObject(DomainObject, diff --git a/dll/win32/samsrv/samrpc.c b/dll/win32/samsrv/samrpc.c index 68b22684b6f..65a72b0c722 100644 --- a/dll/win32/samsrv/samrpc.c +++ b/dll/win32/samsrv/samrpc.c @@ -1988,7 +1988,7 @@ SamrCreateGroupInDomain(IN SAMPR_HANDLE DomainHandle, TRACE("RID: %lx\n", ulRid); /* Convert the RID into a string (hex) */ - swprintf(szRid, L"%08lX", ulRid); + _swprintf(szRid, L"%08lX", ulRid); /* Create the group object */ Status = SampCreateDbObject(DomainObject, @@ -2411,7 +2411,7 @@ SamrCreateUserInDomain(IN SAMPR_HANDLE DomainHandle, } /* Convert the RID into a string (hex) */ - swprintf(szRid, L"%08lX", ulRid); + _swprintf(szRid, L"%08lX", ulRid); /* Create the user object */ Status = SampCreateDbObject(DomainObject, @@ -3002,7 +3002,7 @@ SamrCreateAliasInDomain(IN SAMPR_HANDLE DomainHandle, TRACE("RID: %lx\n", ulRid); /* Convert the RID into a string (hex) */ - swprintf(szRid, L"%08lX", ulRid); + _swprintf(szRid, L"%08lX", ulRid); /* Create the alias object */ Status = SampCreateDbObject(DomainObject, @@ -3754,7 +3754,7 @@ SamrLookupIdsInDomain(IN SAMPR_HANDLE DomainHandle, { TRACE("RID: %lu\n", RelativeIds[i]); - swprintf(RidString, L"%08lx", RelativeIds[i]); + _swprintf(RidString, L"%08lx", RelativeIds[i]); /* Lookup aliases */ Status = SampRegOpenKey(DomainObject->KeyHandle, @@ -4007,7 +4007,7 @@ SamrOpenGroup(IN SAMPR_HANDLE DomainHandle, } /* Convert the RID into a string (hex) */ - swprintf(szRid, L"%08lX", GroupId); + _swprintf(szRid, L"%08lX", GroupId); /* Create the group object */ Status = SampOpenDbObject(DomainObject, @@ -4850,7 +4850,7 @@ SamrOpenAlias(IN SAMPR_HANDLE DomainHandle, } /* Convert the RID into a string (hex) */ - swprintf(szRid, L"%08lX", AliasId); + _swprintf(szRid, L"%08lX", AliasId); /* Create the alias object */ Status = SampOpenDbObject(DomainObject, @@ -5451,7 +5451,7 @@ SamrOpenUser(IN SAMPR_HANDLE DomainHandle, } /* Convert the RID into a string (hex) */ - swprintf(szRid, L"%08lX", UserId); + _swprintf(szRid, L"%08lX", UserId); /* Create the user object */ Status = SampOpenDbObject(DomainObject, @@ -8950,7 +8950,7 @@ SamrCreateUser2InDomain(IN SAMPR_HANDLE DomainHandle, } /* Convert the RID into a string (hex) */ - swprintf(szRid, L"%08lX", ulRid); + _swprintf(szRid, L"%08lX", ulRid); /* Create the user object */ Status = SampCreateDbObject(DomainObject, diff --git a/dll/win32/samsrv/setup.c b/dll/win32/samsrv/setup.c index 30e11a96019..84feca87b98 100644 --- a/dll/win32/samsrv/setup.c +++ b/dll/win32/samsrv/setup.c @@ -33,7 +33,7 @@ SampSetupAddMemberToAlias(HKEY hDomainKey, ConvertSidToStringSidW(MemberSid, &MemberSidString); - swprintf(szKeyName, L"Aliases\\%08lX\\Members", AliasId); + _swprintf(szKeyName, L"Aliases\\%08lX\\Members", AliasId); if (!RegCreateKeyExW(hDomainKey, szKeyName, @@ -55,7 +55,7 @@ SampSetupAddMemberToAlias(HKEY hDomainKey, RegCloseKey(hMembersKey); } - swprintf(szKeyName, L"Aliases\\Members\\%s", MemberSidString); + _swprintf(szKeyName, L"Aliases\\Members\\%s", MemberSidString); if (!RegCreateKeyExW(hDomainKey, szKeyName, @@ -67,7 +67,7 @@ SampSetupAddMemberToAlias(HKEY hDomainKey, &hMembersKey, &dwDisposition)) { - swprintf(szKeyName, L"%08lX", AliasId); + _swprintf(szKeyName, L"%08lX", AliasId); RegSetValueEx(hMembersKey, szKeyName, @@ -100,7 +100,7 @@ SampSetupCreateAliasAccount(HANDLE hDomainKey, ULONG SdSize = 0; NTSTATUS Status; - swprintf(szAccountKeyName, L"Aliases\\%08lX", ulRelativeId); + _swprintf(szAccountKeyName, L"Aliases\\%08lX", ulRelativeId); Status = SampRegCreateKey(hDomainKey, szAccountKeyName, @@ -186,7 +186,7 @@ SampSetupAddMemberToGroup(IN HANDLE hDomainKey, ULONG i; NTSTATUS Status; - swprintf(szKeyName, L"Groups\\%08lX", GroupId); + _swprintf(szKeyName, L"Groups\\%08lX", GroupId); Status = SampRegOpenKey(hDomainKey, szKeyName, @@ -272,7 +272,7 @@ SampSetupCreateGroupAccount(HANDLE hDomainKey, FixedGroupData.GroupId = ulRelativeId; FixedGroupData.Attributes = 0; - swprintf(szAccountKeyName, L"Groups\\%08lX", ulRelativeId); + _swprintf(szAccountKeyName, L"Groups\\%08lX", ulRelativeId); Status = SampRegCreateKey(hDomainKey, szAccountKeyName, @@ -401,7 +401,7 @@ SampSetupCreateUserAccount(HANDLE hDomainKey, FixedUserData.AdminCount = 0; FixedUserData.OperatorCount = 0; - swprintf(szAccountKeyName, L"Users\\%08lX", ulRelativeId); + _swprintf(szAccountKeyName, L"Users\\%08lX", ulRelativeId); Status = SampRegCreateKey(hDomainKey, szAccountKeyName, diff --git a/dll/win32/samsrv/user.c b/dll/win32/samsrv/user.c index 84099636018..64aaf3bb9ba 100644 --- a/dll/win32/samsrv/user.c +++ b/dll/win32/samsrv/user.c @@ -22,7 +22,7 @@ SampOpenUserObject(IN PSAM_DB_OBJECT DomainObject, DomainObject, UserId, DesiredAccess, UserObject); /* Convert the RID into a string (hex) */ - swprintf(szRid, L"%08lX", UserId); + _swprintf(szRid, L"%08lX", UserId); /* Create the user object */ return SampOpenDbObject(DomainObject, diff --git a/dll/win32/shell32/COpenWithMenu.cpp b/dll/win32/shell32/COpenWithMenu.cpp index b6ab8490114..715784be247 100644 --- a/dll/win32/shell32/COpenWithMenu.cpp +++ b/dll/win32/shell32/COpenWithMenu.cpp @@ -489,7 +489,7 @@ BOOL COpenWithList::LoadInfo(COpenWithList::SApp *pApp) } /* Query name */ - swprintf(wszBuf, L"\\StringFileInfo\\%04x%04x\\FileDescription", wLang, wCode); + _swprintf(wszBuf, L"\\StringFileInfo\\%04x%04x\\FileDescription", wLang, wCode); success = VerQueryValueW(pBuf, wszBuf, (LPVOID *)&pResult, &cchLen) && (cchLen > 1); if (success) StringCchCopyNW(pApp->wszName, _countof(pApp->wszName), pResult, cchLen); diff --git a/dll/win32/shell32/dialogs/drvdefext.cpp b/dll/win32/shell32/dialogs/drvdefext.cpp index cf6d654eb0f..97d8545b876 100644 --- a/dll/win32/shell32/dialogs/drvdefext.cpp +++ b/dll/win32/shell32/dialogs/drvdefext.cpp @@ -497,7 +497,7 @@ CDrvDefExt::InitGeneralPage(HWND hwndDlg) /* Set drive description */ WCHAR wszFormat[50]; GetDlgItemTextW(hwndDlg, 14009, wszFormat, _countof(wszFormat)); - swprintf(wszBuf, wszFormat, m_wszDrive[0]); + _swprintf(wszBuf, wszFormat, m_wszDrive[0]); SetDlgItemTextW(hwndDlg, 14009, wszBuf); /* show disk cleanup button only for fixed drives */ diff --git a/dll/win32/shell32/dialogs/filedefext.cpp b/dll/win32/shell32/dialogs/filedefext.cpp index 963c2ab8021..f9b4f35991b 100644 --- a/dll/win32/shell32/dialogs/filedefext.cpp +++ b/dll/win32/shell32/dialogs/filedefext.cpp @@ -164,7 +164,7 @@ LPCWSTR CFileVersionInfo::GetString(LPCWSTR pwszName) return NULL; WCHAR wszBuf[256]; - swprintf(wszBuf, L"\\StringFileInfo\\%04x%04x\\%s", m_wLang, m_wCode, pwszName); + _swprintf(wszBuf, L"\\StringFileInfo\\%04x%04x\\%s", m_wLang, m_wCode, pwszName); /* Query string in version block */ LPCWSTR pwszResult = NULL; @@ -175,7 +175,7 @@ LPCWSTR CFileVersionInfo::GetString(LPCWSTR pwszName) if (!pwszResult) { /* Try US English */ - swprintf(wszBuf, L"\\StringFileInfo\\%04x%04x\\%s", MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), 1252, pwszName); + _swprintf(wszBuf, L"\\StringFileInfo\\%04x%04x\\%s", MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), 1252, pwszName); if (!VerQueryValueW(m_pInfo, wszBuf, (LPVOID *)&pwszResult, &cBytes)) pwszResult = NULL; } @@ -219,7 +219,7 @@ SH_FormatInteger(LONGLONG Num, LPWSTR pwszResult, UINT cchResultMax) { // Print the number in uniform mode WCHAR wszNumber[24]; - swprintf(wszNumber, L"%I64u", Num); + _swprintf(wszNumber, L"%I64u", Num); // Get system strings for decimal and thousand separators. WCHAR wszDecimalSep[8], wszThousandSep[8]; @@ -1087,10 +1087,10 @@ CFileDefExt::InitVersionPage(HWND hwndDlg) if (pInfo) { WCHAR wszVersion[256]; - swprintf(wszVersion, L"%u.%u.%u.%u", HIWORD(pInfo->dwFileVersionMS), - LOWORD(pInfo->dwFileVersionMS), - HIWORD(pInfo->dwFileVersionLS), - LOWORD(pInfo->dwFileVersionLS)); + _swprintf(wszVersion, L"%u.%u.%u.%u", HIWORD(pInfo->dwFileVersionMS), + LOWORD(pInfo->dwFileVersionMS), + HIWORD(pInfo->dwFileVersionLS), + LOWORD(pInfo->dwFileVersionLS)); TRACE("MS %x LS %x ver %s \n", pInfo->dwFileVersionMS, pInfo->dwFileVersionLS, debugstr_w(wszVersion)); SetDlgItemTextW(hwndDlg, 14001, wszVersion); } diff --git a/dll/win32/shell32/dialogs/recycler_prop.cpp b/dll/win32/shell32/dialogs/recycler_prop.cpp index 72387de388c..1efcd47220b 100644 --- a/dll/win32/shell32/dialogs/recycler_prop.cpp +++ b/dll/win32/shell32/dialogs/recycler_prop.cpp @@ -112,7 +112,7 @@ InitializeRecycleBinDlg(HWND hwndDlg, WCHAR DefaultDrive) dwSerial = -1; } - swprintf(szVolume, L"%s (%c:)", szName, szDrive[0]); + _swprintf(szVolume, L"%s (%c:)", szName, szDrive[0]); ZeroMemory(&li, sizeof(li)); li.mask = LVIF_TEXT | LVIF_PARAM; li.iSubItem = 0; @@ -129,7 +129,7 @@ InitializeRecycleBinDlg(HWND hwndDlg, WCHAR DefaultDrive) pItem->FreeBytesAvailable = FreeBytesAvailable; pItem->dwSerial = dwSerial; - swprintf(szName, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\BitBucket\\Volume\\%04X-%04X", LOWORD(dwSerial), HIWORD(dwSerial)); + _swprintf(szName, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\BitBucket\\Volume\\%04X-%04X", LOWORD(dwSerial), HIWORD(dwSerial)); dwSize = sizeof(DWORD); if (RegGetValueW(HKEY_CURRENT_USER, szName, L"MaxCapacity", RRF_RT_DWORD, NULL, &pItem->dwMaxCapacity, &dwSize)) @@ -207,7 +207,7 @@ static BOOL StoreDriveSettings(HWND hwndDlg) if (SendMessageW(hDlgCtrl, LVM_GETITEMW, 0, (LPARAM)&li)) { pItem = (PDRIVE_ITEM_CONTEXT)li.lParam; - swprintf(szSerial, L"%04X-%04X", LOWORD(pItem->dwSerial), HIWORD(pItem->dwSerial)); + _swprintf(szSerial, L"%04X-%04X", LOWORD(pItem->dwSerial), HIWORD(pItem->dwSerial)); if (RegCreateKeyExW(hKey, szSerial, 0, NULL, 0, KEY_WRITE, NULL, &hSubKey, NULL) == ERROR_SUCCESS) { dwSize = sizeof(DWORD); diff --git a/dll/win32/shell32/droptargets/CFSDropTarget.cpp b/dll/win32/shell32/droptargets/CFSDropTarget.cpp index d7542266847..ec04492878b 100644 --- a/dll/win32/shell32/droptargets/CFSDropTarget.cpp +++ b/dll/win32/shell32/droptargets/CFSDropTarget.cpp @@ -184,16 +184,16 @@ CFSDropTarget::_GetUniqueFileName(LPCWSTR pwszBasePath, LPCWSTR pwszExt, LPWSTR } if (!bShortcut) - swprintf(pwszTarget, L"%s%s%s", wszLink, pwszBasePath, pwszExt); + _swprintf(pwszTarget, L"%s%s%s", wszLink, pwszBasePath, pwszExt); else - swprintf(pwszTarget, L"%s%s", pwszBasePath, pwszExt); + _swprintf(pwszTarget, L"%s%s", pwszBasePath, pwszExt); for (UINT i = 2; PathFileExistsW(pwszTarget); ++i) { if (!bShortcut) - swprintf(pwszTarget, L"%s%s (%u)%s", wszLink, pwszBasePath, i, pwszExt); + _swprintf(pwszTarget, L"%s%s (%u)%s", wszLink, pwszBasePath, i, pwszExt); else - swprintf(pwszTarget, L"%s (%u)%s", pwszBasePath, i, pwszExt); + _swprintf(pwszTarget, L"%s (%u)%s", pwszBasePath, i, pwszExt); } return TRUE; diff --git a/dll/win32/shell32/folders/CRecycleBin.cpp b/dll/win32/shell32/folders/CRecycleBin.cpp index a02e986289d..e215b2e1f9f 100644 --- a/dll/win32/shell32/folders/CRecycleBin.cpp +++ b/dll/win32/shell32/folders/CRecycleBin.cpp @@ -1182,7 +1182,7 @@ TRASH_CanTrashFile(LPCWSTR wszPath) return FALSE; } - swprintf(szBuffer, L"%04X-%04X", LOWORD(VolSerialNumber), HIWORD(VolSerialNumber)); + _swprintf(szBuffer, L"%04X-%04X", LOWORD(VolSerialNumber), HIWORD(VolSerialNumber)); wcscat(szKey, szBuffer); if (RegCreateKeyExW(HKEY_CURRENT_USER, szKey, 0, NULL, 0, KEY_READ | KEY_WRITE, NULL, &hKey, &dwDisposition) != ERROR_SUCCESS) diff --git a/dll/win32/shell32/shell32.cpp b/dll/win32/shell32/shell32.cpp index cf7f79378e4..0ae868780d1 100644 --- a/dll/win32/shell32/shell32.cpp +++ b/dll/win32/shell32/shell32.cpp @@ -67,7 +67,7 @@ AddCommasW(DWORD lValue, LPWSTR lpNumber) numFormat.lpThousandSep = szSeparator; numFormat.NegativeOrder = 0; - swprintf(szValue, L"%lu", lValue); + _swprintf(szValue, L"%lu", lValue); if (GetNumberFormatW(LOCALE_USER_DEFAULT, 0, diff --git a/dll/win32/shell32/shellrecyclebin/recyclebin_generic.cpp b/dll/win32/shell32/shellrecyclebin/recyclebin_generic.cpp index 09f561f40b6..2c6ffc8201c 100644 --- a/dll/win32/shell32/shellrecyclebin/recyclebin_generic.cpp +++ b/dll/win32/shell32/shellrecyclebin/recyclebin_generic.cpp @@ -108,7 +108,7 @@ STDMETHODIMP RecycleBinGeneric::DeleteFile(LPCWSTR szFileName) return HRESULT_FROM_WIN32(GetLastError()); } #else - swprintf(szVolume, L"%c:\\", szFullName[0]); + _swprintf(szVolume, L"%c:\\", szFullName[0]); #endif /* Skip namespace (if any): "\\.\" or "\\?\" */ @@ -148,7 +148,7 @@ STDMETHODIMP RecycleBinGeneric::EmptyRecycleBin() continue; WCHAR szVolumeName[MAX_PATH]; - swprintf(szVolumeName, L"%c:\\", L'A' + i); + _swprintf(szVolumeName, L"%c:\\", L'A' + i); if (GetDriveTypeW(szVolumeName) != DRIVE_FIXED) continue; diff --git a/dll/win32/shell32/shfldr.h b/dll/win32/shell32/shfldr.h index 718eaf4ea16..86a929ae7bf 100644 --- a/dll/win32/shell32/shfldr.h +++ b/dll/win32/shell32/shfldr.h @@ -166,7 +166,7 @@ static __inline int SHELL32_GUIDToStringW (REFGUID guid, LPWSTR str) '%','0','2','X','%','0','2','X','-', '%','0','2','X','%','0','2','X','%','0','2','X','%','0','2','X', '%','0','2','X','%','0','2','X','}',0 }; - return swprintf(str, fmtW, + return _swprintf(str, fmtW, guid.Data1, guid.Data2, guid.Data3, guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3], guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]); diff --git a/dll/win32/shell32/shlexec.cpp b/dll/win32/shell32/shlexec.cpp index da1e687a027..4f484d89998 100644 --- a/dll/win32/shell32/shlexec.cpp +++ b/dll/win32/shell32/shlexec.cpp @@ -457,7 +457,7 @@ static BOOL SHELL_ArgifyW(WCHAR* out, DWORD len, const WCHAR* fmt, const WCHAR* LPVOID pv; HGLOBAL hmem = SHAllocShared(pidl, ILGetSize(pidl), 0); pv = SHLockShared(hmem, 0); - chars = swprintf(buf, L":%p", pv); + chars = _swprintf(buf, L":%p", pv); if (chars >= ARRAY_SIZE(buf)) ERR("pidl format buffer too small!\n"); @@ -2527,7 +2527,7 @@ static BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc) wcmd = wcmdAlloc; wcmdLen = len; } - swprintf(wcmd, L"\"%s\"", (LPWSTR)wszApplicationName); + _swprintf(wcmd, L"\"%s\"", (LPWSTR)wszApplicationName); if (sei_tmp.lpParameters[0]) { strcatW(wcmd, L" "); @@ -2561,7 +2561,7 @@ static BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc) NULL, &env, NULL, NULL); if (retval > 32) { - swprintf(lpQuotedFile, L"\"%s\"", lpFile); + _swprintf(lpQuotedFile, L"\"%s\"", lpFile); retval = SHELL_quote_and_execute(wExec, lpQuotedFile, wszKeyname, wszApplicationName, env, diff --git a/dll/win32/shell32/shlfolder.cpp b/dll/win32/shell32/shlfolder.cpp index 8a79402a806..f64773da0cf 100644 --- a/dll/win32/shell32/shlfolder.cpp +++ b/dll/win32/shell32/shlfolder.cpp @@ -465,13 +465,13 @@ void AddFSClassKeysToArray(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, HKEY* array, AddClassKeyToArray(L"Unknown", array, cKeys); } - swprintf(wszSFA, L"SystemFileAssociations\\%s", extension); + _swprintf(wszSFA, L"SystemFileAssociations\\%s", extension); AddClassKeyToArray(wszSFA, array, cKeys); dwSize = sizeof(wszClass); if (RegGetValueW(HKEY_CLASSES_ROOT, extension, L"PerceivedType", RRF_RT_REG_SZ, NULL, wszClass, &dwSize) == ERROR_SUCCESS) { - swprintf(wszSFA, L"SystemFileAssociations\\%s", wszClass); + _swprintf(wszSFA, L"SystemFileAssociations\\%s", wszClass); AddClassKeyToArray(wszSFA, array, cKeys); } } diff --git a/dll/win32/syssetup/logfile.c b/dll/win32/syssetup/logfile.c index a826ab10ead..c446b33fd44 100644 --- a/dll/win32/syssetup/logfile.c +++ b/dll/win32/syssetup/logfile.c @@ -120,10 +120,10 @@ pSetupDebugPrint( goto done; va_start(args, pszMessage); - vsnwprintf(pszFormatBuffer, - FORMAT_BUFFER_SIZE, - pszMessage, - args); + _vsnwprintf(pszFormatBuffer, + FORMAT_BUFFER_SIZE, + pszMessage, + args); va_end(args); } diff --git a/dll/win32/syssetup/wizard.c b/dll/win32/syssetup/wizard.c index 3727af2a9be..9908bfc1806 100644 --- a/dll/win32/syssetup/wizard.c +++ b/dll/win32/syssetup/wizard.c @@ -3037,7 +3037,7 @@ ProcessUnattendSection( NULL)) { WCHAR szPath[MAX_PATH]; - swprintf(szName, L"%d", i); + _swprintf(szName, L"%d", i); DPRINT("szName %S szValue %S\n", szName, szValue); if (ExpandEnvironmentStringsW(szValue, szPath, MAX_PATH)) @@ -3289,7 +3289,7 @@ ProcessSetupInf( } /* Save the path in Win32 format in the setup INF */ - swprintf(szValue, L"\"%s\"", pSetupData->SourcePath); + _swprintf(szValue, L"\"%s\"", pSetupData->SourcePath); WritePrivateProfileStringW(L"data", L"dospath", szValue, szPath); /* diff --git a/dll/win32/userenv/profile.c b/dll/win32/userenv/profile.c index f52f6093d22..993c2bde2c7 100644 --- a/dll/win32/userenv/profile.c +++ b/dll/win32/userenv/profile.c @@ -972,7 +972,7 @@ CreateUserProfileExW( for (i = 0; i < 1000; i++) { - swprintf(szUserProfileName, L"%s.%03u", lpUserName, i); + _swprintf(szUserProfileName, L"%s.%03u", lpUserName, i); StringCbCopyW(szUserProfilePath, sizeof(szUserProfilePath), szProfilesPath); StringCbCatW(szUserProfilePath, sizeof(szUserProfilePath), L"\\"); diff --git a/drivers/bluetooth/fbtusb/fbtusb.c b/drivers/bluetooth/fbtusb/fbtusb.c index 5b8ee43cc32..654e8aa63df 100644 --- a/drivers/bluetooth/fbtusb/fbtusb.c +++ b/drivers/bluetooth/fbtusb/fbtusb.c @@ -121,12 +121,12 @@ NTSTATUS NTAPI FreeBT_AddDevice(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJEC deviceObject = NULL; - swprintf(wszDeviceName, L"\\Device\\FbtUsb%02d", instanceNumber); + _swprintf(wszDeviceName, L"\\Device\\FbtUsb%02d", instanceNumber); RtlInitUnicodeString(&uniDeviceName, wszDeviceName); ntStatus=STATUS_OBJECT_NAME_COLLISION; while (instanceNumber<99 && !NT_SUCCESS(ntStatus)) { - swprintf(wszDeviceName, L"\\Device\\FbtUsb%02d", instanceNumber); + _swprintf(wszDeviceName, L"\\Device\\FbtUsb%02d", instanceNumber); uniDeviceName.Length = wcslen(wszDeviceName) * sizeof(WCHAR); FreeBT_DbgPrint(1, ("FBTUSB: Attempting to create device %ws\n", wszDeviceName)); ntStatus = IoCreateDevice( @@ -157,7 +157,7 @@ NTSTATUS NTAPI FreeBT_AddDevice(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJEC deviceExtension->PhysicalDeviceObject = PhysicalDeviceObject; deviceObject->Flags |= DO_DIRECT_IO; - swprintf(deviceExtension->wszDosDeviceName, L"\\DosDevices\\FbtUsb%02d", instanceNumber); + _swprintf(deviceExtension->wszDosDeviceName, L"\\DosDevices\\FbtUsb%02d", instanceNumber); RtlInitUnicodeString(&uniDosDeviceName, deviceExtension->wszDosDeviceName); ntStatus=IoCreateSymbolicLink(&uniDosDeviceName, &uniDeviceName); if (!NT_SUCCESS(ntStatus)) diff --git a/drivers/bus/acpi/acpienum.c b/drivers/bus/acpi/acpienum.c index a084b31bfac..1b8ec881c1d 100644 --- a/drivers/bus/acpi/acpienum.c +++ b/drivers/bus/acpi/acpienum.c @@ -107,12 +107,12 @@ Bus_PlugInDevice ( // Copy the hardware IDs // index = 0; - index += swprintf(&temp[index], + index += _swprintf(&temp[index], L"ACPI\\%hs", Device->pnp.hardware_id); temp[index++] = UNICODE_NULL; - index += swprintf(&temp[index], + index += _swprintf(&temp[index], L"*%hs", Device->pnp.hardware_id); temp[index++] = UNICODE_NULL; diff --git a/drivers/bus/acpi/buspdo.c b/drivers/bus/acpi/buspdo.c index abdc7227cb6..6beda9be4fc 100644 --- a/drivers/bus/acpi/buspdo.c +++ b/drivers/bus/acpi/buspdo.c @@ -474,9 +474,9 @@ Bus_PDO_QueryDeviceId( } else { - length = swprintf(temp, - L"ACPI\\%hs", - Device->pnp.hardware_id); + length = _swprintf(temp, + L"ACPI\\%hs", + Device->pnp.hardware_id); } } else @@ -485,8 +485,8 @@ Bus_PDO_QueryDeviceId( * these are direct children of the ACPI root device * and therefore have no handle */ - length = swprintf(temp, - L"ACPI\\FixedButton"); + length = _swprintf(temp, + L"ACPI\\FixedButton"); } temp[length++] = UNICODE_NULL; @@ -515,17 +515,17 @@ Bus_PDO_QueryDeviceId( acpi_bus_get_device(DeviceData->AcpiHandle, &Device); if (Device->flags.unique_id) - length = swprintf(temp, - L"%hs", - Device->pnp.unique_id); + length = _swprintf(temp, + L"%hs", + Device->pnp.unique_id); else /* FIXME: Generate unique id! */ - length = swprintf(temp, L"%ls", L"0"); + length = _swprintf(temp, L"%ls", L"0"); } else { /* FIXME: Generate unique id! */ - length = swprintf(temp, L"%ls", L"0"); + length = _swprintf(temp, L"%ls", L"0"); } temp[length++] = UNICODE_NULL; @@ -570,14 +570,14 @@ Bus_PDO_QueryDeviceId( } else { - length += swprintf(&temp[length], - L"ACPI\\%hs", - Device->pnp.hardware_id); + length += _swprintf(&temp[length], + L"ACPI\\%hs", + Device->pnp.hardware_id); temp[length++] = UNICODE_NULL; - length += swprintf(&temp[length], - L"*%hs", - Device->pnp.hardware_id); + length += _swprintf(&temp[length], + L"*%hs", + Device->pnp.hardware_id); temp[length++] = UNICODE_NULL; temp[length++] = UNICODE_NULL; src = temp; @@ -585,12 +585,12 @@ Bus_PDO_QueryDeviceId( } else { - length += swprintf(&temp[length], - L"ACPI\\FixedButton"); + length += _swprintf(&temp[length], + L"ACPI\\FixedButton"); temp[length++] = UNICODE_NULL; - length += swprintf(&temp[length], - L"*FixedButton"); + length += _swprintf(&temp[length], + L"*FixedButton"); temp[length++] = UNICODE_NULL; temp[length++] = UNICODE_NULL; src = temp; @@ -633,14 +633,14 @@ Bus_PDO_QueryDeviceId( if (strcmp(Device->pnp.hardware_id, "Processor") == 0) { - length += swprintf(&temp[length], - L"ACPI\\%hs", - Device->pnp.hardware_id); + length += _swprintf(&temp[length], + L"ACPI\\%hs", + Device->pnp.hardware_id); temp[length++] = UNICODE_NULL; - length += swprintf(&temp[length], - L"*%hs", - Device->pnp.hardware_id); + length += _swprintf(&temp[length], + L"*%hs", + Device->pnp.hardware_id); temp[length++] = UNICODE_NULL; temp[length++] = UNICODE_NULL; } @@ -648,14 +648,14 @@ Bus_PDO_QueryDeviceId( { for (i = 0; i < Device->pnp.cid_list->Count; i++) { - length += swprintf(&temp[length], - L"ACPI\\%hs", - Device->pnp.cid_list->Ids[i].String); + length += _swprintf(&temp[length], + L"ACPI\\%hs", + Device->pnp.cid_list->Ids[i].String); temp[length++] = UNICODE_NULL; - length += swprintf(&temp[length], - L"*%hs", - Device->pnp.cid_list->Ids[i].String); + length += _swprintf(&temp[length], + L"*%hs", + Device->pnp.cid_list->Ids[i].String); temp[length++] = UNICODE_NULL; } diff --git a/drivers/bus/acpi/main.c b/drivers/bus/acpi/main.c index 026c6ee2ad0..c903635b582 100644 --- a/drivers/bus/acpi/main.c +++ b/drivers/bus/acpi/main.c @@ -634,22 +634,22 @@ GetProcessorInformation(VOID) } Length = 0; - Length += swprintf(&HardwareIdsBuffer[Length], L"ACPI\\%s_-_%.*s", ProcessorVendorIdentifier, Level1Length, ProcessorIdentifier); + Length += _swprintf(&HardwareIdsBuffer[Length], L"ACPI\\%s_-_%.*s", ProcessorVendorIdentifier, Level1Length, ProcessorIdentifier); HardwareIdsBuffer[Length++] = UNICODE_NULL; - Length += swprintf(&HardwareIdsBuffer[Length], L"*%s_-_%.*s", ProcessorVendorIdentifier, Level1Length, ProcessorIdentifier); + Length += _swprintf(&HardwareIdsBuffer[Length], L"*%s_-_%.*s", ProcessorVendorIdentifier, Level1Length, ProcessorIdentifier); HardwareIdsBuffer[Length++] = UNICODE_NULL; - Length += swprintf(&HardwareIdsBuffer[Length], L"ACPI\\%s_-_%.*s", ProcessorVendorIdentifier, Level2Length, ProcessorIdentifier); + Length += _swprintf(&HardwareIdsBuffer[Length], L"ACPI\\%s_-_%.*s", ProcessorVendorIdentifier, Level2Length, ProcessorIdentifier); HardwareIdsBuffer[Length++] = UNICODE_NULL; - Length += swprintf(&HardwareIdsBuffer[Length], L"*%s_-_%.*s", ProcessorVendorIdentifier, Level2Length, ProcessorIdentifier); + Length += _swprintf(&HardwareIdsBuffer[Length], L"*%s_-_%.*s", ProcessorVendorIdentifier, Level2Length, ProcessorIdentifier); HardwareIdsBuffer[Length++] = UNICODE_NULL; - Length += swprintf(&HardwareIdsBuffer[Length], L"ACPI\\%s_-_%.*s", ProcessorVendorIdentifier, Level3Length, ProcessorIdentifier); + Length += _swprintf(&HardwareIdsBuffer[Length], L"ACPI\\%s_-_%.*s", ProcessorVendorIdentifier, Level3Length, ProcessorIdentifier); HardwareIdsBuffer[Length++] = UNICODE_NULL; - Length += swprintf(&HardwareIdsBuffer[Length], L"*%s_-_%.*s", ProcessorVendorIdentifier, Level3Length, ProcessorIdentifier); + Length += _swprintf(&HardwareIdsBuffer[Length], L"*%s_-_%.*s", ProcessorVendorIdentifier, Level3Length, ProcessorIdentifier); HardwareIdsBuffer[Length++] = UNICODE_NULL; HardwareIdsBuffer[Length++] = UNICODE_NULL; @@ -664,7 +664,7 @@ GetProcessorInformation(VOID) ProcessorIdString = ExAllocatePoolWithTag(PagedPool, Length, 'IpcA'); if (ProcessorIdString != NULL) { - Length = swprintf(ProcessorIdString, L"ACPI\\%s_-_%.*s", ProcessorVendorIdentifier, Level1Length, ProcessorIdentifier); + Length = _swprintf(ProcessorIdString, L"ACPI\\%s_-_%.*s", ProcessorVendorIdentifier, Level1Length, ProcessorIdentifier); ProcessorIdString[Length++] = UNICODE_NULL; DPRINT("ProcessorIdString: %S\n", ProcessorIdString); } diff --git a/drivers/bus/pci/pci.c b/drivers/bus/pci/pci.c index 22ec3823ad1..b85eeafc919 100644 --- a/drivers/bus/pci/pci.c +++ b/drivers/bus/pci/pci.c @@ -286,13 +286,13 @@ PciCreateDeviceIDString(PUNICODE_STRING DeviceID, { WCHAR Buffer[256]; - swprintf(Buffer, - L"PCI\\VEN_%04X&DEV_%04X&SUBSYS_%08X&REV_%02X", - Device->PciConfig.VendorID, - Device->PciConfig.DeviceID, - (Device->PciConfig.u.type0.SubSystemID << 16) + - Device->PciConfig.u.type0.SubVendorID, - Device->PciConfig.RevisionID); + _swprintf(Buffer, + L"PCI\\VEN_%04X&DEV_%04X&SUBSYS_%08X&REV_%02X", + Device->PciConfig.VendorID, + Device->PciConfig.DeviceID, + (Device->PciConfig.u.type0.SubSystemID << 16) + + Device->PciConfig.u.type0.SubVendorID, + Device->PciConfig.RevisionID); return RtlCreateUnicodeString(DeviceID, Buffer) ? STATUS_SUCCESS : STATUS_INSUFFICIENT_RESOURCES; } @@ -304,7 +304,7 @@ PciCreateInstanceIDString(PUNICODE_STRING InstanceID, { WCHAR Buffer[3]; - swprintf(Buffer, L"%02X", Device->SlotNumber.u.AsULONG & 0xff); + _swprintf(Buffer, L"%02X", Device->SlotNumber.u.AsULONG & 0xff); return RtlCreateUnicodeString(InstanceID, Buffer) ? STATUS_SUCCESS : STATUS_INSUFFICIENT_RESOURCES; } @@ -319,38 +319,38 @@ PciCreateHardwareIDsString(PUNICODE_STRING HardwareIDs, ULONG Index; Index = 0; - Index += swprintf(&Buffer[Index], - L"PCI\\VEN_%04X&DEV_%04X&SUBSYS_%08X&REV_%02X", - Device->PciConfig.VendorID, - Device->PciConfig.DeviceID, - (Device->PciConfig.u.type0.SubSystemID << 16) + - Device->PciConfig.u.type0.SubVendorID, - Device->PciConfig.RevisionID); + Index += _swprintf(&Buffer[Index], + L"PCI\\VEN_%04X&DEV_%04X&SUBSYS_%08X&REV_%02X", + Device->PciConfig.VendorID, + Device->PciConfig.DeviceID, + (Device->PciConfig.u.type0.SubSystemID << 16) + + Device->PciConfig.u.type0.SubVendorID, + Device->PciConfig.RevisionID); Index++; - Index += swprintf(&Buffer[Index], - L"PCI\\VEN_%04X&DEV_%04X&SUBSYS_%08X", - Device->PciConfig.VendorID, - Device->PciConfig.DeviceID, - (Device->PciConfig.u.type0.SubSystemID << 16) + - Device->PciConfig.u.type0.SubVendorID); + Index += _swprintf(&Buffer[Index], + L"PCI\\VEN_%04X&DEV_%04X&SUBSYS_%08X", + Device->PciConfig.VendorID, + Device->PciConfig.DeviceID, + (Device->PciConfig.u.type0.SubSystemID << 16) + + Device->PciConfig.u.type0.SubVendorID); Index++; - Index += swprintf(&Buffer[Index], - L"PCI\\VEN_%04X&DEV_%04X&CC_%02X%02X%02X", - Device->PciConfig.VendorID, - Device->PciConfig.DeviceID, - Device->PciConfig.BaseClass, - Device->PciConfig.SubClass, - Device->PciConfig.ProgIf); + Index += _swprintf(&Buffer[Index], + L"PCI\\VEN_%04X&DEV_%04X&CC_%02X%02X%02X", + Device->PciConfig.VendorID, + Device->PciConfig.DeviceID, + Device->PciConfig.BaseClass, + Device->PciConfig.SubClass, + Device->PciConfig.ProgIf); Index++; - Index += swprintf(&Buffer[Index], - L"PCI\\VEN_%04X&DEV_%04X&CC_%02X%02X", - Device->PciConfig.VendorID, - Device->PciConfig.DeviceID, - Device->PciConfig.BaseClass, - Device->PciConfig.SubClass); + Index += _swprintf(&Buffer[Index], + L"PCI\\VEN_%04X&DEV_%04X&CC_%02X%02X", + Device->PciConfig.VendorID, + Device->PciConfig.DeviceID, + Device->PciConfig.BaseClass, + Device->PciConfig.SubClass); Index++; Buffer[Index] = UNICODE_NULL; @@ -371,50 +371,50 @@ PciCreateCompatibleIDsString(PUNICODE_STRING CompatibleIDs, ULONG Index; Index = 0; - Index += swprintf(&Buffer[Index], - L"PCI\\VEN_%04X&DEV_%04X&REV_%02X", - Device->PciConfig.VendorID, - Device->PciConfig.DeviceID, - Device->PciConfig.RevisionID); + Index += _swprintf(&Buffer[Index], + L"PCI\\VEN_%04X&DEV_%04X&REV_%02X", + Device->PciConfig.VendorID, + Device->PciConfig.DeviceID, + Device->PciConfig.RevisionID); Index++; - Index += swprintf(&Buffer[Index], - L"PCI\\VEN_%04X&DEV_%04X", - Device->PciConfig.VendorID, - Device->PciConfig.DeviceID); + Index += _swprintf(&Buffer[Index], + L"PCI\\VEN_%04X&DEV_%04X", + Device->PciConfig.VendorID, + Device->PciConfig.DeviceID); Index++; - Index += swprintf(&Buffer[Index], - L"PCI\\VEN_%04X&CC_%02X%02X%02X", - Device->PciConfig.VendorID, - Device->PciConfig.BaseClass, - Device->PciConfig.SubClass, - Device->PciConfig.ProgIf); + Index += _swprintf(&Buffer[Index], + L"PCI\\VEN_%04X&CC_%02X%02X%02X", + Device->PciConfig.VendorID, + Device->PciConfig.BaseClass, + Device->PciConfig.SubClass, + Device->PciConfig.ProgIf); Index++; - Index += swprintf(&Buffer[Index], - L"PCI\\VEN_%04X&CC_%02X%02X", - Device->PciConfig.VendorID, - Device->PciConfig.BaseClass, - Device->PciConfig.SubClass); + Index += _swprintf(&Buffer[Index], + L"PCI\\VEN_%04X&CC_%02X%02X", + Device->PciConfig.VendorID, + Device->PciConfig.BaseClass, + Device->PciConfig.SubClass); Index++; - Index += swprintf(&Buffer[Index], - L"PCI\\VEN_%04X", - Device->PciConfig.VendorID); + Index += _swprintf(&Buffer[Index], + L"PCI\\VEN_%04X", + Device->PciConfig.VendorID); Index++; - Index += swprintf(&Buffer[Index], - L"PCI\\CC_%02X%02X%02X", - Device->PciConfig.BaseClass, - Device->PciConfig.SubClass, - Device->PciConfig.ProgIf); + Index += _swprintf(&Buffer[Index], + L"PCI\\CC_%02X%02X%02X", + Device->PciConfig.BaseClass, + Device->PciConfig.SubClass, + Device->PciConfig.ProgIf); Index++; - Index += swprintf(&Buffer[Index], - L"PCI\\CC_%02X%02X", - Device->PciConfig.BaseClass, - Device->PciConfig.SubClass); + Index += _swprintf(&Buffer[Index], + L"PCI\\CC_%02X%02X", + Device->PciConfig.BaseClass, + Device->PciConfig.SubClass); Index++; Buffer[Index] = UNICODE_NULL; @@ -700,11 +700,11 @@ PciCreateDeviceLocationString(PUNICODE_STRING DeviceLocation, { WCHAR Buffer[256]; - swprintf(Buffer, - L"PCI-Bus %lu, Device %u, Function %u", - Device->BusNumber, - Device->SlotNumber.u.bits.DeviceNumber, - Device->SlotNumber.u.bits.FunctionNumber); + _swprintf(Buffer, + L"PCI-Bus %lu, Device %u, Function %u", + Device->BusNumber, + Device->SlotNumber.u.bits.DeviceNumber, + Device->SlotNumber.u.bits.FunctionNumber); return RtlCreateUnicodeString(DeviceLocation, Buffer) ? STATUS_SUCCESS : STATUS_INSUFFICIENT_RESOURCES; } diff --git a/drivers/bus/pcix/arb/arb_comn.c b/drivers/bus/pcix/arb/arb_comn.c index 669cc2d5a60..b8561b2e4b7 100644 --- a/drivers/bus/pcix/arb/arb_comn.c +++ b/drivers/bus/pcix/arb/arb_comn.c @@ -95,10 +95,10 @@ PciInitializeArbiters(IN PPCI_FDO_EXTENSION FdoExtension) /* Setup the instance */ ArbiterInterface->BusFdoExtension = FdoExtension; ArbiterInterface->Interface = CurrentInterface; - swprintf(ArbiterInterface->InstanceName, - L"PCI %S (b=%02x)", - PciArbiterNames[ArbiterType - PciArb_Io], - FdoExtension->BaseBus); + _swprintf(ArbiterInterface->InstanceName, + L"PCI %S (b=%02x)", + PciArbiterNames[ArbiterType - PciArb_Io], + FdoExtension->BaseBus); /* Call the interface initializer for it */ Status = CurrentInterface->Initializer(ArbiterInterface); diff --git a/drivers/bus/pcix/pci/id.c b/drivers/bus/pcix/pci/id.c index 71223783806..237ef94c7ef 100644 --- a/drivers/bus/pcix/pci/id.c +++ b/drivers/bus/pcix/pci/id.c @@ -438,11 +438,11 @@ PciQueryDeviceText(IN PPCI_PDO_EXTENSION PdoExtension, if (LocationBuffer) { /* Build the location string based on bus, function, and device */ - swprintf(LocationBuffer, - MessageBuffer, - PdoExtension->ParentFdoExtension->BaseBus, - PdoExtension->Slot.u.bits.FunctionNumber, - PdoExtension->Slot.u.bits.DeviceNumber); + _swprintf(LocationBuffer, + MessageBuffer, + PdoExtension->ParentFdoExtension->BaseBus, + PdoExtension->Slot.u.bits.FunctionNumber, + PdoExtension->Slot.u.bits.DeviceNumber); } /* Free the original string from the resource section */ diff --git a/drivers/bus/pcix/pdo.c b/drivers/bus/pcix/pdo.c index cedf8e79524..21d0c199dab 100644 --- a/drivers/bus/pcix/pdo.c +++ b/drivers/bus/pcix/pdo.c @@ -543,7 +543,7 @@ PciPdoCreate(IN PPCI_FDO_EXTENSION DeviceExtension, SequenceNumber = InterlockedIncrement(&PciPdoSequenceNumber); /* Create the standard PCI device name for a PDO */ - swprintf(DeviceName, L"\\Device\\NTPNP_PCI%04d", SequenceNumber); + _swprintf(DeviceName, L"\\Device\\NTPNP_PCI%04d", SequenceNumber); RtlInitUnicodeString(&DeviceString, DeviceName); /* Create the actual device now */ diff --git a/drivers/bus/pcix/utils.c b/drivers/bus/pcix/utils.c index 073fb0442d5..91f87a696b3 100644 --- a/drivers/bus/pcix/utils.c +++ b/drivers/bus/pcix/utils.c @@ -804,10 +804,10 @@ PciGetBiosConfig(IN PPCI_PDO_EXTENSION DeviceExtension, if (!NT_SUCCESS(Status)) return Status; /* Create the key value based on the device and function number */ - swprintf(Buffer, - L"DEV_%02x&FUN_%02x", - DeviceExtension->Slot.u.bits.DeviceNumber, - DeviceExtension->Slot.u.bits.FunctionNumber); + _swprintf(Buffer, + L"DEV_%02x&FUN_%02x", + DeviceExtension->Slot.u.bits.DeviceNumber, + DeviceExtension->Slot.u.bits.FunctionNumber); RtlInitUnicodeString(&KeyValue, Buffer); /* Query the value information (PCI BIOS configuration header) */ @@ -864,10 +864,10 @@ PciSaveBiosConfig(IN PPCI_PDO_EXTENSION DeviceExtension, if (!NT_SUCCESS(Status)) return Status; /* Create the key value based on the device and function number */ - swprintf(Buffer, - L"DEV_%02x&FUN_%02x", - DeviceExtension->Slot.u.bits.DeviceNumber, - DeviceExtension->Slot.u.bits.FunctionNumber); + _swprintf(Buffer, + L"DEV_%02x&FUN_%02x", + DeviceExtension->Slot.u.bits.DeviceNumber, + DeviceExtension->Slot.u.bits.FunctionNumber); RtlInitUnicodeString(&KeyValue, Buffer); /* Set the value data (the PCI BIOS configuration header) */ diff --git a/drivers/hid/hidclass/hidclass.c b/drivers/hid/hidclass/hidclass.c index 447cf7d41ab..227d783aae1 100644 --- a/drivers/hid/hidclass/hidclass.c +++ b/drivers/hid/hidclass/hidclass.c @@ -49,7 +49,7 @@ HidClassAddDevice( InterlockedIncrement((PLONG)&HidClassDeviceNumber); /* construct device name */ - swprintf(CharDeviceName, L"\\Device\\_HID%08x", HidClassDeviceNumber); + _swprintf(CharDeviceName, L"\\Device\\_HID%08x", HidClassDeviceNumber); /* initialize device name */ RtlInitUnicodeString(&DeviceName, CharDeviceName); diff --git a/drivers/hid/hidclass/pdo.c b/drivers/hid/hidclass/pdo.c index d33ea79ef5f..48409fb74b0 100644 --- a/drivers/hid/hidclass/pdo.c +++ b/drivers/hid/hidclass/pdo.c @@ -208,16 +208,16 @@ HidClassPDO_HandleQueryHardwareId( // // multi-tlc device // - Offset = swprintf(&Buffer[Offset], L"HID\\Vid_%04x&Pid_%04x&Rev_%04x&Col%02x", PDODeviceExtension->Common.Attributes.VendorID, PDODeviceExtension->Common.Attributes.ProductID, PDODeviceExtension->Common.Attributes.VersionNumber, PDODeviceExtension->CollectionNumber) + 1; - Offset += swprintf(&Buffer[Offset], L"HID\\Vid_%04x&Pid_%04x&Col%02x", PDODeviceExtension->Common.Attributes.VendorID, PDODeviceExtension->Common.Attributes.ProductID, PDODeviceExtension->CollectionNumber) + 1; + Offset = _swprintf(&Buffer[Offset], L"HID\\Vid_%04x&Pid_%04x&Rev_%04x&Col%02x", PDODeviceExtension->Common.Attributes.VendorID, PDODeviceExtension->Common.Attributes.ProductID, PDODeviceExtension->Common.Attributes.VersionNumber, PDODeviceExtension->CollectionNumber) + 1; + Offset += _swprintf(&Buffer[Offset], L"HID\\Vid_%04x&Pid_%04x&Col%02x", PDODeviceExtension->Common.Attributes.VendorID, PDODeviceExtension->Common.Attributes.ProductID, PDODeviceExtension->CollectionNumber) + 1; } else { // // single tlc device // - Offset = swprintf(&Buffer[Offset], L"HID\\Vid_%04x&Pid_%04x&Rev_%04x", PDODeviceExtension->Common.Attributes.VendorID, PDODeviceExtension->Common.Attributes.ProductID, PDODeviceExtension->Common.Attributes.VersionNumber) + 1; - Offset += swprintf(&Buffer[Offset], L"HID\\Vid_%04x&Pid_%04x", PDODeviceExtension->Common.Attributes.VendorID, PDODeviceExtension->Common.Attributes.ProductID) + 1; + Offset = _swprintf(&Buffer[Offset], L"HID\\Vid_%04x&Pid_%04x&Rev_%04x", PDODeviceExtension->Common.Attributes.VendorID, PDODeviceExtension->Common.Attributes.ProductID, PDODeviceExtension->Common.Attributes.VersionNumber) + 1; + Offset += _swprintf(&Buffer[Offset], L"HID\\Vid_%04x&Pid_%04x", PDODeviceExtension->Common.Attributes.VendorID, PDODeviceExtension->Common.Attributes.ProductID) + 1; } // @@ -235,27 +235,27 @@ HidClassPDO_HandleQueryHardwareId( // // Pointer / Mouse // - Offset += swprintf(&Buffer[Offset], L"HID_DEVICE_SYSTEM_MOUSE") + 1; + Offset += _swprintf(&Buffer[Offset], L"HID_DEVICE_SYSTEM_MOUSE") + 1; break; case HID_USAGE_GENERIC_GAMEPAD: case HID_USAGE_GENERIC_JOYSTICK: // // Joystick / Gamepad // - Offset += swprintf(&Buffer[Offset], L"HID_DEVICE_SYSTEM_GAME") + 1; + Offset += _swprintf(&Buffer[Offset], L"HID_DEVICE_SYSTEM_GAME") + 1; break; case HID_USAGE_GENERIC_KEYBOARD: case HID_USAGE_GENERIC_KEYPAD: // // Keyboard / Keypad // - Offset += swprintf(&Buffer[Offset], L"HID_DEVICE_SYSTEM_KEYBOARD") + 1; + Offset += _swprintf(&Buffer[Offset], L"HID_DEVICE_SYSTEM_KEYBOARD") + 1; break; case HID_USAGE_GENERIC_SYSTEM_CTL: // // System Control // - Offset += swprintf(&Buffer[Offset], L"HID_DEVICE_SYSTEM_CONTROL") + 1; + Offset += _swprintf(&Buffer[Offset], L"HID_DEVICE_SYSTEM_CONTROL") + 1; break; } } @@ -264,18 +264,18 @@ HidClassPDO_HandleQueryHardwareId( // // Consumer Audio Control // - Offset += swprintf(&Buffer[Offset], L"HID_DEVICE_SYSTEM_CONSUMER") + 1; + Offset += _swprintf(&Buffer[Offset], L"HID_DEVICE_SYSTEM_CONSUMER") + 1; } // // add HID_DEVICE_UP:0001_U:0002' // - Offset += swprintf(&Buffer[Offset], L"HID_DEVICE_UP:%04x_U:%04x", CollectionDescription->UsagePage, CollectionDescription->Usage) + 1; + Offset += _swprintf(&Buffer[Offset], L"HID_DEVICE_UP:%04x_U:%04x", CollectionDescription->UsagePage, CollectionDescription->Usage) + 1; // // add HID // - Offset +=swprintf(&Buffer[Offset], L"HID_DEVICE") + 1; + Offset += _swprintf(&Buffer[Offset], L"HID_DEVICE") + 1; // // free old buffer @@ -337,7 +337,7 @@ HidClassPDO_HandleQueryInstanceId( // // write device id // - swprintf(Buffer, L"%04x", PDODeviceExtension->CollectionNumber); + _swprintf(Buffer, L"%04x", PDODeviceExtension->CollectionNumber); Irp->IoStatus.Information = (ULONG_PTR)Buffer; // diff --git a/drivers/input/kbdclass/kbdclass.c b/drivers/input/kbdclass/kbdclass.c index 04bc8dcface..4c8400dc1d0 100644 --- a/drivers/input/kbdclass/kbdclass.c +++ b/drivers/input/kbdclass/kbdclass.c @@ -356,7 +356,7 @@ CreateClassDeviceObject( DeviceIdW = &DeviceNameU.Buffer[PrefixLength / sizeof(WCHAR)]; while (DeviceId < 9999) { - DeviceNameU.Length = (USHORT)(PrefixLength + swprintf(DeviceIdW, L"%lu", DeviceId) * sizeof(WCHAR)); + DeviceNameU.Length = (USHORT)(PrefixLength + _swprintf(DeviceIdW, L"%lu", DeviceId) * sizeof(WCHAR)); Status = IoCreateDevice( DriverObject, sizeof(CLASS_DEVICE_EXTENSION), diff --git a/drivers/input/mouclass/mouclass.c b/drivers/input/mouclass/mouclass.c index d123508ef00..2c7c8756b4d 100644 --- a/drivers/input/mouclass/mouclass.c +++ b/drivers/input/mouclass/mouclass.c @@ -323,7 +323,7 @@ CreateClassDeviceObject( DeviceIdW = &DeviceNameU.Buffer[PrefixLength / sizeof(WCHAR)]; while (DeviceId < 9999) { - DeviceNameU.Length = (USHORT)(PrefixLength + swprintf(DeviceIdW, L"%lu", DeviceId) * sizeof(WCHAR)); + DeviceNameU.Length = (USHORT)(PrefixLength + _swprintf(DeviceIdW, L"%lu", DeviceId) * sizeof(WCHAR)); Status = IoCreateDevice( DriverObject, sizeof(CLASS_DEVICE_EXTENSION), diff --git a/drivers/ksfilter/ks/swenum.c b/drivers/ksfilter/ks/swenum.c index c4e05151f6d..9454a9e8cd4 100644 --- a/drivers/ksfilter/ks/swenum.c +++ b/drivers/ksfilter/ks/swenum.c @@ -40,7 +40,7 @@ KspCreatePDO( CurDeviceId = InterlockedIncrement(&KsDeviceCount); /* generate new device id */ - swprintf(Buffer, L"\\Device\\KSENUM%08x", CurDeviceId); + _swprintf(Buffer, L"\\Device\\KSENUM%08x", CurDeviceId); /* initialize new device name */ RtlInitUnicodeString(&DeviceName, Buffer); @@ -702,7 +702,7 @@ KspDoReparseForIrp( } /* construct buffer */ - swprintf(Buffer, L"%s\\%s", DeviceEntry->PDODeviceName, DeviceEntry->Instance); + _swprintf(Buffer, L"%s\\%s", DeviceEntry->PDODeviceName, DeviceEntry->Instance); /* free old buffer*/ ExFreePoolWithTag(IoStack->FileObject->FileName.Buffer, 'mNoI'); diff --git a/drivers/parallel/parport/fdo.c b/drivers/parallel/parport/fdo.c index d5b41b87eec..ada1c1cfe50 100644 --- a/drivers/parallel/parport/fdo.c +++ b/drivers/parallel/parport/fdo.c @@ -30,9 +30,9 @@ AddDeviceInternal(IN PDRIVER_OBJECT DriverObject, ASSERT(Pdo); /* Create new device object */ - swprintf(DeviceNameBuffer, - L"\\Device\\ParallelPort%lu", - IoGetConfigurationInformation()->ParallelCount); + _swprintf(DeviceNameBuffer, + L"\\Device\\ParallelPort%lu", + IoGetConfigurationInformation()->ParallelCount); RtlInitUnicodeString(&DeviceName, DeviceNameBuffer); @@ -238,9 +238,9 @@ FdoCreateRawParallelPdo( FdoDeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; /* Create new device object */ - swprintf(DeviceNameBuffer, - L"\\Device\\Parallel%lu", - FdoDeviceExtension->PortNumber); + _swprintf(DeviceNameBuffer, + L"\\Device\\Parallel%lu", + FdoDeviceExtension->PortNumber); RtlInitUnicodeString(&DeviceName, DeviceNameBuffer); @@ -276,7 +276,7 @@ FdoCreateRawParallelPdo( /* Create link \DosDevices\LPTX -> \Device\ParallelY */ - swprintf(LinkNameBuffer, L"\\DosDevices\\LPT%lu", PdoDeviceExtension->LptPort); + _swprintf(LinkNameBuffer, L"\\DosDevices\\LPT%lu", PdoDeviceExtension->LptPort); RtlInitUnicodeString(&LinkName, LinkNameBuffer); Status = IoCreateSymbolicLink(&LinkName, &DeviceName); @@ -286,7 +286,7 @@ FdoCreateRawParallelPdo( goto done; } - swprintf(LptPortBuffer, L"LPT%lu", PdoDeviceExtension->LptPort); + _swprintf(LptPortBuffer, L"LPT%lu", PdoDeviceExtension->LptPort); RtlInitUnicodeString(&LptPort, LptPortBuffer); /* Write an entry value under HKLM\HARDWARE\DeviceMap\PARALLEL PORTS. */ diff --git a/drivers/processor/processr/pnp.c b/drivers/processor/processr/pnp.c index cb0fc452813..67729d88b3b 100644 --- a/drivers/processor/processr/pnp.c +++ b/drivers/processor/processr/pnp.c @@ -193,7 +193,7 @@ ProcessorSetFriendlyName( goto done; } - swprintf(KeyNameBuffer, L"%s\\%s\\%s", pszPrefix, DeviceId, InstanceId); + _swprintf(KeyNameBuffer, L"%s\\%s\\%s", pszPrefix, DeviceId, InstanceId); RtlInitUnicodeString(&EnumKeyName, KeyNameBuffer); InitializeObjectAttributes(&ObjectAttributes, diff --git a/drivers/sac/driver/concmd.c b/drivers/sac/driver/concmd.c index 8828849ac00..e1f370a9894 100644 --- a/drivers/sac/driver/concmd.c +++ b/drivers/sac/driver/concmd.c @@ -399,7 +399,7 @@ DoRebootCommand(IN BOOLEAN Reboot) /* We came back from a reboot, this doesn't make sense, tell the user */ SacPutSimpleMessage(Reboot ? SAC_RESTART_FAIL_PROMPT : SAC_SHUTDOWN_FAIL_PROMPT); - swprintf(GlobalBuffer, GetMessage(SAC_FAIL_PROMPT), Status); + _swprintf(GlobalBuffer, GetMessage(SAC_FAIL_PROMPT), Status); SacPutString(GlobalBuffer); SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC DoRebootCommand: Exiting.\n"); } @@ -628,7 +628,7 @@ DoTlistCommand(VOID) { /* Nope, print out a failure message */ SacPutSimpleMessage(68); - swprintf(GlobalBuffer, GetMessage(48), Status); + _swprintf(GlobalBuffer, GetMessage(48), Status); SacPutString(GlobalBuffer); } else diff --git a/drivers/sac/driver/conmgr.c b/drivers/sac/driver/conmgr.c index 681c1baec77..dbe892d344d 100644 --- a/drivers/sac/driver/conmgr.c +++ b/drivers/sac/driver/conmgr.c @@ -807,7 +807,7 @@ DoLineParsing: if (ChannelIBufferLength(CurrentChannel) == (SAC_VTUTF8_COL_WIDTH - 2)) { /* Delete the last character, replacing it with this one instead */ - swprintf(StringBuffer, L"\b%c", Char); + _swprintf(StringBuffer, L"\b%c", Char); SacPutString(StringBuffer); /* Omit the last two characters from the buffer */ @@ -821,7 +821,7 @@ DoLineParsing: } /* Nothing of interest happened, just write the character back */ - swprintf(StringBuffer, L"%c", Char); + _swprintf(StringBuffer, L"%c", Char); SacPutString(StringBuffer); } diff --git a/drivers/sac/driver/util.c b/drivers/sac/driver/util.c index 7f6e7956629..281adbb7123 100644 --- a/drivers/sac/driver/util.c +++ b/drivers/sac/driver/util.c @@ -628,51 +628,51 @@ TranslateMachineInformationXML(IN PWCHAR *Buffer, if (MachineInformation->MachineName) { - p += swprintf(p, - L"%s\r\n", - MachineInformation->MachineName); + p += _swprintf(p, + L"%s\r\n", + MachineInformation->MachineName); } if (MachineInformation->MachineGuid) { - p += swprintf(p, - L"%s\r\n", - MachineInformation->MachineGuid); + p += _swprintf(p, + L"%s\r\n", + MachineInformation->MachineGuid); } if (MachineInformation->ProcessorArchitecture) { - p += swprintf(p, - L"%s\r\n", - MachineInformation->ProcessorArchitecture); + p += _swprintf(p, + L"%s\r\n", + MachineInformation->ProcessorArchitecture); } if (MachineInformation->MajorVersion) { - p += swprintf(p, - L"%s\r\n", - MachineInformation->MajorVersion); + p += _swprintf(p, + L"%s\r\n", + MachineInformation->MajorVersion); } if (MachineInformation->BuildNumber) { - p += swprintf(p, - L"%s\r\n", - MachineInformation->BuildNumber); + p += _swprintf(p, + L"%s\r\n", + MachineInformation->BuildNumber); } if (MachineInformation->ProductType) { - p += swprintf(p, - L"%s\r\n", - MachineInformation->ProductType); + p += _swprintf(p, + L"%s\r\n", + MachineInformation->ProductType); } if (MachineInformation->ServicePack) { - p += swprintf(p, - L"%s\r\n", - MachineInformation->ServicePack); + p += _swprintf(p, + L"%s\r\n", + MachineInformation->ServicePack); } if (ExtraData) @@ -809,19 +809,19 @@ InitializeMachineInformation(VOID) } /* Build the string with the GUID in it, and save the ppointer to it */ - swprintf(GuidString, - L"%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", - SystemGuid.Data1, - SystemGuid.Data2, - SystemGuid.Data3, - SystemGuid.Data4[0], - SystemGuid.Data4[1], - SystemGuid.Data4[2], - SystemGuid.Data4[3], - SystemGuid.Data4[4], - SystemGuid.Data4[5], - SystemGuid.Data4[6], - SystemGuid.Data4[7]); + _swprintf(GuidString, + L"%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", + SystemGuid.Data1, + SystemGuid.Data2, + SystemGuid.Data3, + SystemGuid.Data4[0], + SystemGuid.Data4[1], + SystemGuid.Data4[2], + SystemGuid.Data4[3], + SystemGuid.Data4[4], + SystemGuid.Data4[5], + SystemGuid.Data4[6], + SystemGuid.Data4[7]); MachineInformation->MachineGuid = GuidString; } @@ -859,10 +859,10 @@ InitializeMachineInformation(VOID) } /* Build the buffer and set a pointer to it */ - swprintf(MajorVersion, - L"%d.%d", - VersionInformation.dwMajorVersion, - VersionInformation.dwMinorVersion); + _swprintf(MajorVersion, + L"%d.%d", + VersionInformation.dwMajorVersion, + VersionInformation.dwMinorVersion); MachineInformation->MajorVersion = MajorVersion; /* Now allocate a buffer for the OS build number */ @@ -874,7 +874,7 @@ InitializeMachineInformation(VOID) } /* Build the buffer and set a pointer to it */ - swprintf(BuildNumber, L"%d", VersionInformation.dwBuildNumber); + _swprintf(BuildNumber, L"%d", VersionInformation.dwBuildNumber); MachineInformation->BuildNumber = BuildNumber; /* Now check what kind of SKU this is */ @@ -931,10 +931,10 @@ InitializeMachineInformation(VOID) if (ServicePack) { /* Build the buffer and set a pointer to it */ - swprintf(ServicePack, - L"%d.%d", - VersionInformation.wServicePackMajor, - VersionInformation.wServicePackMinor); + _swprintf(ServicePack, + L"%d.%d", + VersionInformation.wServicePackMajor, + VersionInformation.wServicePackMinor); MachineInformation->ServicePack = ServicePack; /* We've collected all the machine info and are done! */ diff --git a/drivers/serial/serial/pnp.c b/drivers/serial/serial/pnp.c index a55e5376b59..870e70339c8 100644 --- a/drivers/serial/serial/pnp.c +++ b/drivers/serial/serial/pnp.c @@ -4,7 +4,7 @@ * FILE: drivers/dd/serial/pnp.c * PURPOSE: Serial IRP_MJ_PNP operations * - * PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.org) + * PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.org) */ /* FIXME: call IoAcquireRemoveLock/IoReleaseRemoveLock around each I/O operation */ @@ -34,7 +34,7 @@ SerialAddDeviceInternal( ASSERT(Pdo); /* Create new device object */ - swprintf(DeviceNameBuffer, L"\\Device\\Serial%lu", IoGetConfigurationInformation()->SerialCount); + _swprintf(DeviceNameBuffer, L"\\Device\\Serial%lu", IoGetConfigurationInformation()->SerialCount); RtlInitUnicodeString(&DeviceName, DeviceNameBuffer); Status = IoCreateDevice(DriverObject, sizeof(SERIAL_DEVICE_EXTENSION), @@ -265,9 +265,9 @@ SerialPnpStartDevice( } /* Create link \DosDevices\COMX -> \Device\SerialX */ - swprintf(DeviceNameBuffer, L"\\Device\\Serial%lu", DeviceExtension->SerialPortNumber); - swprintf(LinkNameBuffer, L"\\DosDevices\\COM%lu", DeviceExtension->ComPort); - swprintf(ComPortBuffer, L"COM%lu", DeviceExtension->ComPort); + _swprintf(DeviceNameBuffer, L"\\Device\\Serial%lu", DeviceExtension->SerialPortNumber); + _swprintf(LinkNameBuffer, L"\\DosDevices\\COM%lu", DeviceExtension->ComPort); + _swprintf(ComPortBuffer, L"COM%lu", DeviceExtension->ComPort); RtlInitUnicodeString(&DeviceName, DeviceNameBuffer); RtlInitUnicodeString(&LinkName, LinkNameBuffer); RtlInitUnicodeString(&ComPort, ComPortBuffer); diff --git a/drivers/storage/floppy/fdc/fdo.c b/drivers/storage/floppy/fdc/fdo.c index a42893dd2c5..16298c21140 100644 --- a/drivers/storage/floppy/fdc/fdo.c +++ b/drivers/storage/floppy/fdc/fdo.c @@ -226,8 +226,8 @@ PciCreateHardwareIDsString(PUNICODE_STRING HardwareIDs) ULONG Index; Index = 0; - Index += swprintf(&Buffer[Index], - L"FDC\\GENERIC_FLOPPY_DRIVE"); + Index += _swprintf(&Buffer[Index], + L"FDC\\GENERIC_FLOPPY_DRIVE"); Index++; Buffer[Index] = UNICODE_NULL; @@ -248,8 +248,8 @@ PciCreateCompatibleIDsString(PUNICODE_STRING CompatibleIDs) ULONG Index; Index = 0; - Index += swprintf(&Buffer[Index], - L"GenFloppyDisk"); + Index += _swprintf(&Buffer[Index], + L"GenFloppyDisk"); Index++; Buffer[Index] = UNICODE_NULL; @@ -268,7 +268,7 @@ PciCreateInstanceIDString(PUNICODE_STRING InstanceID, { WCHAR Buffer[3]; - swprintf(Buffer, L"%02X", PeripheralNumber & 0xff); + _swprintf(Buffer, L"%02X", PeripheralNumber & 0xff); return RtlCreateUnicodeString(InstanceID, Buffer) ? STATUS_SUCCESS : STATUS_INSUFFICIENT_RESOURCES; } @@ -328,7 +328,7 @@ FdcFdoQueryBusRelations( { do { - swprintf(DeviceNameBuffer, L"\\Device\\FloppyPDO%lu", DeviceNumber++); + _swprintf(DeviceNameBuffer, L"\\Device\\FloppyPDO%lu", DeviceNumber++); RtlInitUnicodeString(&DeviceName, DeviceNameBuffer); DPRINT("Device name: %S\n", DeviceNameBuffer); diff --git a/drivers/storage/floppy/floppy/floppy.c b/drivers/storage/floppy/floppy/floppy.c index 328de86e3b0..a65bf11c336 100644 --- a/drivers/storage/floppy/floppy/floppy.c +++ b/drivers/storage/floppy/floppy/floppy.c @@ -1030,7 +1030,7 @@ AddControllers(PDRIVER_OBJECT DriverObject) DriveNumber = (UCHAR)(i*4 + j); /* loss of precision is OK; there are only 16 of 'em */ - swprintf(gControllerInfo[i].DriveInfo[j].DeviceNameBuffer, L"\\Device\\Floppy%d", DriveNumber); + _swprintf(gControllerInfo[i].DriveInfo[j].DeviceNameBuffer, L"\\Device\\Floppy%d", DriveNumber); RtlInitUnicodeString(&DeviceName, gControllerInfo[i].DriveInfo[j].DeviceNameBuffer); if(IoCreateDevice(DriverObject, sizeof(PVOID), &DeviceName, @@ -1047,8 +1047,8 @@ AddControllers(PDRIVER_OBJECT DriverObject) gControllerInfo[i].DriveInfo[j].DeviceObject); /* 3b.5: Create an ARC path in case we're booting from this drive */ - swprintf(gControllerInfo[i].DriveInfo[j].ArcPathBuffer, - L"\\ArcName\\multi(%d)disk(%d)fdisk(%d)", gControllerInfo[i].BusNumber, i, DriveNumber); + _swprintf(gControllerInfo[i].DriveInfo[j].ArcPathBuffer, + L"\\ArcName\\multi(%d)disk(%d)fdisk(%d)", gControllerInfo[i].BusNumber, i, DriveNumber); RtlInitUnicodeString(&ArcPath, gControllerInfo[i].DriveInfo[j].ArcPathBuffer); IoAssignArcName(&ArcPath, &DeviceName); diff --git a/drivers/storage/floppy/floppy/floppy.h b/drivers/storage/floppy/floppy/floppy.h index a0c23130a99..86bc37494e4 100644 --- a/drivers/storage/floppy/floppy/floppy.h +++ b/drivers/storage/floppy/floppy/floppy.h @@ -32,7 +32,7 @@ #define MAX_CONTROLLERS 4 /* MS doesn't prototype this but the w2k kernel exports it */ -int _cdecl swprintf(const WCHAR *, ...); +int _cdecl _swprintf(const WCHAR *, ...); /* need ioctls in ddk build mode */ #include diff --git a/drivers/storage/partmgr/partition.c b/drivers/storage/partmgr/partition.c index 3551898389f..6c705135add 100644 --- a/drivers/storage/partmgr/partition.c +++ b/drivers/storage/partmgr/partition.c @@ -28,7 +28,7 @@ PartitionCreateDevice( UINT32 volumeNum; volumeNum = HarddiskVolumeNextId++; - swprintf(nameBuf, L"\\Device\\HarddiskVolume%lu", volumeNum); + _swprintf(nameBuf, L"\\Device\\HarddiskVolume%lu", volumeNum); RtlCreateUnicodeString(&deviceName, nameBuf); /* @@ -115,7 +115,7 @@ PartitionHandleStartDevice( PFDO_EXTENSION fdoExtension = PartExt->LowerDevice->DeviceExtension; // \\Device\\Harddisk%lu\\Partition%lu - swprintf(nameBuf, PartitionSymLinkFormat, + _swprintf(nameBuf, PartitionSymLinkFormat, fdoExtension->DiskData.DeviceNumber, PartExt->DetectedNumber); if (!RtlCreateUnicodeString(&partitionSymlink, nameBuf)) @@ -296,7 +296,7 @@ PartitionHandleRemove( UNICODE_STRING partitionSymlink; PFDO_EXTENSION fdoExtension = PartExt->LowerDevice->DeviceExtension; - swprintf(nameBuf, PartitionSymLinkFormat, + _swprintf(nameBuf, PartitionSymLinkFormat, fdoExtension->DiskData.DeviceNumber, PartExt->DetectedNumber); RtlInitUnicodeString(&partitionSymlink, nameBuf); @@ -441,28 +441,28 @@ PartitionHandleQueryId( if (fdoExtension->DiskData.PartitionStyle == PARTITION_STYLE_MBR) { - swprintf(string, L"S%08lx_O%I64x_L%I64x", - fdoExtension->DiskData.Mbr.Signature, - PartExt->StartingOffset, - PartExt->PartitionLength); + _swprintf(string, L"S%08lx_O%I64x_L%I64x", + fdoExtension->DiskData.Mbr.Signature, + PartExt->StartingOffset, + PartExt->PartitionLength); } else { - swprintf(string, - L"S%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02xS_O%I64x_L%I64x", - fdoExtension->DiskData.Gpt.DiskId.Data1, - fdoExtension->DiskData.Gpt.DiskId.Data2, - fdoExtension->DiskData.Gpt.DiskId.Data3, - fdoExtension->DiskData.Gpt.DiskId.Data4[0], - fdoExtension->DiskData.Gpt.DiskId.Data4[1], - fdoExtension->DiskData.Gpt.DiskId.Data4[2], - fdoExtension->DiskData.Gpt.DiskId.Data4[3], - fdoExtension->DiskData.Gpt.DiskId.Data4[4], - fdoExtension->DiskData.Gpt.DiskId.Data4[5], - fdoExtension->DiskData.Gpt.DiskId.Data4[6], - fdoExtension->DiskData.Gpt.DiskId.Data4[7], - PartExt->StartingOffset, - PartExt->PartitionLength); + _swprintf(string, + L"S%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02xS_O%I64x_L%I64x", + fdoExtension->DiskData.Gpt.DiskId.Data1, + fdoExtension->DiskData.Gpt.DiskId.Data2, + fdoExtension->DiskData.Gpt.DiskId.Data3, + fdoExtension->DiskData.Gpt.DiskId.Data4[0], + fdoExtension->DiskData.Gpt.DiskId.Data4[1], + fdoExtension->DiskData.Gpt.DiskId.Data4[2], + fdoExtension->DiskData.Gpt.DiskId.Data4[3], + fdoExtension->DiskData.Gpt.DiskId.Data4[4], + fdoExtension->DiskData.Gpt.DiskId.Data4[5], + fdoExtension->DiskData.Gpt.DiskId.Data4[6], + fdoExtension->DiskData.Gpt.DiskId.Data4[7], + PartExt->StartingOffset, + PartExt->PartitionLength); } PartMgrReleaseLayoutLock(fdoExtension); diff --git a/drivers/storage/port/scsiport/fdo.c b/drivers/storage/port/scsiport/fdo.c index 168c985c105..33f8413b6f9 100644 --- a/drivers/storage/port/scsiport/fdo.c +++ b/drivers/storage/port/scsiport/fdo.c @@ -525,7 +525,7 @@ FdoRemoveAdapter( WCHAR dosNameBuffer[12]; UNICODE_STRING dosDeviceName; - swprintf(dosNameBuffer, L"\\??\\Scsi%lu:", DeviceExtension->PortNumber); + _swprintf(dosNameBuffer, L"\\??\\Scsi%lu:", DeviceExtension->PortNumber); RtlInitUnicodeString(&dosDeviceName, dosNameBuffer); IoDeleteSymbolicLink(&dosDeviceName); // don't check the result @@ -617,7 +617,7 @@ FdoStartAdapter( IoStartTimer(PortExtension->Common.DeviceObject); // Create the dos device link - swprintf(dosNameBuffer, L"\\??\\Scsi%u:", PortExtension->PortNumber); + _swprintf(dosNameBuffer, L"\\??\\Scsi%u:", PortExtension->PortNumber); RtlInitUnicodeString(&dosDeviceName, dosNameBuffer); status = IoCreateSymbolicLink(&dosDeviceName, &PortExtension->DeviceName); if (!NT_SUCCESS(status)) diff --git a/drivers/storage/port/scsiport/pdo.c b/drivers/storage/port/scsiport/pdo.c index 3f2bd697309..f2c904d0522 100644 --- a/drivers/storage/port/scsiport/pdo.c +++ b/drivers/storage/port/scsiport/pdo.c @@ -500,7 +500,7 @@ PdoHandleQueryInstanceId( LPWSTR InstanceId; // use instance count and LUN - swprintf(Buffer, L"%x%x%x", lunExt->PathId, lunExt->TargetId, lunExt->Lun); + _swprintf(Buffer, L"%x%x%x", lunExt->PathId, lunExt->TargetId, lunExt->Lun); Length = wcslen(Buffer) + 1; diff --git a/drivers/storage/port/scsiport/registry.c b/drivers/storage/port/scsiport/registry.c index 24b197a81ef..89e34a717f8 100644 --- a/drivers/storage/port/scsiport/registry.c +++ b/drivers/storage/port/scsiport/registry.c @@ -171,9 +171,9 @@ RegistryInitAdapterKey( /* Create new 'Scsi Port X' subkey */ DPRINT("Scsi Port %lu\n", DeviceExtension->PortNumber); - swprintf(NameBuffer, - L"Scsi Port %lu", - DeviceExtension->PortNumber); + _swprintf(NameBuffer, + L"Scsi Port %lu", + DeviceExtension->PortNumber); RtlInitUnicodeString(&KeyName, NameBuffer); InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_KERNEL_HANDLE, ScsiKey, NULL); Status = ZwCreateKey(&ScsiPortKey, @@ -284,9 +284,9 @@ RegistryInitAdapterKey( { /* Create 'Scsi Bus X' key */ DPRINT(" Scsi Bus %lu\n", BusNumber); - swprintf(NameBuffer, - L"Scsi Bus %lu", - BusNumber); + _swprintf(NameBuffer, + L"Scsi Bus %lu", + BusNumber); RtlInitUnicodeString(&KeyName, NameBuffer); InitializeObjectAttributes(&ObjectAttributes, &KeyName, @@ -309,9 +309,9 @@ RegistryInitAdapterKey( /* Create 'Initiator Id X' key */ DPRINT(" Initiator Id %lu\n", DeviceExtension->PortConfig->InitiatorBusId[BusNumber]); - swprintf(NameBuffer, - L"Initiator Id %lu", - (ULONG)(UCHAR)DeviceExtension->PortConfig->InitiatorBusId[BusNumber]); + _swprintf(NameBuffer, + L"Initiator Id %lu", + (ULONG)(UCHAR)DeviceExtension->PortConfig->InitiatorBusId[BusNumber]); RtlInitUnicodeString(&KeyName, NameBuffer); InitializeObjectAttributes(&ObjectAttributes, &KeyName, @@ -371,7 +371,7 @@ RegistryInitLunKey( HANDLE busKey = portExt->Buses[LunExtension->PathId].RegistryMapKey; // create/open 'Target Id X' key - swprintf(nameBuffer, L"Target Id %lu", LunExtension->TargetId); + _swprintf(nameBuffer, L"Target Id %lu", LunExtension->TargetId); RtlInitUnicodeString(&keyName, nameBuffer); InitializeObjectAttributes(&objectAttributes, &keyName, OBJ_KERNEL_HANDLE, busKey, NULL); status = ZwCreateKey(&targetKey, @@ -388,7 +388,7 @@ RegistryInitLunKey( } // Create 'Logical Unit Id X' key - swprintf(nameBuffer, L"Logical Unit Id %lu", LunExtension->Lun); + _swprintf(nameBuffer, L"Logical Unit Id %lu", LunExtension->Lun); RtlInitUnicodeString(&keyName, nameBuffer); InitializeObjectAttributes(&objectAttributes, &keyName, OBJ_KERNEL_HANDLE, targetKey, NULL); status = ZwCreateKey(&LunExtension->RegistryMapKey, @@ -405,11 +405,11 @@ RegistryInitLunKey( } // Set 'Identifier' (REG_SZ) value - swprintf(nameBuffer, - L"%.8S%.16S%.4S", - LunExtension->InquiryData.VendorId, - LunExtension->InquiryData.ProductId, - LunExtension->InquiryData.ProductRevisionLevel); + _swprintf(nameBuffer, + L"%.8S%.16S%.4S", + LunExtension->InquiryData.VendorId, + LunExtension->InquiryData.ProductId, + LunExtension->InquiryData.ProductRevisionLevel); RtlInitUnicodeString(&valueName, L"Identifier"); status = ZwSetValueKey(LunExtension->RegistryMapKey, &valueName, diff --git a/drivers/storage/port/scsiport/scsiport.c b/drivers/storage/port/scsiport/scsiport.c index 64a6d58ae13..3ba0ce9d369 100644 --- a/drivers/storage/port/scsiport/scsiport.c +++ b/drivers/storage/port/scsiport/scsiport.c @@ -951,9 +951,9 @@ ScsiPortInitialize( { WCHAR NameBuffer[27]; /* Create a unicode device name */ - swprintf(NameBuffer, - L"\\Device\\ScsiPort%lu", - SystemConfig->ScsiPortCount); + _swprintf(NameBuffer, + L"\\Device\\ScsiPort%lu", + SystemConfig->ScsiPortCount); if (!RtlCreateUnicodeString(&DeviceName, NameBuffer)) { DPRINT1("Failed to allocate memory for device name!\n"); @@ -2451,7 +2451,7 @@ TryNextAd: if (NT_SUCCESS(Status)) { /* Create name for it */ - swprintf(StrBuffer, L"ScsiAdapter\\%lu", + _swprintf(StrBuffer, L"ScsiAdapter\\%lu", InternalConfigInfo->AdapterNumber); RtlInitUnicodeString(&UnicodeString, StrBuffer); @@ -2514,7 +2514,7 @@ TryNextAd: if (InternalConfigInfo->ServiceKey != NULL) { - swprintf(DeviceBuffer, L"Device%lu", InternalConfigInfo->AdapterNumber); + _swprintf(DeviceBuffer, L"Device%lu", InternalConfigInfo->AdapterNumber); RtlInitUnicodeString(&UnicodeString, DeviceBuffer); /* Open the service key */ diff --git a/drivers/storage/port/storport/storport.c b/drivers/storage/port/storport/storport.c index 02aa88a015e..1b80055f7b1 100644 --- a/drivers/storage/port/storport/storport.c +++ b/drivers/storage/port/storport/storport.c @@ -184,9 +184,9 @@ PortAddDevice( ASSERT(DriverObject); ASSERT(PhysicalDeviceObject); - swprintf(NameBuffer, - L"\\Device\\RaidPort%lu", - PortNumber); + _swprintf(NameBuffer, + L"\\Device\\RaidPort%lu", + PortNumber); RtlInitUnicodeString(&DeviceName, NameBuffer); PortNumber++; diff --git a/drivers/usb/usbccgp/function.c b/drivers/usb/usbccgp/function.c index a738edb052c..dfcd1c85567 100644 --- a/drivers/usb/usbccgp/function.c +++ b/drivers/usb/usbccgp/function.c @@ -385,13 +385,17 @@ USBCCGP_InitFunctionDescriptor( // // now init hardware id // - Index = swprintf(Buffer, L"USB\\VID_%04x&PID_%04x&Rev_%04x&MI_%02x", FDODeviceExtension->DeviceDescriptor->idVendor, - FDODeviceExtension->DeviceDescriptor->idProduct, - FDODeviceExtension->DeviceDescriptor->bcdDevice, - Descriptor->bFirstInterface) + 1; - Index += swprintf(&Buffer[Index], L"USB\\VID_%04x&PID_%04x&MI_%02x", FDODeviceExtension->DeviceDescriptor->idVendor, - FDODeviceExtension->DeviceDescriptor->idProduct, - Descriptor->bFirstInterface) + 1; + Index = _swprintf(Buffer, + L"USB\\VID_%04x&PID_%04x&Rev_%04x&MI_%02x", + FDODeviceExtension->DeviceDescriptor->idVendor, + FDODeviceExtension->DeviceDescriptor->idProduct, + FDODeviceExtension->DeviceDescriptor->bcdDevice, + Descriptor->bFirstInterface) + 1; + Index += _swprintf(&Buffer[Index], + L"USB\\VID_%04x&PID_%04x&MI_%02x", + FDODeviceExtension->DeviceDescriptor->idVendor, + FDODeviceExtension->DeviceDescriptor->idProduct, + Descriptor->bFirstInterface) + 1; // allocate result buffer DescriptionBuffer = AllocateItem(NonPagedPool, (Index + 1) * sizeof(WCHAR)); @@ -412,9 +416,18 @@ USBCCGP_InitFunctionDescriptor( // // now init the compatible id // - Index = swprintf(Buffer, L"USB\\Class_%02x&SubClass_%02x&Prot_%02x", Descriptor->bFunctionClass, Descriptor->bFunctionSubClass, Descriptor->bFunctionProtocol) + 1; - Index += swprintf(&Buffer[Index], L"USB\\Class_%02x&SubClass_%02x", Descriptor->bFunctionClass, Descriptor->bFunctionSubClass) + 1; - Index += swprintf(&Buffer[Index], L"USB\\Class_%02x", Descriptor->bFunctionClass) + 1; + Index = _swprintf(Buffer, + L"USB\\Class_%02x&SubClass_%02x&Prot_%02x", + Descriptor->bFunctionClass, + Descriptor->bFunctionSubClass, + Descriptor->bFunctionProtocol) + 1; + Index += _swprintf(&Buffer[Index], + L"USB\\Class_%02x&SubClass_%02x", + Descriptor->bFunctionClass, + Descriptor->bFunctionSubClass) + 1; + Index += _swprintf(&Buffer[Index], + L"USB\\Class_%02x", + Descriptor->bFunctionClass) + 1; // allocate result buffer DescriptionBuffer = AllocateItem(NonPagedPool, (Index + 1) * sizeof(WCHAR)); @@ -549,13 +562,17 @@ USBCCG_InitIdsWithInterfaceDescriptor( // // now init hardware id // - Index = swprintf(Buffer, L"USB\\VID_%04x&PID_%04x&Rev_%04x&MI_%02x", FDODeviceExtension->DeviceDescriptor->idVendor, - FDODeviceExtension->DeviceDescriptor->idProduct, - FDODeviceExtension->DeviceDescriptor->bcdDevice, - FunctionIndex) + 1; - Index += swprintf(&Buffer[Index], L"USB\\VID_%04x&PID_%04x&MI_%02x", FDODeviceExtension->DeviceDescriptor->idVendor, - FDODeviceExtension->DeviceDescriptor->idProduct, - FunctionIndex) + 1; + Index = _swprintf(Buffer, + L"USB\\VID_%04x&PID_%04x&Rev_%04x&MI_%02x", + FDODeviceExtension->DeviceDescriptor->idVendor, + FDODeviceExtension->DeviceDescriptor->idProduct, + FDODeviceExtension->DeviceDescriptor->bcdDevice, + FunctionIndex) + 1; + Index += _swprintf(&Buffer[Index], + L"USB\\VID_%04x&PID_%04x&MI_%02x", + FDODeviceExtension->DeviceDescriptor->idVendor, + FDODeviceExtension->DeviceDescriptor->idProduct, + FunctionIndex) + 1; // allocate result buffer DescriptionBuffer = AllocateItem(NonPagedPool, (Index + 1) * sizeof(WCHAR)); @@ -576,9 +593,18 @@ USBCCG_InitIdsWithInterfaceDescriptor( // // now init the compatible id // - Index = swprintf(Buffer, L"USB\\Class_%02x&SubClass_%02x&Prot_%02x", Descriptor->bInterfaceClass, Descriptor->bInterfaceSubClass, Descriptor->bInterfaceProtocol) + 1; - Index += swprintf(&Buffer[Index], L"USB\\Class_%02x&SubClass_%02x", Descriptor->bInterfaceClass, Descriptor->bInterfaceSubClass) + 1; - Index += swprintf(&Buffer[Index], L"USB\\Class_%02x", Descriptor->bInterfaceClass) + 1; + Index = _swprintf(Buffer, + L"USB\\Class_%02x&SubClass_%02x&Prot_%02x", + Descriptor->bInterfaceClass, + Descriptor->bInterfaceSubClass, + Descriptor->bInterfaceProtocol) + 1; + Index += _swprintf(&Buffer[Index], + L"USB\\Class_%02x&SubClass_%02x", + Descriptor->bInterfaceClass, + Descriptor->bInterfaceSubClass) + 1; + Index += _swprintf(&Buffer[Index], + L"USB\\Class_%02x", + Descriptor->bInterfaceClass) + 1; // allocate result buffer DescriptionBuffer = AllocateItem(NonPagedPool, (Index + 1) * sizeof(WCHAR)); diff --git a/drivers/usb/usbccgp/pdo.c b/drivers/usb/usbccgp/pdo.c index 514c441f74a..32ad47d1816 100644 --- a/drivers/usb/usbccgp/pdo.c +++ b/drivers/usb/usbccgp/pdo.c @@ -186,7 +186,7 @@ USBCCGP_PdoAppendInterfaceNumber( while (*DeviceId) { - StringLength = swprintf(String, L"%s&MI_%02x", DeviceId, InterfaceNumber) + 1; + StringLength = _swprintf(String, L"%s&MI_%02x", DeviceId, InterfaceNumber) + 1; Length = wcslen(DeviceId) + 1; DPRINT("String %p\n", String); @@ -252,7 +252,7 @@ USBCCGP_PdoHandleQueryId( // append interface number // ASSERT(Irp->IoStatus.Information); - swprintf(Buffer, L"%s&MI_%02x", (LPWSTR)Irp->IoStatus.Information, PDODeviceExtension->FunctionDescriptor->FunctionNumber); + _swprintf(Buffer, L"%s&MI_%02x", (LPWSTR)Irp->IoStatus.Information, PDODeviceExtension->FunctionDescriptor->FunctionNumber); DPRINT("BusQueryDeviceID %S\n", Buffer); ExFreePool((PVOID)Irp->IoStatus.Information); @@ -292,7 +292,7 @@ USBCCGP_PdoHandleQueryId( // // use function number // - swprintf(Buffer, L"%04x", PDODeviceExtension->FunctionDescriptor->FunctionNumber); + _swprintf(Buffer, L"%04x", PDODeviceExtension->FunctionDescriptor->FunctionNumber); Irp->IoStatus.Information = (ULONG_PTR)Buffer; return STATUS_SUCCESS; } diff --git a/drivers/usb/usbstor_new/pdo.c b/drivers/usb/usbstor_new/pdo.c index 6ce5d8f7460..509bb858e8c 100644 --- a/drivers/usb/usbstor_new/pdo.c +++ b/drivers/usb/usbstor_new/pdo.c @@ -674,14 +674,14 @@ USBSTOR_PdoHandleQueryInstanceId( // // using serial number from device // - swprintf(Buffer, L"%s&%c", FDODeviceExtension->SerialNumber->bString, PDODeviceExtension->LUN); + _swprintf(Buffer, L"%s&%c", FDODeviceExtension->SerialNumber->bString, PDODeviceExtension->LUN); } else { // // use instance count and LUN // - swprintf(Buffer, L"%04lu&%c", FDODeviceExtension->InstanceCount, PDODeviceExtension->LUN); + _swprintf(Buffer, L"%04lu&%c", FDODeviceExtension->InstanceCount, PDODeviceExtension->LUN); } // diff --git a/drivers/wdm/audio/backpln/portcls/miniport_dmus.cpp b/drivers/wdm/audio/backpln/portcls/miniport_dmus.cpp index 70cee8d66b3..fb1178b55fb 100644 --- a/drivers/wdm/audio/backpln/portcls/miniport_dmus.cpp +++ b/drivers/wdm/audio/backpln/portcls/miniport_dmus.cpp @@ -2523,7 +2523,7 @@ PropertyHandler_Synth aMiniport = (CMiniportDMusUART *)(PMINIPORTDMUS)(pRequest->MajorTarget); WCHAR wszDesc2[16]; int cLen; - cLen = swprintf(wszDesc2,L"[%03x]\0",PtrToUlong(aMiniport->m_pPortBase)); + cLen = _swprintf(wszDesc2,L"[%03x]\0",PtrToUlong(aMiniport->m_pPortBase)); cLen *= sizeof(WCHAR); RtlCopyMemory((WCHAR *)((DWORD_PTR)(caps->Description) + increment), diff --git a/drivers/wdm/audio/backpln/portcls/undoc.cpp b/drivers/wdm/audio/backpln/portcls/undoc.cpp index 6bd1a1bb23b..4076a1c47e5 100644 --- a/drivers/wdm/audio/backpln/portcls/undoc.cpp +++ b/drivers/wdm/audio/backpln/portcls/undoc.cpp @@ -651,7 +651,7 @@ DumpFilterDescriptor( for(Index = 0; Index < FilterDescription->PinCount; Index++) { // print prefix - swprintf(Buffer, L"PinIndex %lu", Index); + _swprintf(Buffer, L"PinIndex %lu", Index); // dump automation table DumpAutomationTable((PPCAUTOMATION_TABLE)PinDescriptor->AutomationTable, Buffer, L" "); @@ -679,7 +679,7 @@ DumpFilterDescriptor( for(Index = 0; Index < FilterDescription->NodeCount; Index++) { // print prefix - swprintf(Buffer, L"NodeIndex %lu", Index); + _swprintf(Buffer, L"NodeIndex %lu", Index); // dump automation table DumpAutomationTable((PPCAUTOMATION_TABLE)NodeDescriptor->AutomationTable, Buffer, L" "); diff --git a/drivers/wdm/audio/legacy/wdmaud/sup.c b/drivers/wdm/audio/legacy/wdmaud/sup.c index 496eabf56e2..281a437fa64 100644 --- a/drivers/wdm/audio/legacy/wdmaud/sup.c +++ b/drivers/wdm/audio/legacy/wdmaud/sup.c @@ -307,7 +307,7 @@ FindProductName( for(Index = 0; Index < KeyInformation->SubKeys; Index++) { /* subkeys are always in the format 0000-XXXX */ - swprintf(SubKey, L"%04u", Index); + _swprintf(SubKey, L"%04u", Index); /* initialize subkey name */ RtlInitUnicodeString(&SubKeyName, SubKey); diff --git a/hal/halx86/legacy/bussupp.c b/hal/halx86/legacy/bussupp.c index 5bff8f7efc6..091f13de5c0 100644 --- a/hal/halx86/legacy/bussupp.c +++ b/hal/halx86/legacy/bussupp.c @@ -455,7 +455,7 @@ HalpGetChipHacks(IN USHORT VendorId, if (!NT_SUCCESS(Status)) return Status; /* Query value */ - swprintf(Buffer, L"%04X%04X", VendorId, DeviceId); + _swprintf(Buffer, L"%04X%04X", VendorId, DeviceId); RtlInitUnicodeString(&ValueName, Buffer); Status = ZwQueryValueKey(KeyHandle, &ValueName, diff --git a/modules/rosapps/applications/cmdutils/arping/arping.c b/modules/rosapps/applications/cmdutils/arping/arping.c index 8836f523520..95064d8e122 100644 --- a/modules/rosapps/applications/cmdutils/arping/arping.c +++ b/modules/rosapps/applications/cmdutils/arping/arping.c @@ -253,10 +253,12 @@ static BOOL Setup(VOID) } Target.S_un.S_addr = TargetAddr; - swprintf(TargetIP, L"%d.%d.%d.%d", Target.S_un.S_un_b.s_b1, - Target.S_un.S_un_b.s_b2, - Target.S_un.S_un_b.s_b3, - Target.S_un.S_un_b.s_b4); + _swprintf(TargetIP, + L"%d.%d.%d.%d", + Target.S_un.S_un_b.s_b1, + Target.S_un.S_un_b.s_b2, + Target.S_un.S_un_b.s_b3, + Target.S_un.S_un_b.s_b4); if (!WideCharToMultiByte(CP_ACP, 0, SourceName, -1, aTargetName, sizeof(aTargetName), NULL, NULL)) @@ -356,9 +358,11 @@ static BOOL Ping(VOID) TimeToMsString(Time, sizeof(Time) / sizeof(WCHAR), RelativeTime); } - swprintf(StrHwAddr, L"%02x:%02x:%02x:%02x:%02x:%02x", TargetHW[0], TargetHW[1], - TargetHW[2], TargetHW[3], - TargetHW[4], TargetHW[5]); + _swprintf(StrHwAddr, + L"%02x:%02x:%02x:%02x:%02x:%02x", + TargetHW[0], TargetHW[1], + TargetHW[2], TargetHW[3], + TargetHW[4], TargetHW[5]); FormatOutput(IDS_REPLY_FROM, TargetIP, StrHwAddr, Sign, Time); Received++; diff --git a/modules/rosapps/applications/sysutils/systeminfo/systeminfo.c b/modules/rosapps/applications/sysutils/systeminfo/systeminfo.c index 8cfe92b1fd7..c2876c9ce69 100644 --- a/modules/rosapps/applications/sysutils/systeminfo/systeminfo.c +++ b/modules/rosapps/applications/sysutils/systeminfo/systeminfo.c @@ -171,7 +171,7 @@ FormatDateTime(time_t Time, PWSTR pBuf) --i; /* don't count NULL character */ /* Copy time now */ - i += swprintf(pBuf + i, L", "); + i += _swprintf(pBuf + i, L", "); GetTimeFormatW(LOCALE_SYSTEM_DEFAULT, 0, &SysTime, NULL, pBuf + i, BUFFER_SIZE - i); } @@ -351,7 +351,7 @@ AllSysInfo(VOID) cSeconds = GetSeconds(); if (!LoadStringW(NULL, IDS_UP_TIME_FORMAT, Tmp, _countof(Tmp))) Tmp[0] = L'\0'; - swprintf(Buf, Tmp, cSeconds / (60*60*24), (cSeconds / (60*60)) % 24, (cSeconds / 60) % 60, cSeconds % 60); + _swprintf(Buf, Tmp, cSeconds / (60*60*24), (cSeconds / (60*60)) % 24, (cSeconds / 60) % 60, cSeconds % 60); PrintRow(IDS_UP_TIME, FALSE, L"%s", Buf); /* Prepare SMBIOS data */ @@ -360,7 +360,7 @@ AllSysInfo(VOID) /* Getting System Manufacturer; * HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation\Manufacturer * for Win >= 6.0 */ - swprintf(Tmp, L"%s\\oeminfo.ini", szSystemDir); + _swprintf(Tmp, L"%s\\oeminfo.ini", szSystemDir); GetPrivateProfileStringW(L"General", L"Manufacturer", L"", @@ -409,12 +409,12 @@ AllSysInfo(VOID) /* Getting Processor(s) */ if (!LoadStringW(NULL, IDS_PROCESSORS_FORMAT, Tmp, _countof(Tmp))) Tmp[0] = L'\0'; - swprintf(Buf, Tmp, (UINT)SysInfo.dwNumberOfProcessors); + _swprintf(Buf, Tmp, (UINT)SysInfo.dwNumberOfProcessors); PrintRow(IDS_PROCESSORS, FALSE, L"%s", Buf); for (i = 0; i < (UINT)SysInfo.dwNumberOfProcessors; i++) { - swprintf(Tmp, L"HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\%u", i); - j = swprintf(Buf, L"[%02u]: ", i + 1); + _swprintf(Tmp, L"HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\%u", i); + j = _swprintf(Buf, L"[%02u]: ", i + 1); j += RegGetSZ(HKEY_LOCAL_MACHINE, Tmp, L"Identifier", Buf + j, _countof(Buf) - j); if (j + 1 < _countof(Buf)) @@ -626,7 +626,7 @@ AllSysInfo(VOID) /* Print adapters count */ if (!LoadStringW(NULL, IDS_NETWORK_CARDS_FORMAT, Tmp, _countof(Tmp))) Tmp[0] = L'\0'; - swprintf(Buf, Tmp, cAdapters); + _swprintf(Buf, Tmp, cAdapters); PrintRow(IDS_NETWORK_CARDS, FALSE, L"%s", Buf); /* Show information about each adapter */ diff --git a/modules/rosapps/applications/sysutils/utils/partinfo/partinfo.c b/modules/rosapps/applications/sysutils/utils/partinfo/partinfo.c index 704affad409..765df1184aa 100644 --- a/modules/rosapps/applications/sysutils/utils/partinfo/partinfo.c +++ b/modules/rosapps/applications/sysutils/utils/partinfo/partinfo.c @@ -178,7 +178,7 @@ int main(int argc, char *argv[]) } /* Build the full drive name */ - swprintf(DriveName, L"\\\\.\\PHYSICALDRIVE%lu", ulDrive); + _swprintf(DriveName, L"\\\\.\\PHYSICALDRIVE%lu", ulDrive); /* Open the drive */ hDisk = CreateFileW(DriveName, diff --git a/modules/rosapps/applications/vcdcontroltool/vcdcontroltool.c b/modules/rosapps/applications/vcdcontroltool/vcdcontroltool.c index b2245c6cde9..1e068b72e60 100644 --- a/modules/rosapps/applications/vcdcontroltool/vcdcontroltool.c +++ b/modules/rosapps/applications/vcdcontroltool/vcdcontroltool.c @@ -148,7 +148,7 @@ RefreshDevicesList(WCHAR Letter) LoadString(hInstance, IDS_NOMOUNTED, szFormat, sizeof(szFormat) / sizeof(WCHAR)); szFormat[(sizeof(szFormat) / sizeof(WCHAR)) - 1] = L'\0'; - swprintf(szText, szFormat, szImage); + _swprintf(szText, szFormat, szImage); lvItem.pszText = szText; } else diff --git a/modules/rostests/apitests/apphelp/db.cpp b/modules/rostests/apitests/apphelp/db.cpp index c192264cdce..a55700ed8f6 100644 --- a/modules/rostests/apitests/apphelp/db.cpp +++ b/modules/rostests/apitests/apphelp/db.cpp @@ -1219,9 +1219,9 @@ static void test_mode_generic(const WCHAR* workdir, HSDB hsdb, size_t cur) memset(&query, 0xab, sizeof(query)); - swprintf(exename, L"%s\\%s", workdir, test_exedata[cur].name); + _swprintf(exename, L"%s\\%s", workdir, test_exedata[cur].name); if (test_exedata[cur].extra_file) - swprintf(testfile, L"%s\\%s", workdir, test_exedata[cur].extra_file); + _swprintf(testfile, L"%s\\%s", workdir, test_exedata[cur].extra_file); test_create_exe(exename, 0); if (test_exedata[cur].extra_file) @@ -1403,7 +1403,7 @@ static void test_MatchApplications(void) ok(ret, "CreateDirectoryW error: %d\n", GetLastError()); /* SdbInitDatabase needs an nt-path */ - swprintf(dbpath, L"\\??\\%s\\test.sdb", workdir); + _swprintf(dbpath, L"\\??\\%s\\test.sdb", workdir); test_create_db(dbpath + 4, g_WinVersion >= WINVER_WIN10); @@ -1506,7 +1506,7 @@ static void test_match_ex(const WCHAR* workdir, HSDB hsdb) if (!TestName) continue; - swprintf(exename, L"%s\\%s", workdir, AppName); + _swprintf(exename, L"%s\\%s", workdir, AppName); test_create_exe(exename, 0); ret = pSdbGetMatchingExe(hsdb, exename, NULL, NULL, 0, (SDBQUERYRESULT_VISTA*)&query); @@ -1551,7 +1551,7 @@ static void test_MatchApplicationsEx(void) ok(ret, "CreateDirectoryW error: %d\n", GetLastError()); /* SdbInitDatabase needs an nt-path */ - swprintf(dbpath, L"\\??\\%s\\test.sdb", workdir); + _swprintf(dbpath, L"\\??\\%s\\test.sdb", workdir); if (extract_resource(dbpath + 4, MAKEINTRESOURCEW(101))) { @@ -1596,7 +1596,7 @@ static void test_TagRef(void) ok(ret, "GetTempPathA error: %d\n", GetLastError()); /* SdbInitDatabase needs an nt-path */ - swprintf(dbpath, L"\\??\\%stest.sdb", tmpdir); + _swprintf(dbpath, L"\\??\\%stest.sdb", tmpdir); test_create_db(dbpath + 4, g_WinVersion >= WINVER_WIN10); @@ -1916,7 +1916,7 @@ static void test_Data(void) ok(ret, "CreateDirectoryW error: %d\n", GetLastError()); /* SdbInitDatabase needs an nt-path */ - swprintf(dbpath, L"\\??\\%s\\test.sdb", workdir); + _swprintf(dbpath, L"\\??\\%s\\test.sdb", workdir); if (extract_resource(dbpath + 4, MAKEINTRESOURCEW(101))) { diff --git a/modules/rostests/apitests/kernel32/GetFinalPathNameByHandle.c b/modules/rostests/apitests/kernel32/GetFinalPathNameByHandle.c index 9d0f5135615..83436bc7d7c 100644 --- a/modules/rostests/apitests/kernel32/GetFinalPathNameByHandle.c +++ b/modules/rostests/apitests/kernel32/GetFinalPathNameByHandle.c @@ -262,7 +262,7 @@ static void Test_NetworkShare(void) return; } - swprintf(RemotePathBuffer, L"\\\\localhost\\%s\\%s", ShareName, FileName); + _swprintf(RemotePathBuffer, L"\\\\localhost\\%s\\%s", ShareName, FileName); hFile = CreateFileW(RemotePathBuffer, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, @@ -282,7 +282,7 @@ static void Test_NetworkShare(void) /* Expected string for VOLUME_NAME_DOS: L"\\\\?\\UNC\\localhost\\TestShare\\kernel32_apitest.exe" */ - swprintf(ExpectedString, L"\\\\?\\UNC\\localhost\\%s\\%s", ShareName, FileName); + _swprintf(ExpectedString, L"\\\\?\\UNC\\localhost\\%s\\%s", ShareName, FileName); ExpectedStringLength = wcslen(ExpectedString); SetLastError(0xdeadbeef); memset(Buffer, 0xCC, sizeof(Buffer)); @@ -315,7 +315,7 @@ static void Test_NetworkShare(void) /* Expected string for VOLUME_NAME_NT (2): L"\\Device\\Mup\\localhost\\TestShare\\kernel32_apitest.exe" */ - swprintf(ExpectedString, L"\\Device\\Mup\\localhost\\%s\\%s", ShareName, FileName); + _swprintf(ExpectedString, L"\\Device\\Mup\\localhost\\%s\\%s", ShareName, FileName); ExpectedStringLength = wcslen(ExpectedString); SetLastError(0xdeadbeef); memset(Buffer, 0xCC, sizeof(Buffer)); @@ -333,7 +333,7 @@ static void Test_NetworkShare(void) /* Expected string for VOLUME_NAME_NONE: L"\\localhost\\TestShare\\kernel32_apitest.exe" */ - swprintf(ExpectedString, L"\\localhost\\%s\\%s", ShareName, FileName); + _swprintf(ExpectedString, L"\\localhost\\%s\\%s", ShareName, FileName); ExpectedStringLength = wcslen(ExpectedString); SetLastError(0xdeadbeef); memset(Buffer, 0xCC, sizeof(Buffer)); diff --git a/modules/rostests/apitests/kernel32/GetModuleFileName.c b/modules/rostests/apitests/kernel32/GetModuleFileName.c index ba1572c9209..e3ecd9268a1 100644 --- a/modules/rostests/apitests/kernel32/GetModuleFileName.c +++ b/modules/rostests/apitests/kernel32/GetModuleFileName.c @@ -53,7 +53,7 @@ StartChild(char **argv) trace("Starting '%ls', which is already relative\n", FileName); } - swprintf(CommandLine, L"\"%ls\" GetModuleFileName relative", FileName); + _swprintf(CommandLine, L"\"%ls\" GetModuleFileName relative", FileName); RtlZeroMemory(&StartupInfo, sizeof(StartupInfo)); StartupInfo.cb = sizeof(StartupInfo); diff --git a/modules/rostests/apitests/ntdll/NtDeleteKey.c b/modules/rostests/apitests/ntdll/NtDeleteKey.c index 57774a74457..d90d6d3a3fd 100644 --- a/modules/rostests/apitests/ntdll/NtDeleteKey.c +++ b/modules/rostests/apitests/ntdll/NtDeleteKey.c @@ -94,11 +94,11 @@ START_TEST(NtDeleteKey) Status = CreateRegistryKeyHandle(&ParentKey, KEY_READ | DELETE, L"\\Registry\\Machine\\Software\\RosTests"); for (i = 0; i <= 9999; i++) { - swprintf(Buffer, L"\\Registry\\Machine\\Software\\RosTests\\Child%04d", i); + _swprintf(Buffer, L"\\Registry\\Machine\\Software\\RosTests\\Child%04d", i); Status = CreateRegistryKeyHandle(&ChildKey, KEY_READ, Buffer); NtClose(ChildKey); - swprintf(Buffer, L"\\Registry\\Machine\\Software\\RosTests\\Child%04d\\Pet", i); + _swprintf(Buffer, L"\\Registry\\Machine\\Software\\RosTests\\Child%04d\\Pet", i); Status = CreateRegistryKeyHandle(&PetKey, KEY_READ, Buffer); NtClose(PetKey); } @@ -120,12 +120,12 @@ START_TEST(NtDeleteKey) /* Test mass key deletion */ for (i = 0; i <= 9999; i++) { if (i != 5000) { - swprintf(Buffer, L"\\Registry\\Machine\\Software\\RosTests\\Child%04d\\Pet", i); + _swprintf(Buffer, L"\\Registry\\Machine\\Software\\RosTests\\Child%04d\\Pet", i); CreateRegistryKeyHandle(&PetKey, DELETE, Buffer); Status = NtDeleteKey(PetKey); NtClose(PetKey); - swprintf(Buffer, L"\\Registry\\Machine\\Software\\RosTests\\Child%04d", i); + _swprintf(Buffer, L"\\Registry\\Machine\\Software\\RosTests\\Child%04d", i); CreateRegistryKeyHandle(&ChildKey, DELETE, Buffer); Status = NtDeleteKey(ChildKey); NtClose(ChildKey); diff --git a/modules/rostests/apitests/ntdll/RtlComputePrivatizedDllName_U.c b/modules/rostests/apitests/ntdll/RtlComputePrivatizedDllName_U.c index ee91ca618eb..81df6544030 100644 --- a/modules/rostests/apitests/ntdll/RtlComputePrivatizedDllName_U.c +++ b/modules/rostests/apitests/ntdll/RtlComputePrivatizedDllName_U.c @@ -48,8 +48,8 @@ static void ok_strings_(PCUNICODE_STRING RealName, PCUNICODE_STRING LocalName, L int RealLen; int ExpectLen; - RealLen = swprintf(ExpectReal, L"%s%s", ProcessDir, DllName) * sizeof(WCHAR); - ExpectLen = swprintf(ExpectLocal, L"%s%s", LocalDir, DllName) * sizeof(WCHAR); + RealLen = _swprintf(ExpectReal, L"%s%s", ProcessDir, DllName) * sizeof(WCHAR); + ExpectLen = _swprintf(ExpectLocal, L"%s%s", LocalDir, DllName) * sizeof(WCHAR); ok_(__FILE__, line)(RealLen == RealName->Length, "Expected Real %u, got %u\n", (UINT)RealLen, (UINT)RealName->Length); diff --git a/modules/rostests/apitests/ntdll/RtlDoesFileExists.c b/modules/rostests/apitests/ntdll/RtlDoesFileExists.c index d113ccbea23..f75f10c8764 100644 --- a/modules/rostests/apitests/ntdll/RtlDoesFileExists.c +++ b/modules/rostests/apitests/ntdll/RtlDoesFileExists.c @@ -228,19 +228,19 @@ START_TEST(RtlDoesFileExists) StartSeh() RtlDoesFileExists_UstrEx(NULL, TRUE); EndSeh(STATUS_ACCESS_VIOLATION); } - swprintf(FileName, L"C:\\%ls", CustomPath); + _swprintf(FileName, L"C:\\%ls", CustomPath); /* Make sure this directory doesn't exist */ while (GetFileAttributesW(FileName) != INVALID_FILE_ATTRIBUTES) { wcscat(CustomPath, L"X"); - swprintf(FileName, L"C:\\%ls", CustomPath); + _swprintf(FileName, L"C:\\%ls", CustomPath); } Success = CreateDirectoryW(FileName, NULL); ok(Success, "CreateDirectory failed, results might not be accurate\n"); - swprintf(FileName, L"C:\\%ls\\ThisFolderExists", CustomPath); + _swprintf(FileName, L"C:\\%ls\\ThisFolderExists", CustomPath); Success = CreateDirectoryW(FileName, NULL); ok(Success, "CreateDirectory failed, results might not be accurate\n"); - swprintf(FileName, L"C:\\%ls\\ThisFolderExists\\ThisFileExists", CustomPath); + _swprintf(FileName, L"C:\\%ls\\ThisFolderExists\\ThisFileExists", CustomPath); Handle = CreateFileW(FileName, 0, 0, NULL, CREATE_NEW, 0, NULL); ok(Handle != INVALID_HANDLE_VALUE, "CreateFile failed, results might not be accurate\n"); if (Handle != INVALID_HANDLE_VALUE) @@ -271,24 +271,24 @@ START_TEST(RtlDoesFileExists) CloseHandle(Handle); } - swprintf(FileName, L"C:\\%ls\\ThisFolderExists\\SomeProgram.exe", CustomPath); + _swprintf(FileName, L"C:\\%ls\\ThisFolderExists\\SomeProgram.exe", CustomPath); Handle = CreateFileW(FileName, 0, 0, NULL, CREATE_NEW, 0, NULL); ok(Handle != INVALID_HANDLE_VALUE, "CreateFile failed, results might not be accurate\n"); if (Handle != INVALID_HANDLE_VALUE) CloseHandle(Handle); - swprintf(FileName, L"C:\\%ls\\ThisFolderExists\\With Space", CustomPath); + _swprintf(FileName, L"C:\\%ls\\ThisFolderExists\\With Space", CustomPath); Handle = CreateFileW(FileName, 0, 0, NULL, CREATE_NEW, 0, NULL); ok(Handle != INVALID_HANDLE_VALUE, "CreateFile failed, results might not be accurate\n"); if (Handle != INVALID_HANDLE_VALUE) CloseHandle(Handle); - swprintf(FileName, L"C:\\%ls\\ThisFolderExists\\Without", CustomPath); + _swprintf(FileName, L"C:\\%ls\\ThisFolderExists\\Without", CustomPath); Handle = CreateFileW(FileName, 0, 0, NULL, CREATE_NEW, 0, NULL); ok(Handle != INVALID_HANDLE_VALUE, "CreateFile failed, results might not be accurate\n"); if (Handle != INVALID_HANDLE_VALUE) CloseHandle(Handle); for (i = 0; i < sizeof(Tests) / sizeof(Tests[0]); i++) { - swprintf(FileName, Tests[i].FileName, CustomPath); + _swprintf(FileName, Tests[i].FileName, CustomPath); StartSeh() Ret = RtlDoesFileExists_U(FileName); ok_bool_file(Ret, Tests[i].Exists, FileName); @@ -336,23 +336,23 @@ START_TEST(RtlDoesFileExists) } } - swprintf(FileName, L"C:\\%ls\\ThisFolderExists\\Without", CustomPath); + _swprintf(FileName, L"C:\\%ls\\ThisFolderExists\\Without", CustomPath); Success = DeleteFileW(FileName); ok(Success, "DeleteFile failed (%lu), test might leave stale file\n", GetLastError()); - swprintf(FileName, L"C:\\%ls\\ThisFolderExists\\With Space", CustomPath); + _swprintf(FileName, L"C:\\%ls\\ThisFolderExists\\With Space", CustomPath); Success = DeleteFileW(FileName); ok(Success, "DeleteFile failed (%lu), test might leave stale file\n", GetLastError()); - swprintf(FileName, L"C:\\%ls\\ThisFolderExists\\SomeProgram.exe", CustomPath); + _swprintf(FileName, L"C:\\%ls\\ThisFolderExists\\SomeProgram.exe", CustomPath); Success = DeleteFileW(FileName); ok(Success, "DeleteFile failed (%lu), test might leave stale file\n", GetLastError()); - swprintf(FileName, L"C:\\%ls\\ThisFolderExists\\ThisFileExists", CustomPath); + _swprintf(FileName, L"C:\\%ls\\ThisFolderExists\\ThisFileExists", CustomPath); Success = DeleteFileW(FileName); ok(Success, "DeleteFile failed (%lu), test might leave stale file\n", GetLastError()); - swprintf(FileName, L"C:\\%ls\\ThisFolderExists", CustomPath); + _swprintf(FileName, L"C:\\%ls\\ThisFolderExists", CustomPath); Success = RemoveDirectoryW(FileName); ok(Success, "RemoveDirectory failed (%lu), test might leave stale directory\n", GetLastError()); - swprintf(FileName, L"C:\\%ls", CustomPath); + _swprintf(FileName, L"C:\\%ls", CustomPath); Success = RemoveDirectoryW(FileName); ok(Success, "RemoveDirectory failed (%lu), test might leave stale directory\n", GetLastError()); } diff --git a/modules/rostests/apitests/ntdll/RtlDosPathNameToNtPathName_U.c b/modules/rostests/apitests/ntdll/RtlDosPathNameToNtPathName_U.c index 9cbeefeceb3..e3379312f3c 100644 --- a/modules/rostests/apitests/ntdll/RtlDosPathNameToNtPathName_U.c +++ b/modules/rostests/apitests/ntdll/RtlDosPathNameToNtPathName_U.c @@ -189,13 +189,13 @@ static void test(const char* psz, const char* pszExpected, const char* pszExpect WCHAR wszTmp3[512]; LPCWSTR p2 = 0; LPCWSTR p3 = 0; - swprintf(wszTmp1, L"%S", psz); + _swprintf(wszTmp1, L"%S", psz); if (pszExpected) { - swprintf(wszTmp2, L"%S", pszExpected); + _swprintf(wszTmp2, L"%S", pszExpected); p2 = wszTmp2; } if (pszExpectedPartName) { - swprintf(wszTmp3, L"%S", pszExpectedPartName); + _swprintf(wszTmp3, L"%S", pszExpectedPartName); p3 = wszTmp3; } test2(wszTmp1, p2, p3); diff --git a/modules/rostests/apitests/ntdll/RtlDosSearchPath_U.c b/modules/rostests/apitests/ntdll/RtlDosSearchPath_U.c index 72618776998..e639bd75c85 100644 --- a/modules/rostests/apitests/ntdll/RtlDosSearchPath_U.c +++ b/modules/rostests/apitests/ntdll/RtlDosSearchPath_U.c @@ -223,8 +223,8 @@ RunTestCases( for (i = 0; i < sizeof(Tests) / sizeof(Tests[0]); i++) { - swprintf(SearchPath, Tests[i].SearchPath, CustomPath, CustomPath, CustomPath, CustomPath); - swprintf(FileName, Tests[i].FileName, CustomPath, CustomPath, CustomPath, CustomPath); + _swprintf(SearchPath, Tests[i].SearchPath, CustomPath, CustomPath, CustomPath, CustomPath); + _swprintf(FileName, Tests[i].FileName, CustomPath, CustomPath, CustomPath, CustomPath); RtlFillMemory(Buffer, sizeof(Buffer), 0x55); PartName = InvalidPointer; @@ -239,7 +239,7 @@ RunTestCases( if (Tests[i].ResultPath) { - swprintf(ResultPath, Tests[i].ResultPath, CustomPath, CustomPath, CustomPath, CustomPath); + _swprintf(ResultPath, Tests[i].ResultPath, CustomPath, CustomPath, CustomPath, CustomPath); if (Tests[i].ResultFileName) { ok(PartName == &Buffer[wcslen(ResultPath)], @@ -270,14 +270,14 @@ RunTestCases( #define MAKE_DIRECTORY(path) \ do { \ - swprintf(FileName, path, CustomPath); \ + _swprintf(FileName, path, CustomPath); \ Success = CreateDirectoryW(FileName, NULL); \ ok(Success, "CreateDirectory failed, results might not be accurate\n"); \ } while (0) #define MAKE_FILE(path) \ do { \ - swprintf(FileName, path, CustomPath); \ + _swprintf(FileName, path, CustomPath); \ Handle = CreateFileW(FileName, 0, 0, NULL, CREATE_NEW, 0, NULL); \ ok(Handle != INVALID_HANDLE_VALUE, \ "CreateFile failed, results might not be accurate\n"); \ @@ -286,7 +286,7 @@ do { \ #define DELETE_DIRECTORY(path) \ do { \ - swprintf(FileName, path, CustomPath); \ + _swprintf(FileName, path, CustomPath); \ Success = RemoveDirectoryW(FileName); \ ok(Success, \ "RemoveDirectory failed (%lu), test might leave stale directory\n", \ @@ -295,7 +295,7 @@ do { \ #define DELETE_FILE(path) \ do { \ - swprintf(FileName, path, CustomPath); \ + _swprintf(FileName, path, CustomPath); \ Success = DeleteFileW(FileName); \ ok(Success, \ "DeleteFile failed (%lu), test might leave stale file\n", \ @@ -313,12 +313,12 @@ START_TEST(RtlDosSearchPath_U) WCHAR CustomPath[MAX_PATH] = L"RtlDosSearchPath_U_TestPath"; HANDLE Handle; - swprintf(FileName, L"C:\\%ls", CustomPath); + _swprintf(FileName, L"C:\\%ls", CustomPath); /* Make sure this directory doesn't exist */ while (GetFileAttributesW(FileName) != INVALID_FILE_ATTRIBUTES) { wcscat(CustomPath, L"X"); - swprintf(FileName, L"C:\\%ls", CustomPath); + _swprintf(FileName, L"C:\\%ls", CustomPath); } Success = CreateDirectoryW(FileName, NULL); ok(Success, "CreateDirectory failed, results might not be accurate\n"); diff --git a/modules/rostests/apitests/ntdll/sprintf.c b/modules/rostests/apitests/ntdll/sprintf.c index d7c5802159d..58d530f4426 100644 --- a/modules/rostests/apitests/ntdll/sprintf.c +++ b/modules/rostests/apitests/ntdll/sprintf.c @@ -53,7 +53,7 @@ my_swprintf(wchar_t *buf, const wchar_t *format, ...) } #define sprintf(buf, format, ...) my_sprintf(buf, format, __VA_ARGS__); -#define swprintf(buf, format, ...) my_swprintf((wchar_t*)buf, format, __VA_ARGS__); +#define _swprintf(buf, format, ...) my_swprintf((wchar_t*)buf, format, __VA_ARGS__); void test_c() diff --git a/modules/rostests/apitests/shell32/Control_RunDLLW.cpp b/modules/rostests/apitests/shell32/Control_RunDLLW.cpp index 8f9e7c9edb9..a8aea937a64 100644 --- a/modules/rostests/apitests/shell32/Control_RunDLLW.cpp +++ b/modules/rostests/apitests/shell32/Control_RunDLLW.cpp @@ -150,7 +150,7 @@ START_TEST(Control_RunDLLW) for (UINT i = 0; i < _countof(tests); i++) { - swprintf(buffer, L"%s%s", finename, tests[i].cmd); + _swprintf(buffer, L"%s%s", finename, tests[i].cmd); g_iClk = MSG_NOT_CALLED; g_iParams = MSG_NOT_CALLED; diff --git a/modules/rostests/apitests/user32/RegisterClassEx.c b/modules/rostests/apitests/user32/RegisterClassEx.c index 7e09642b75b..af8c3e5f0ec 100644 --- a/modules/rostests/apitests/user32/RegisterClassEx.c +++ b/modules/rostests/apitests/user32/RegisterClassEx.c @@ -229,7 +229,7 @@ VOID TestVersionedClasses(VOID) ok (proc3 == DefWindowProcW, "Got 0x%p, expected 0x%p\n", proc2, DefWindowProcA); a = _RegisterClass(L"VersionTestClass3", hmod, 0, DefWindowProcW); - swprintf(buffer, L"#%d", a); + _swprintf(buffer, L"#%d", a); proc1 = _GetWndproc((LPCWSTR)(DWORD_PTR)a, hmod); proc2 = _GetWndproc(buffer, hmod); ok (a != 0, "\n"); @@ -238,7 +238,7 @@ VOID TestVersionedClasses(VOID) DeactivateActCtx(0, cookie1); a = _RegisterClass(L"VersionTestClass3", hmod, 0, DefWindowProcW); - swprintf(buffer, L"#%d", a); + _swprintf(buffer, L"#%d", a); proc1 = _GetWndproc((LPCWSTR)(DWORD_PTR)a, hmod); proc2 = _GetWndproc(buffer, hmod); ok (a != 0, "\n"); diff --git a/modules/rostests/rosautotest/CPipe.cpp b/modules/rostests/rosautotest/CPipe.cpp index efff475e93e..76171658ac6 100644 --- a/modules/rostests/rosautotest/CPipe.cpp +++ b/modules/rostests/rosautotest/CPipe.cpp @@ -25,7 +25,7 @@ CPipe::CPipe() // Construct a unique pipe name. WCHAR wszPipeName[MAX_PATH]; InterlockedIncrement(&m_lPipeCount); - swprintf(wszPipeName, L"\\\\.\\pipe\\TestmanPipe%ld", m_lPipeCount); + _swprintf(wszPipeName, L"\\\\.\\pipe\\TestmanPipe%ld", m_lPipeCount); // Create a named pipe with the default settings, but overlapped (asynchronous) operations. // Latter feature is why we can't simply use CreatePipe. diff --git a/modules/rostests/tests/parttest/parttest.c b/modules/rostests/tests/parttest/parttest.c index ce9c8f378eb..e211627f5a2 100644 --- a/modules/rostests/tests/parttest/parttest.c +++ b/modules/rostests/tests/parttest/parttest.c @@ -218,7 +218,7 @@ int main(int argc, char ** argv) } /* We first open disk */ - swprintf(Buffer, DiskFormat, 0, 0); + _swprintf(Buffer, DiskFormat, 0, 0); RtlInitUnicodeString(&Name, Buffer); InitializeObjectAttributes(&ObjectAttributes, &Name, @@ -279,7 +279,7 @@ int main(int argc, char ** argv) } /* Redo it with first partition */ - swprintf(Buffer, DiskFormat, 0, 1); + _swprintf(Buffer, DiskFormat, 0, 1); RtlInitUnicodeString(&Name, Buffer); InitializeObjectAttributes(&ObjectAttributes, &Name, diff --git a/modules/rostests/win32/comctl32/buttonvistest/buttonvistest.cpp b/modules/rostests/win32/comctl32/buttonvistest/buttonvistest.cpp index e40a8a41c2f..cef74ee56df 100644 --- a/modules/rostests/win32/comctl32/buttonvistest/buttonvistest.cpp +++ b/modules/rostests/win32/comctl32/buttonvistest/buttonvistest.cpp @@ -74,13 +74,13 @@ static HWND CreateBtn(HWND hWnd, LPCWSTR Text, LONG style, int i, int j) HWND ret = CreateWnd(hWnd, L"Button", Text, style, i, j); if (GetWindowLongW(ret, GWL_STYLE) != (style | WS_CHILD | WS_VISIBLE)) { - swprintf(buffer, L"expected 0x%x got 0x%x", (style | WS_CHILD | WS_VISIBLE), GetWindowLongW(ret, GWL_STYLE)); + _swprintf(buffer, L"expected 0x%x got 0x%x", (style | WS_CHILD | WS_VISIBLE), GetWindowLongW(ret, GWL_STYLE)); MessageBox(0, buffer, L"error", MB_OK); } if (SendMessageW(ret, BCM_GETIDEALSIZE, 0, (LPARAM)&s)) { - swprintf(buffer, L"%s (%d, %d)", Text, s.cx, s.cy); + _swprintf(buffer, L"%s (%d, %d)", Text, s.cx, s.cy); SendMessageW(ret, WM_SETTEXT, 0, (LPARAM)buffer); } return ret; diff --git a/ntoskrnl/ex/locale.c b/ntoskrnl/ex/locale.c index 445a304991a..34f8fd0a5e1 100644 --- a/ntoskrnl/ex/locale.c +++ b/ntoskrnl/ex/locale.c @@ -134,9 +134,7 @@ ExpValidateNlsLocaleId( NULL); /* Copy the locale ID into a buffer */ - swprintf(LocaleIdBuffer, - L"%08lx", - (ULONG)LocaleId); + _swprintf(LocaleIdBuffer, L"%08lx", (ULONG)LocaleId); /* And build the LCID string */ RtlInitUnicodeString(&LocaleIdString, LocaleIdBuffer); @@ -366,9 +364,7 @@ ExpSetCurrentUserUILanguage(IN PCWSTR MuiName, if (NT_SUCCESS(Status)) { /* Setup the value name */ - ValueLength = swprintf(ValueBuffer, - L"%04lX", - (ULONG)LanguageId); + ValueLength = _swprintf(ValueBuffer, L"%04lX", (ULONG)LanguageId); /* Set the length for the call and set the value */ ValueLength = (ValueLength + 1) * sizeof(WCHAR); @@ -543,16 +539,16 @@ NtSetDefaultLocale(IN BOOLEAN UserProfile, if (UserProfile) { /* Fill in the buffer */ - ValueLength = swprintf(ValueBuffer, - L"%08lx", - (ULONG)DefaultLocaleId); + ValueLength = _swprintf(ValueBuffer, + L"%08lx", + (ULONG)DefaultLocaleId); } else { /* Fill in the buffer */ - ValueLength = swprintf(ValueBuffer, - L"%04lx", - (ULONG)DefaultLocaleId & 0xFFFF); + ValueLength = _swprintf(ValueBuffer, + L"%04lx", + (ULONG)DefaultLocaleId & 0xFFFF); } /* Set the length for the registry call */ diff --git a/ntoskrnl/fstub/disksup.c b/ntoskrnl/fstub/disksup.c index 31cce186e52..44b0e6453c9 100644 --- a/ntoskrnl/fstub/disksup.c +++ b/ntoskrnl/fstub/disksup.c @@ -340,7 +340,7 @@ IopComputeHarddiskDerangements( for (i = 0; i < DiskCount; ++i) { /* Using their ARC name */ - swprintf(Buffer, L"\\ArcName\\multi(0)disk(0)rdisk(%d)", i); + _swprintf(Buffer, L"\\ArcName\\multi(0)disk(0)rdisk(%d)", i); RtlInitUnicodeString(&ArcName, Buffer); /* Get the attached DeviceObject */ @@ -531,7 +531,7 @@ HalpSetMountLetter( PMOUNTMGR_CREATE_POINT_INPUT InputBuffer; /* Setup the DosDevice name */ - swprintf(Buffer, L"\\DosDevices\\%c:", DriveLetter); + _swprintf(Buffer, L"\\DosDevices\\%c:", DriveLetter); RtlInitUnicodeString(&DosDevice, Buffer); /* Allocate the input buffer for the MountMgr */ @@ -656,7 +656,7 @@ HalpNextDriveLetter( for (i = DriveLetter; i <= 'Z'; ++i) { /* We'll link manually, without the MountMgr knowing anything about the device */ - swprintf(Buffer, L"\\DosDevices\\%c:", i); + _swprintf(Buffer, L"\\DosDevices\\%c:", i); RtlInitUnicodeString(&DosDevice, Buffer); /* If linking worked, the letter was free ;-) */ @@ -756,7 +756,7 @@ HalpDeleteMountLetter( PMOUNTMGR_MOUNT_POINTS OutputBuffer; /* Setup the device name of the letter to delete */ - swprintf(Buffer, L"\\DosDevices\\%c:", DriveLetter); + _swprintf(Buffer, L"\\DosDevices\\%c:", DriveLetter); RtlInitUnicodeString(&DosDevice, Buffer); /* Allocate the input buffer for the MountMgr */ @@ -975,7 +975,7 @@ xHalIoAssignDriveLetters(IN PLOADER_PARAMETER_BLOCK LoaderBlock, for (i = 0; i < DiskCount; ++i) { /* Setup the device name */ - swprintf(Buffer, L"\\Device\\Harddisk%d\\Partition0", i); + _swprintf(Buffer, L"\\Device\\Harddisk%d\\Partition0", i); RtlInitUnicodeString(&DeviceName, Buffer); /* Open the device */ @@ -994,7 +994,7 @@ xHalIoAssignDriveLetters(IN PLOADER_PARAMETER_BLOCK LoaderBlock, { /* If we succeeded, create the link */ UNICODE_STRING LinkName; - swprintf(Buffer2, L"\\DosDevices\\PhysicalDrive%d", i); + _swprintf(Buffer2, L"\\DosDevices\\PhysicalDrive%d", i); RtlInitUnicodeString(&LinkName, Buffer2); IoCreateSymbolicLink(&LinkName, &DeviceName); @@ -1047,7 +1047,7 @@ xHalIoAssignDriveLetters(IN PLOADER_PARAMETER_BLOCK LoaderBlock, HarddiskCount = (Devices ? Devices[i] : i); /* Query the disk layout */ - swprintf(Buffer, L"\\Device\\Harddisk%d\\Partition0", HarddiskCount); + _swprintf(Buffer, L"\\Device\\Harddisk%d\\Partition0", HarddiskCount); RtlInitUnicodeString(&DeviceName, Buffer); Status = HalpQueryDriveLayout(&DeviceName, &LayoutInfo); if (!NT_SUCCESS(Status)) @@ -1057,7 +1057,7 @@ xHalIoAssignDriveLetters(IN PLOADER_PARAMETER_BLOCK LoaderBlock, BootableFound = FALSE; for (PartitionCount = 1; ; ++PartitionCount) { - swprintf(Buffer, L"\\Device\\Harddisk%d\\Partition%d", HarddiskCount, PartitionCount); + _swprintf(Buffer, L"\\Device\\Harddisk%d\\Partition%d", HarddiskCount, PartitionCount); RtlInitUnicodeString(&DeviceName, Buffer); Status = HalpQueryPartitionType(&DeviceName, LayoutInfo, &PartitionType); if (!NT_SUCCESS(Status)) @@ -1084,7 +1084,7 @@ xHalIoAssignDriveLetters(IN PLOADER_PARAMETER_BLOCK LoaderBlock, { for (PartitionCount = 1; ; ++PartitionCount) { - swprintf(Buffer, L"\\Device\\Harddisk%d\\Partition%d", HarddiskCount, PartitionCount); + _swprintf(Buffer, L"\\Device\\Harddisk%d\\Partition%d", HarddiskCount, PartitionCount); RtlInitUnicodeString(&DeviceName, Buffer); Status = HalpQueryPartitionType(&DeviceName, LayoutInfo, &PartitionType); if (!NT_SUCCESS(Status)) @@ -1111,7 +1111,7 @@ xHalIoAssignDriveLetters(IN PLOADER_PARAMETER_BLOCK LoaderBlock, HarddiskCount = (Devices ? Devices[i] : i); /* Query the disk layout */ - swprintf(Buffer, L"\\Device\\Harddisk%d\\Partition0", HarddiskCount); + _swprintf(Buffer, L"\\Device\\Harddisk%d\\Partition0", HarddiskCount); RtlInitUnicodeString(&DeviceName, Buffer); Status = HalpQueryDriveLayout(&DeviceName, &LayoutInfo); if (!NT_SUCCESS(Status)) @@ -1120,7 +1120,7 @@ xHalIoAssignDriveLetters(IN PLOADER_PARAMETER_BLOCK LoaderBlock, /* And assign drive letters to logical partitions */ for (PartitionCount = 1; ; ++PartitionCount) { - swprintf(Buffer, L"\\Device\\Harddisk%d\\Partition%d", HarddiskCount, PartitionCount); + _swprintf(Buffer, L"\\Device\\Harddisk%d\\Partition%d", HarddiskCount, PartitionCount); RtlInitUnicodeString(&DeviceName, Buffer); Status = HalpQueryPartitionType(&DeviceName, LayoutInfo, &PartitionType); if (!NT_SUCCESS(Status)) @@ -1144,7 +1144,7 @@ xHalIoAssignDriveLetters(IN PLOADER_PARAMETER_BLOCK LoaderBlock, HarddiskCount = (Devices ? Devices[i] : i); /* Query the disk layout */ - swprintf(Buffer, L"\\Device\\Harddisk%d\\Partition0", HarddiskCount); + _swprintf(Buffer, L"\\Device\\Harddisk%d\\Partition0", HarddiskCount); RtlInitUnicodeString(&DeviceName, Buffer); Status = HalpQueryDriveLayout(&DeviceName, &LayoutInfo); if (!NT_SUCCESS(Status)) @@ -1154,7 +1154,7 @@ xHalIoAssignDriveLetters(IN PLOADER_PARAMETER_BLOCK LoaderBlock, SkipPartition = 0; for (PartitionCount = 1; ; ++PartitionCount) { - swprintf(Buffer, L"\\Device\\Harddisk%d\\Partition%d", HarddiskCount, PartitionCount); + _swprintf(Buffer, L"\\Device\\Harddisk%d\\Partition%d", HarddiskCount, PartitionCount); RtlInitUnicodeString(&DeviceName, Buffer); Status = HalpQueryPartitionType(&DeviceName, LayoutInfo, &PartitionType); if (!NT_SUCCESS(Status)) @@ -1173,7 +1173,7 @@ xHalIoAssignDriveLetters(IN PLOADER_PARAMETER_BLOCK LoaderBlock, if (PartitionCount == SkipPartition) continue; - swprintf(Buffer, L"\\Device\\Harddisk%d\\Partition%d", HarddiskCount, PartitionCount); + _swprintf(Buffer, L"\\Device\\Harddisk%d\\Partition%d", HarddiskCount, PartitionCount); RtlInitUnicodeString(&DeviceName, Buffer); Status = HalpQueryPartitionType(&DeviceName, LayoutInfo, &PartitionType); if (!NT_SUCCESS(Status)) @@ -1198,14 +1198,14 @@ xHalIoAssignDriveLetters(IN PLOADER_PARAMETER_BLOCK LoaderBlock, * first for legacy, then for MountMgr-aware ones. */ for (i = 0; i < ConfigInfo->FloppyCount; ++i) { - swprintf(Buffer, L"\\Device\\Floppy%d", i); + _swprintf(Buffer, L"\\Device\\Floppy%d", i); RtlInitUnicodeString(&DeviceName, Buffer); if (HalpIsOldStyleFloppy(&DeviceName)) // Legacy device HalpNextDriveLetter(&DeviceName, NtDeviceName, NtSystemPath, TRUE); } for (i = 0; i < ConfigInfo->FloppyCount; ++i) { - swprintf(Buffer, L"\\Device\\Floppy%d", i); + _swprintf(Buffer, L"\\Device\\Floppy%d", i); RtlInitUnicodeString(&DeviceName, Buffer); if (!HalpIsOldStyleFloppy(&DeviceName)) // MountMgr-aware device HalpNextDriveLetter(&DeviceName, NtDeviceName, NtSystemPath, TRUE); @@ -1214,7 +1214,7 @@ xHalIoAssignDriveLetters(IN PLOADER_PARAMETER_BLOCK LoaderBlock, /* And CD-ROM drives */ for (i = 0; i < ConfigInfo->CdRomCount; ++i) { - swprintf(Buffer, L"\\Device\\CdRom%d", i); + _swprintf(Buffer, L"\\Device\\CdRom%d", i); RtlInitUnicodeString(&DeviceName, Buffer); HalpNextDriveLetter(&DeviceName, NtDeviceName, NtSystemPath, TRUE); } diff --git a/ntoskrnl/io/iomgr/bootlog.c b/ntoskrnl/io/iomgr/bootlog.c index df2af12ee07..4c262c4af03 100644 --- a/ntoskrnl/io/iomgr/bootlog.c +++ b/ntoskrnl/io/iomgr/bootlog.c @@ -71,14 +71,12 @@ IopBootLog(PUNICODE_STRING DriverName, Success ? L"Loaded driver" : L"Did not load driver", DriverName); - swprintf(Buffer, - L"%ws %wZ", - Success ? L"Loaded driver" : L"Did not load driver", - DriverName); + _swprintf(Buffer, + L"%ws %wZ", + Success ? L"Loaded driver" : L"Did not load driver", + DriverName); - swprintf(ValueNameBuffer, - L"%lu", - IopLogEntryCount); + _swprintf(ValueNameBuffer, L"%lu", IopLogEntryCount); RtlInitUnicodeString(&KeyName, L"\\Registry\\Machine\\System\\CurrentControlSet"); @@ -359,8 +357,7 @@ IopSaveBootLogToFile(VOID) for (i = 0; ; i++) { - swprintf(ValueNameBuffer, - L"%lu", i); + _swprintf(ValueNameBuffer, L"%lu", i); RtlInitUnicodeString(&ValueName, ValueNameBuffer); diff --git a/ntoskrnl/io/iomgr/device.c b/ntoskrnl/io/iomgr/device.c index bcdfa6921f3..a1d0d228f6f 100644 --- a/ntoskrnl/io/iomgr/device.c +++ b/ntoskrnl/io/iomgr/device.c @@ -1054,9 +1054,9 @@ IoCreateDevice(IN PDRIVER_OBJECT DriverObject, if (DeviceCharacteristics & FILE_AUTOGENERATED_DEVICE_NAME) { /* Generate it */ - swprintf(AutoNameBuffer, - L"\\Device\\%08lx", - InterlockedIncrementUL(&IopDeviceObjectNumber)); + _swprintf(AutoNameBuffer, + L"\\Device\\%08lx", + InterlockedIncrementUL(&IopDeviceObjectNumber)); /* Initialize the name */ RtlInitUnicodeString(&AutoName, AutoNameBuffer); diff --git a/ntoskrnl/io/iomgr/driver.c b/ntoskrnl/io/iomgr/driver.c index 34a6b0ca642..df265a6439e 100644 --- a/ntoskrnl/io/iomgr/driver.c +++ b/ntoskrnl/io/iomgr/driver.c @@ -1605,9 +1605,9 @@ try_again: if (!DriverName) { /* Create a random name and set up the string */ - NameLength = (USHORT)swprintf(NameBuffer, - DRIVER_ROOT_NAME L"%08u", - KeTickCount.LowPart); + NameLength = (USHORT)_swprintf(NameBuffer, + DRIVER_ROOT_NAME L"%08u", + KeTickCount.LowPart); LocalDriverName.Length = NameLength * sizeof(WCHAR); LocalDriverName.MaximumLength = LocalDriverName.Length + sizeof(UNICODE_NULL); LocalDriverName.Buffer = NameBuffer; diff --git a/ntoskrnl/io/pnpmgr/devaction.c b/ntoskrnl/io/pnpmgr/devaction.c index 28079f76c6a..5bb6396810b 100644 --- a/ntoskrnl/io/pnpmgr/devaction.c +++ b/ntoskrnl/io/pnpmgr/devaction.c @@ -1462,7 +1462,7 @@ IopSetServiceEnumData( } /* Set the instance path */ - swprintf(ValueBuffer, L"%lu", NextInstance); + _swprintf(ValueBuffer, L"%lu", NextInstance); RtlInitUnicodeString(&ValueName, ValueBuffer); Status = ZwSetValueKey(ServiceEnumKey, &ValueName, diff --git a/ntoskrnl/io/pnpmgr/pnpmap.c b/ntoskrnl/io/pnpmgr/pnpmap.c index e6e881912d5..6f4295eddcb 100644 --- a/ntoskrnl/io/pnpmgr/pnpmap.c +++ b/ntoskrnl/io/pnpmgr/pnpmap.c @@ -470,7 +470,7 @@ IopEnumerateDetectedDevices( goto nextdevice; } - swprintf(Level2Name, L"%04lu", DeviceIndex); + _swprintf(Level2Name, L"%04lu", DeviceIndex); RtlInitUnicodeString(&Level2NameU, Level2Name); InitializeObjectAttributes(&ObjectAttributes, &Level2NameU, OBJ_KERNEL_HANDLE, hLevel1Key, NULL); diff --git a/ntoskrnl/io/pnpmgr/pnpreport.c b/ntoskrnl/io/pnpmgr/pnpreport.c index 09279b7ef6f..2256fb9d7f2 100644 --- a/ntoskrnl/io/pnpmgr/pnpreport.c +++ b/ntoskrnl/io/pnpmgr/pnpreport.c @@ -307,16 +307,16 @@ IoReportDetectedDevice( /* Add DETECTEDInterfaceType\DriverName */ IdLength = 0; - IdLength += swprintf(&HardwareId[IdLength], - L"DETECTED%ls\\%wZ", - IfString, - &ServiceName); + IdLength += _swprintf(&HardwareId[IdLength], + L"DETECTED%ls\\%wZ", + IfString, + &ServiceName); IdLength++; /* Add DETECTED\DriverName */ - IdLength += swprintf(&HardwareId[IdLength], - L"DETECTED\\%wZ", - &ServiceName); + IdLength += _swprintf(&HardwareId[IdLength], + L"DETECTED\\%wZ", + &ServiceName); IdLength++; /* Terminate the string with another null */ diff --git a/ntoskrnl/ntoskrnl.spec b/ntoskrnl/ntoskrnl.spec index 66242b63303..751e9005158 100644 --- a/ntoskrnl/ntoskrnl.spec +++ b/ntoskrnl/ntoskrnl.spec @@ -1582,6 +1582,7 @@ @ cdecl _strset() @ cdecl _strupr() @ cdecl -version=0x400-0x502 -impsym _swprintf() swprintf # Compatibility with pre NT6 +@ cdecl -version=0x600+ _swprintf() @ cdecl _vsnprintf() @ cdecl _vsnwprintf() @ cdecl _wcsicmp() diff --git a/sdk/include/crt/tchar.h b/sdk/include/crt/tchar.h index e9c5234d409..73087c03590 100644 --- a/sdk/include/crt/tchar.h +++ b/sdk/include/crt/tchar.h @@ -141,7 +141,7 @@ extern "C" { #define _ftprintf_l _fwprintf_l #define _ftprintf_p _fwprintf_p #define _ftprintf_p_l _fwprintf_p_l -#define _stprintf swprintf +#define _stprintf _swprintf #define _stprintf_l __swprintf_l #define _stprintf_p _swprintf_p #define _stprintf_p_l _swprintf_p_l diff --git a/sdk/lib/atl/cstringt.h b/sdk/lib/atl/cstringt.h index ce66b9787bb..1e1359f2f8c 100644 --- a/sdk/lib/atl/cstringt.h +++ b/sdk/lib/atl/cstringt.h @@ -185,7 +185,7 @@ public: { if (pszDest == NULL) return ::_vscwprintf(pszFormat, args); - return ::vswprintf(pszDest, pszFormat, args); + return ::_vswprintf(pszDest, pszFormat, args); } static LPWSTR diff --git a/sdk/lib/rtl/atom.c b/sdk/lib/rtl/atom.c index ed4af8e9078..96b35f1171a 100644 --- a/sdk/lib/rtl/atom.c +++ b/sdk/lib/rtl/atom.c @@ -622,9 +622,9 @@ RtlQueryAtomInAtomTable( { /* Synthesize an entry */ NumberEntry.AtomTableEntry.Atom = Atom; - NumberEntry.AtomTableEntry.NameLength = swprintf(NumberEntry.AtomTableEntry.Name, - L"#%lu", - (ULONG)Atom); + NumberEntry.AtomTableEntry.NameLength = _swprintf(NumberEntry.AtomTableEntry.Name, + L"#%lu", + (ULONG)Atom); NumberEntry.AtomTableEntry.ReferenceCount = 1; NumberEntry.AtomTableEntry.Flags = RTL_ATOM_IS_PINNED; Entry = &NumberEntry.AtomTableEntry; diff --git a/sdk/lib/rtl/sid.c b/sdk/lib/rtl/sid.c index 7f2ee676e96..928e7df81ed 100644 --- a/sdk/lib/rtl/sid.c +++ b/sdk/lib/rtl/sid.c @@ -353,33 +353,33 @@ RtlConvertSidToUnicodeString(IN PUNICODE_STRING String, if (!RtlValidSid(Sid)) return STATUS_INVALID_SID; wcs = Buffer; - wcs += swprintf(wcs, L"S-1-"); + wcs += _swprintf(wcs, L"S-1-"); if ((Sid->IdentifierAuthority.Value[0] == 0) && (Sid->IdentifierAuthority.Value[1] == 0)) { - wcs += swprintf(wcs, - L"%lu", - (ULONG)Sid->IdentifierAuthority.Value[2] << 24 | - (ULONG)Sid->IdentifierAuthority.Value[3] << 16 | - (ULONG)Sid->IdentifierAuthority.Value[4] << 8 | - (ULONG)Sid->IdentifierAuthority.Value[5]); + wcs += _swprintf(wcs, + L"%lu", + (ULONG)Sid->IdentifierAuthority.Value[2] << 24 | + (ULONG)Sid->IdentifierAuthority.Value[3] << 16 | + (ULONG)Sid->IdentifierAuthority.Value[4] << 8 | + (ULONG)Sid->IdentifierAuthority.Value[5]); } else { - wcs += swprintf(wcs, - L"0x%02hx%02hx%02hx%02hx%02hx%02hx", - Sid->IdentifierAuthority.Value[0], - Sid->IdentifierAuthority.Value[1], - Sid->IdentifierAuthority.Value[2], - Sid->IdentifierAuthority.Value[3], - Sid->IdentifierAuthority.Value[4], - Sid->IdentifierAuthority.Value[5]); + wcs += _swprintf(wcs, + L"0x%02hx%02hx%02hx%02hx%02hx%02hx", + Sid->IdentifierAuthority.Value[0], + Sid->IdentifierAuthority.Value[1], + Sid->IdentifierAuthority.Value[2], + Sid->IdentifierAuthority.Value[3], + Sid->IdentifierAuthority.Value[4], + Sid->IdentifierAuthority.Value[5]); } for (i = 0; i < Sid->SubAuthorityCount; i++) { - wcs += swprintf(wcs, L"-%u", Sid->SubAuthority[i]); + wcs += _swprintf(wcs, L"-%u", Sid->SubAuthority[i]); } if (AllocateBuffer) diff --git a/sdk/lib/rtl/unicode.c b/sdk/lib/rtl/unicode.c index c29dfa4f3b8..577be25d4dc 100644 --- a/sdk/lib/rtl/unicode.c +++ b/sdk/lib/rtl/unicode.c @@ -2150,19 +2150,19 @@ RtlStringFromGUID (IN REFGUID Guid, if (!GuidString->Buffer) return STATUS_NO_MEMORY; /* Now format the GUID */ - swprintf(GuidString->Buffer, - L"{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", - Guid->Data1, - Guid->Data2, - Guid->Data3, - Guid->Data4[0], - Guid->Data4[1], - Guid->Data4[2], - Guid->Data4[3], - Guid->Data4[4], - Guid->Data4[5], - Guid->Data4[6], - Guid->Data4[7]); + _swprintf(GuidString->Buffer, + L"{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", + Guid->Data1, + Guid->Data2, + Guid->Data3, + Guid->Data4[0], + Guid->Data4[1], + Guid->Data4[2], + Guid->Data4[3], + Guid->Data4[4], + Guid->Data4[5], + Guid->Data4[6], + Guid->Data4[7]); return STATUS_SUCCESS; } diff --git a/subsystems/csr/csrsrv/init.c b/subsystems/csr/csrsrv/init.c index 491a15d896a..29c8f282a9f 100644 --- a/subsystems/csr/csrsrv/init.c +++ b/subsystems/csr/csrsrv/init.c @@ -431,7 +431,7 @@ CsrCreateSessionObjectDirectory(IN ULONG Session) NTSTATUS Status; /* Generate the Session BNOLINKS Directory name */ - swprintf(SessionBuffer, L"%ws\\BNOLINKS", SESSION_ROOT); + _swprintf(SessionBuffer, L"%ws\\BNOLINKS", SESSION_ROOT); RtlInitUnicodeString(&SessionString, SessionBuffer); /* Create it */ @@ -451,14 +451,14 @@ CsrCreateSessionObjectDirectory(IN ULONG Session) } /* Now add the Session ID */ - swprintf(SessionBuffer, L"%ld", Session); + _swprintf(SessionBuffer, L"%ld", Session); RtlInitUnicodeString(&SessionString, SessionBuffer); /* Check if this is the first Session */ if (Session) { /* Not the first, so the name will be slighly more complex */ - swprintf(BnoBuffer, L"%ws\\%ld\\BaseNamedObjects", SESSION_ROOT, Session); + _swprintf(BnoBuffer, L"%ws\\%ld\\BaseNamedObjects", SESSION_ROOT, Session); RtlInitUnicodeString(&BnoString, BnoBuffer); } else @@ -489,7 +489,7 @@ CsrCreateSessionObjectDirectory(IN ULONG Session) if (!NT_SUCCESS(Status)) return Status; /* Now create a directory for this session */ - swprintf(SessionBuffer, L"%ws\\%ld", SESSION_ROOT, Session); + _swprintf(SessionBuffer, L"%ws\\%ld", SESSION_ROOT, Session); RtlInitUnicodeString(&SessionString, SessionBuffer); /* Create the directory */ diff --git a/subsystems/win/basesrv/init.c b/subsystems/win/basesrv/init.c index 0768f69e76a..f9146797ea8 100644 --- a/subsystems/win/basesrv/init.c +++ b/subsystems/win/basesrv/init.c @@ -425,7 +425,7 @@ BaseInitializeStaticServerData(IN PCSR_SERVER_DLL LoadedServerDll) if (SessionId != 0) { - swprintf(BnoBuffer, L"\\Sessions\\%ld\\BaseNamedObjects", SessionId); + _swprintf(BnoBuffer, L"\\Sessions\\%ld\\BaseNamedObjects", SessionId); } else { diff --git a/win32ss/drivers/videoprt/child.c b/win32ss/drivers/videoprt/child.c index dd3a8beaed9..81221d74bd5 100644 --- a/win32ss/drivers/videoprt/child.c +++ b/win32ss/drivers/videoprt/child.c @@ -48,12 +48,12 @@ IntVideoPortGetMonitorId( (USHORT)ChildExtension->ChildDescriptor[10]; /* Convert the Monitor ID to a readable form */ - swprintf(Buffer, - L"%C%C%C%04hx", - (WCHAR)((Manufacturer >> 10 & 0x001F) + 'A' - 1), - (WCHAR)((Manufacturer >> 5 & 0x001F) + 'A' - 1), - (WCHAR)((Manufacturer & 0x001F) + 'A' - 1), - Model); + _swprintf(Buffer, + L"%C%C%C%04hx", + (WCHAR)((Manufacturer >> 10 & 0x001F) + 'A' - 1), + (WCHAR)((Manufacturer >> 5 & 0x001F) + 'A' - 1), + (WCHAR)((Manufacturer & 0x001F) + 'A' - 1), + Model); /* And we're done */ return TRUE; diff --git a/win32ss/drivers/videoprt/registry.c b/win32ss/drivers/videoprt/registry.c index d58c79a87aa..7bd9e76156c 100644 --- a/win32ss/drivers/videoprt/registry.c +++ b/win32ss/drivers/videoprt/registry.c @@ -543,7 +543,7 @@ IntCreateNewRegistryPath( RtlAppendUnicodeToString(&DeviceExtension->NewRegistryPath, L"0000"); /* Write instance ID */ - swprintf(InstanceIdBuffer, L"%04u", DeviceExtension->DisplayNumber); + _swprintf(InstanceIdBuffer, L"%04u", DeviceExtension->DisplayNumber); /* Check if the name exists */ Status = RtlCheckRegistryKey(RTL_REGISTRY_ABSOLUTE, diff --git a/win32ss/drivers/videoprt/videoprt.c b/win32ss/drivers/videoprt/videoprt.c index 6c1246f3c9d..1868b5accb1 100644 --- a/win32ss/drivers/videoprt/videoprt.c +++ b/win32ss/drivers/videoprt/videoprt.c @@ -81,7 +81,7 @@ IntVideoPortAddDeviceMapLink( /* Create a unicode device name. */ DeviceNumber = DeviceExtension->DeviceNumber; - swprintf(DeviceBuffer, L"\\Device\\Video%lu", DeviceNumber); + _swprintf(DeviceBuffer, L"\\Device\\Video%lu", DeviceNumber); if (VideoPortUseNewKey) RegistryPath = &DeviceExtension->NewRegistryPath; @@ -114,7 +114,7 @@ IntVideoPortAddDeviceMapLink( } /* Create symbolic link "\??\DISPLAYx" */ - swprintf(SymlinkBuffer, L"\\??\\DISPLAY%lu", DeviceNumber + 1); + _swprintf(SymlinkBuffer, L"\\??\\DISPLAY%lu", DeviceNumber + 1); RtlInitUnicodeString(&SymlinkName, SymlinkBuffer); RtlInitUnicodeString(&DeviceName, DeviceBuffer); Status = IoCreateSymbolicLink(&SymlinkName, &DeviceName); @@ -205,7 +205,7 @@ IntVideoPortCreateAdapterDeviceObject( */ /* Create a unicode device name. */ - swprintf(DeviceBuffer, L"\\Device\\Video%lu", DeviceNumber); + _swprintf(DeviceBuffer, L"\\Device\\Video%lu", DeviceNumber); RtlInitUnicodeString(&DeviceName, DeviceBuffer); INFO_(VIDEOPRT, "HwDeviceExtension size is: 0x%x\n", diff --git a/win32ss/gdi/eng/device.c b/win32ss/gdi/eng/device.c index 522d5b5a0dd..384d4c960c8 100644 --- a/win32ss/gdi/eng/device.c +++ b/win32ss/gdi/eng/device.c @@ -210,10 +210,10 @@ EngpUpdateGraphicsDeviceList(VOID) for (iDevNum = 0; iDevNum <= ulMaxObjectNumber; iDevNum++) { /* Create the adapter's key name */ - swprintf(awcDeviceName, L"\\Device\\Video%lu", iDevNum); + _swprintf(awcDeviceName, L"\\Device\\Video%lu", iDevNum); /* Create the display device name */ - swprintf(awcWinDeviceName, L"\\\\.\\DISPLAY%lu", iDevNum + 1); + _swprintf(awcWinDeviceName, L"\\\\.\\DISPLAY%lu", iDevNum + 1); RtlInitUnicodeString(&ustrDeviceName, awcWinDeviceName); /* Check if the device exists already */ diff --git a/win32ss/printing/monitors/localmon/ui/localui.c b/win32ss/printing/monitors/localmon/ui/localui.c index cc49f777698..b4f1ca0117a 100644 --- a/win32ss/printing/monitors/localmon/ui/localui.c +++ b/win32ss/printing/monitors/localmon/ui/localui.c @@ -189,7 +189,7 @@ static void dlg_port_already_exists(HWND hWnd, LPCWSTR portname) message = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); if (message) { message[0] = '\0'; - swprintf(message, res_PortExistsW, portname); + _swprintf(message, res_PortExistsW, portname); MessageBoxW(hWnd, message, res_PortW, MB_OK | MB_ICONERROR); HeapFree(GetProcessHeap(), 0, message); } @@ -215,7 +215,7 @@ static void dlg_invalid_portname(HWND hWnd, LPCWSTR portname) message = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); if (message) { message[0] = '\0'; - swprintf(message, res_InvalidNameW, portname); + _swprintf(message, res_InvalidNameW, portname); MessageBoxW(hWnd, message, res_PortW, MB_OK | MB_ICONERROR); HeapFree(GetProcessHeap(), 0, message); } @@ -382,7 +382,7 @@ static INT_PTR CALLBACK dlgproc_lptconfig(HWND hwnd, UINT msg, WPARAM wparam, LP /* native localui.dll use the same limits */ if ((res > 0) && (res < 1000000) && status) { - swprintf(bufferW, fmt_uW, res); + _swprintf(bufferW, fmt_uW, res); res = XcvDataW( data->hXcv, cmd_ConfigureLPTPortCommandOKW, (PBYTE) bufferW, (lstrlenW(bufferW) +1) * sizeof(WCHAR), diff --git a/win32ss/printing/providers/localspl/jobs.c b/win32ss/printing/providers/localspl/jobs.c index 99e326ab815..02b9fced810 100644 --- a/win32ss/printing/providers/localspl/jobs.c +++ b/win32ss/printing/providers/localspl/jobs.c @@ -150,7 +150,7 @@ GetJobFilePath(PCWSTR pwszExtension, DWORD dwJobID, PWSTR pwszOutput) if (pwszOutput) { CopyMemory(pwszOutput, wszJobDirectory, cchJobDirectory * sizeof(WCHAR)); - swprintf(&pwszOutput[cchJobDirectory], L"\\%05lu.%s", dwJobID, pwszExtension); + _swprintf(&pwszOutput[cchJobDirectory], L"\\%05lu.%s", dwJobID, pwszExtension); } // pwszExtension may be L"SPL" or L"SHD", same length for both! diff --git a/win32ss/user/ntuser/display.c b/win32ss/user/ntuser/display.c index 54f340a8254..642b5aa2a87 100644 --- a/win32ss/user/ntuser/display.c +++ b/win32ss/user/ntuser/display.c @@ -290,7 +290,7 @@ UserEnumDisplayDevices( } else { - swprintf(pdispdev->DeviceName, L"%ws\\Monitor%u", pGraphicsDevice->szWinDeviceName, iDevNum); + _swprintf(pdispdev->DeviceName, L"%ws\\Monitor%u", pGraphicsDevice->szWinDeviceName, iDevNum); if (pdo) { Status = IoGetDeviceProperty(pdo, diff --git a/win32ss/user/ntuser/kbdlayout.c b/win32ss/user/ntuser/kbdlayout.c index eecd00aff02..a158b997f97 100644 --- a/win32ss/user/ntuser/kbdlayout.c +++ b/win32ss/user/ntuser/kbdlayout.c @@ -312,7 +312,7 @@ UserLoadKbdFile(PUNICODE_STRING pwszKLID) } /* Set keyboard layout name */ - swprintf(pkf->awchKF, L"%wZ", pwszKLID); + _swprintf(pkf->awchKF, L"%wZ", pwszKLID); /* Open layout registry key */ RtlStringCbCatW(wszLayoutRegKey, sizeof(wszLayoutRegKey), pkf->awchKF); diff --git a/win32ss/user/user32/misc/dllmain.c b/win32ss/user/user32/misc/dllmain.c index d9cc8c96cd4..044019644b0 100644 --- a/win32ss/user/user32/misc/dllmain.c +++ b/win32ss/user/user32/misc/dllmain.c @@ -497,11 +497,11 @@ DllMain( else { /* Use the session path */ - swprintf(SessionDir, - L"%ws\\%ld%ws", - SESSION_DIR, - SessionId, - WIN_OBJ_DIR); + _swprintf(SessionDir, + L"%ws\\%ld%ws", + SESSION_DIR, + SessionId, + WIN_OBJ_DIR); } TRACE("Checkpoint (call CSR)\n"); diff --git a/win32ss/user/winsrv/concfg/precomp.h b/win32ss/user/winsrv/concfg/precomp.h index 5f6ca4a333e..5efa7832a6f 100644 --- a/win32ss/user/winsrv/concfg/precomp.h +++ b/win32ss/user/winsrv/concfg/precomp.h @@ -31,7 +31,7 @@ #include #include -#include // For swprintf() +#include // For _swprintf() #include // For wcstoul() #include diff --git a/win32ss/user/winsrv/concfg/settings.c b/win32ss/user/winsrv/concfg/settings.c index 2c7624f74a7..2234ddf99cf 100644 --- a/win32ss/user/winsrv/concfg/settings.c +++ b/win32ss/user/winsrv/concfg/settings.c @@ -376,7 +376,7 @@ do { * or we are saving settings for a particular console, which differs * from the default ones. */ - swprintf(szValueName, L"ColorTable%02u", i); + _swprintf(szValueName, L"ColorTable%02u", i); SetConsoleSetting(szValueName, REG_DWORD, sizeof(DWORD), &ConsoleInfo->ColorTable[i], s_Colors[i]); }