ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
March 2013
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
14 participants
249 discussions
Start a n
N
ew thread
[akhaldi] 58541: [USBSTOR] * Fix some format specifiers.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Mar 17 15:18:15 2013 New Revision: 58541 URL:
http://svn.reactos.org/svn/reactos?rev=58541&view=rev
Log: [USBSTOR] * Fix some format specifiers. Modified: trunk/reactos/drivers/usb/usbstor/descriptor.c trunk/reactos/drivers/usb/usbstor/error.c trunk/reactos/drivers/usb/usbstor/fdo.c trunk/reactos/drivers/usb/usbstor/pdo.c Modified: trunk/reactos/drivers/usb/usbstor/descriptor.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbstor/descri…
============================================================================== --- trunk/reactos/drivers/usb/usbstor/descriptor.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbstor/descriptor.c [iso-8859-1] Sun Mar 17 15:18:15 2013 @@ -331,7 +331,7 @@ VOID DumpConfigurationDescriptor(PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor) { - DPRINT1("Dumping ConfigurationDescriptor %x\n", ConfigurationDescriptor); + DPRINT1("Dumping ConfigurationDescriptor %p\n", ConfigurationDescriptor); DPRINT1("bLength %x\n", ConfigurationDescriptor->bLength); DPRINT1("bDescriptorType %x\n", ConfigurationDescriptor->bDescriptorType); DPRINT1("wTotalLength %x\n", ConfigurationDescriptor->wTotalLength); @@ -535,7 +535,7 @@ // // WTF? usb port driver does not give us bulk pipe access // - DPRINT1("USBSTOR_GetPipeHandles> BulkInFound %d BulkOutFound %d missing!!!\n", BulkInFound, BulkOutFound); + DPRINT1("USBSTOR_GetPipeHandles> BulkInFound %c BulkOutFound %c missing!!!\n", BulkInFound, BulkOutFound); return STATUS_DEVICE_CONFIGURATION_ERROR; } Modified: trunk/reactos/drivers/usb/usbstor/error.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbstor/error.…
============================================================================== --- trunk/reactos/drivers/usb/usbstor/error.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbstor/error.c [iso-8859-1] Sun Mar 17 15:18:15 2013 @@ -42,7 +42,7 @@ // // send the request // - DPRINT1("Sending Request DeviceObject %x, Urb %x\n", DeviceObject, Urb); + DPRINT1("Sending Request DeviceObject %p, Urb %p\n", DeviceObject, Urb); Status = USBSTOR_SyncUrbRequest(DeviceObject, Urb); // @@ -90,7 +90,7 @@ // // send the request // - DPRINT1("Sending Request DeviceObject %x, Urb %x\n", DeviceObject, Urb); + DPRINT1("Sending Request DeviceObject %p, Urb %p\n", DeviceObject, Urb); Status = USBSTOR_SyncUrbRequest(DeviceObject, Urb); // Modified: trunk/reactos/drivers/usb/usbstor/fdo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbstor/fdo.c?…
============================================================================== --- trunk/reactos/drivers/usb/usbstor/fdo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbstor/fdo.c [iso-8859-1] Sun Mar 17 15:18:15 2013 @@ -14,7 +14,7 @@ VOID USBSTOR_DumpDeviceDescriptor(PUSB_DEVICE_DESCRIPTOR DeviceDescriptor) { - DPRINT1("Dumping Device Descriptor %x\n", DeviceDescriptor); + DPRINT1("Dumping Device Descriptor %p\n", DeviceDescriptor); DPRINT1("bLength %x\n", DeviceDescriptor->bLength); DPRINT1("bDescriptorType %x\n", DeviceDescriptor->bDescriptorType); DPRINT1("bcdUSB %x\n", DeviceDescriptor->bcdUSB); Modified: trunk/reactos/drivers/usb/usbstor/pdo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbstor/pdo.c?…
============================================================================== --- trunk/reactos/drivers/usb/usbstor/pdo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbstor/pdo.c [iso-8859-1] Sun Mar 17 15:18:15 2013 @@ -671,14 +671,14 @@ // // using serial number from device // - swprintf(Buffer, L"%s&%d", FDODeviceExtension->SerialNumber->bString, PDODeviceExtension->LUN); + swprintf(Buffer, L"%s&%c", FDODeviceExtension->SerialNumber->bString, PDODeviceExtension->LUN); } else { // // use instance count and LUN // - swprintf(Buffer, L"%04d&%d", FDODeviceExtension->InstanceCount, PDODeviceExtension->LUN); + swprintf(Buffer, L"%04lu&%c", FDODeviceExtension->InstanceCount, PDODeviceExtension->LUN); } // @@ -1203,7 +1203,7 @@ DPRINT1("Version %x\n", Response->Version); DPRINT1("Format %x\n", Response->Format); DPRINT1("Length %x\n", Response->Length); - DPRINT1("Reserved %x\n", Response->Reserved); + DPRINT1("Reserved %p\n", Response->Reserved); DPRINT1("Vendor %c%c%c%c%c%c%c%c\n", Response->Vendor[0], Response->Vendor[1], Response->Vendor[2], Response->Vendor[3], Response->Vendor[4], Response->Vendor[5], Response->Vendor[6], Response->Vendor[7]); DPRINT1("Product %c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c\n", Response->Product[0], Response->Product[1], Response->Product[2], Response->Product[3], Response->Product[4], Response->Product[5], Response->Product[6], Response->Product[7],
11 years, 9 months
1
0
0
0
[akhaldi] 58540: [DDK] * Annotate ntstrsafe.h.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Mar 17 15:11:55 2013 New Revision: 58540 URL:
http://svn.reactos.org/svn/reactos?rev=58540&view=rev
Log: [DDK] * Annotate ntstrsafe.h. Modified: trunk/reactos/include/ddk/ntstrsafe.h Modified: trunk/reactos/include/ddk/ntstrsafe.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ntstrsafe.h?re…
============================================================================== --- trunk/reactos/include/ddk/ntstrsafe.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/ntstrsafe.h [iso-8859-1] Sun Mar 17 15:11:55 2013 @@ -58,6 +58,11 @@ typedef const char *STRSAFE_LPCSTR; typedef wchar_t *STRSAFE_LPWSTR; typedef const wchar_t *STRSAFE_LPCWSTR; + +typedef _Null_terminated_ char *NTSTRSAFE_PSTR; +typedef _Null_terminated_ const char *NTSTRSAFE_PCSTR; +typedef _Null_terminated_ wchar_t *NTSTRSAFE_PWSTR; +typedef _Null_terminated_ const wchar_t *NTSTRSAFE_PCWSTR; typedef ULONG STRSAFE_DWORD; @@ -81,38 +86,79 @@ NTSTRSAFEAPI RtlStringVPrintfWorkerW(STRSAFE_LPWSTR pszDest,size_t cchDest,STRSAFE_LPCWSTR pszFormat,va_list argList); NTSTRSAFEAPI RtlStringVPrintfExWorkerA(STRSAFE_LPSTR pszDest,size_t cchDest,size_t cbDest,STRSAFE_LPSTR *ppszDestEnd,size_t *pcchRemaining,STRSAFE_DWORD dwFlags,STRSAFE_LPCSTR pszFormat,va_list argList); NTSTRSAFEAPI RtlStringVPrintfExWorkerW(STRSAFE_LPWSTR pszDest,size_t cchDest,size_t cbDest,STRSAFE_LPWSTR *ppszDestEnd,size_t *pcchRemaining,STRSAFE_DWORD dwFlags,STRSAFE_LPCWSTR pszFormat,va_list argList); -NTSTRSAFEAPI RtlStringLengthWorkerA(STRSAFE_LPCSTR psz,size_t cchMax,size_t *pcchLength); -NTSTRSAFEAPI RtlStringLengthWorkerW(STRSAFE_LPCWSTR psz,size_t cchMax,size_t *pcchLength); - -NTSTRSAFEAPI RtlStringCchCopyA(STRSAFE_LPSTR pszDest,size_t cchDest,STRSAFE_LPCSTR pszSrc); -NTSTRSAFEAPI RtlStringCchCopyW(STRSAFE_LPWSTR pszDest,size_t cchDest,STRSAFE_LPCWSTR pszSrc); - - -NTSTRSAFEAPI RtlStringCchCopyA(STRSAFE_LPSTR pszDest,size_t cchDest,STRSAFE_LPCSTR pszSrc) + +NTSTRSAFEAPI +RtlStringLengthWorkerA( + _In_reads_or_z_(cchMax) STRSAFE_LPCSTR psz, + _In_ _In_range_(<=, NTSTRSAFE_MAX_CCH) size_t cchMax, + _Out_opt_ _Deref_out_range_(<, cchMax) size_t *pcchLength); + +NTSTRSAFEAPI +RtlStringLengthWorkerW( + _In_reads_or_z_(cchMax) STRSAFE_LPCWSTR psz, + _In_ _In_range_(<=, NTSTRSAFE_MAX_CCH) size_t cchMax, + _Out_opt_ _Deref_out_range_(<, cchMax) size_t *pcchLength); + +NTSTRSAFEAPI +RtlStringCchCopyA( + _Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cchDest, + _In_ NTSTRSAFE_PCSTR pszSrc); + +NTSTRSAFEAPI +RtlStringCchCopyW( + _Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cchDest, + _In_ NTSTRSAFE_PCWSTR pszSrc); + +NTSTRSAFEAPI +RtlStringCchCopyA( + _Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cchDest, + _In_ NTSTRSAFE_PCSTR pszSrc) { return (cchDest > NTSTRSAFE_MAX_CCH ? STATUS_INVALID_PARAMETER : RtlStringCopyWorkerA(pszDest,cchDest,pszSrc)); } -NTSTRSAFEAPI RtlStringCchCopyW(STRSAFE_LPWSTR pszDest,size_t cchDest,STRSAFE_LPCWSTR pszSrc) +NTSTRSAFEAPI +RtlStringCchCopyW( + _Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cchDest, + _In_ NTSTRSAFE_PCWSTR pszSrc) { if (cchDest > NTSTRSAFE_MAX_CCH) return STATUS_INVALID_PARAMETER; return RtlStringCopyWorkerW(pszDest,cchDest,pszSrc); } - -NTSTRSAFEAPI RtlStringCbCopyA(STRSAFE_LPSTR pszDest,size_t cbDest,STRSAFE_LPCSTR pszSrc); -NTSTRSAFEAPI RtlStringCbCopyW(STRSAFE_LPWSTR pszDest,size_t cbDest,STRSAFE_LPCWSTR pszSrc); - - -NTSTRSAFEAPI RtlStringCbCopyA(STRSAFE_LPSTR pszDest,size_t cbDest,STRSAFE_LPCSTR pszSrc) +NTSTRSAFEAPI +RtlStringCbCopyA( + _Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cbDest, + _In_ NTSTRSAFE_PCSTR pszSrc); + +NTSTRSAFEAPI +RtlStringCbCopyW( + _Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cbDest, + _In_ NTSTRSAFE_PCWSTR pszSrc); + +NTSTRSAFEAPI +RtlStringCbCopyA( + _Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cbDest, + _In_ NTSTRSAFE_PCSTR pszSrc) { if (cbDest > NTSTRSAFE_MAX_CCH) return STATUS_INVALID_PARAMETER; return RtlStringCopyWorkerA(pszDest,cbDest,pszSrc); } -NTSTRSAFEAPI RtlStringCbCopyW(STRSAFE_LPWSTR pszDest,size_t cbDest,STRSAFE_LPCWSTR pszSrc) +NTSTRSAFEAPI +RtlStringCbCopyW( + _Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cbDest, + _In_ NTSTRSAFE_PCWSTR pszSrc) { size_t cchDest = cbDest / sizeof(wchar_t); if (cchDest > NTSTRSAFE_MAX_CCH) @@ -120,19 +166,46 @@ return RtlStringCopyWorkerW(pszDest,cchDest,pszSrc); } - -NTSTRSAFEAPI RtlStringCchCopyExA(STRSAFE_LPSTR pszDest,size_t cchDest,STRSAFE_LPCSTR pszSrc,STRSAFE_LPSTR *ppszDestEnd,size_t *pcchRemaining,STRSAFE_DWORD dwFlags); -NTSTRSAFEAPI RtlStringCchCopyExW(STRSAFE_LPWSTR pszDest,size_t cchDest,STRSAFE_LPCWSTR pszSrc,STRSAFE_LPWSTR *ppszDestEnd,size_t *pcchRemaining,STRSAFE_DWORD dwFlags); - - -NTSTRSAFEAPI RtlStringCchCopyExA(STRSAFE_LPSTR pszDest,size_t cchDest,STRSAFE_LPCSTR pszSrc,STRSAFE_LPSTR *ppszDestEnd,size_t *pcchRemaining,STRSAFE_DWORD dwFlags) +NTSTRSAFEAPI +RtlStringCchCopyExA( + _Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cchDest, + _In_ NTSTRSAFE_PCSTR pszSrc, + _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PSTR *ppszDestEnd, + _Out_opt_ size_t *pcchRemaining, + _In_ STRSAFE_DWORD dwFlags); + +NTSTRSAFEAPI +RtlStringCchCopyExW( + _Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cchDest, + _In_ NTSTRSAFE_PCWSTR pszSrc, + _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, + _Out_opt_ size_t *pcchRemaining, + _In_ STRSAFE_DWORD dwFlags); + +NTSTRSAFEAPI +RtlStringCchCopyExA( + _Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cchDest, + _In_ NTSTRSAFE_PCSTR pszSrc, + _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PSTR *ppszDestEnd, + _Out_opt_ size_t *pcchRemaining, + _In_ STRSAFE_DWORD dwFlags) { if (cchDest > NTSTRSAFE_MAX_CCH) return STATUS_INVALID_PARAMETER; return RtlStringCopyExWorkerA(pszDest,cchDest,cchDest,pszSrc,ppszDestEnd,pcchRemaining,dwFlags); } -NTSTRSAFEAPI RtlStringCchCopyExW(STRSAFE_LPWSTR pszDest,size_t cchDest,STRSAFE_LPCWSTR pszSrc,STRSAFE_LPWSTR *ppszDestEnd,size_t *pcchRemaining,STRSAFE_DWORD dwFlags) +NTSTRSAFEAPI +RtlStringCchCopyExW( + _Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cchDest, + _In_ NTSTRSAFE_PCWSTR pszSrc, + _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, + _Out_opt_ size_t *pcchRemaining, + _In_ STRSAFE_DWORD dwFlags) { size_t cbDest; if (cchDest > NTSTRSAFE_MAX_CCH) @@ -141,12 +214,32 @@ return RtlStringCopyExWorkerW(pszDest,cchDest,cbDest,pszSrc,ppszDestEnd,pcchRemaining,dwFlags); } - -NTSTRSAFEAPI RtlStringCbCopyExA(STRSAFE_LPSTR pszDest,size_t cbDest,STRSAFE_LPCSTR pszSrc,STRSAFE_LPSTR *ppszDestEnd,size_t *pcbRemaining,STRSAFE_DWORD dwFlags); -NTSTRSAFEAPI RtlStringCbCopyExW(STRSAFE_LPWSTR pszDest,size_t cbDest,STRSAFE_LPCWSTR pszSrc,STRSAFE_LPWSTR *ppszDestEnd,size_t *pcbRemaining,STRSAFE_DWORD dwFlags); - - -NTSTRSAFEAPI RtlStringCbCopyExA(STRSAFE_LPSTR pszDest,size_t cbDest,STRSAFE_LPCSTR pszSrc,STRSAFE_LPSTR *ppszDestEnd,size_t *pcbRemaining,STRSAFE_DWORD dwFlags) +NTSTRSAFEAPI +RtlStringCbCopyExA( + _Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cbDest, + _In_ NTSTRSAFE_PCSTR pszSrc, + _Outptr_opt_result_bytebuffer_(*pcbRemaining) STRSAFE_LPSTR *ppszDestEnd, + _Out_opt_ size_t *pcbRemaining, + _In_ STRSAFE_DWORD dwFlags); + +NTSTRSAFEAPI +RtlStringCbCopyExW( + _Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cbDest, + _In_ NTSTRSAFE_PCWSTR pszSrc, + _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, + _Out_opt_ size_t *pcbRemaining, + _In_ STRSAFE_DWORD dwFlags); + +NTSTRSAFEAPI +RtlStringCbCopyExA( + _Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cbDest, + _In_ NTSTRSAFE_PCSTR pszSrc, + _Outptr_opt_result_bytebuffer_(*pcbRemaining) STRSAFE_LPSTR *ppszDestEnd, + _Out_opt_ size_t *pcbRemaining, + _In_ STRSAFE_DWORD dwFlags) { NTSTATUS Status; size_t cchRemaining = 0; @@ -161,7 +254,14 @@ return Status; } -NTSTRSAFEAPI RtlStringCbCopyExW(STRSAFE_LPWSTR pszDest,size_t cbDest,STRSAFE_LPCWSTR pszSrc,STRSAFE_LPWSTR *ppszDestEnd,size_t *pcbRemaining,STRSAFE_DWORD dwFlags) +NTSTRSAFEAPI +RtlStringCbCopyExW( + _Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cbDest, + _In_ NTSTRSAFE_PCWSTR pszSrc, + _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, + _Out_opt_ size_t *pcbRemaining, + _In_ STRSAFE_DWORD dwFlags) { NTSTATUS Status; size_t cchDest = cbDest / sizeof(wchar_t); @@ -178,38 +278,77 @@ return Status; } - -NTSTRSAFEAPI RtlStringCchCopyNA(STRSAFE_LPSTR pszDest,size_t cchDest,STRSAFE_LPCSTR pszSrc,size_t cchToCopy); -NTSTRSAFEAPI RtlStringCchCopyNW(STRSAFE_LPWSTR pszDest,size_t cchDest,STRSAFE_LPCWSTR pszSrc,size_t cchToCopy); - - -NTSTRSAFEAPI RtlStringCchCopyNA(STRSAFE_LPSTR pszDest,size_t cchDest,STRSAFE_LPCSTR pszSrc,size_t cchToCopy) +NTSTRSAFEAPI +RtlStringCchCopyNA( + _Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cchDest, + _In_reads_or_z_(cchToCopy) STRSAFE_LPCSTR pszSrc, + _In_ size_t cchToCopy); + +NTSTRSAFEAPI +RtlStringCchCopyNW( + _Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cchDest, + _In_reads_or_z_(cchToCopy) STRSAFE_LPCWSTR pszSrc, + _In_ size_t cchToCopy); + + +NTSTRSAFEAPI +RtlStringCchCopyNA( + _Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cchDest, + _In_reads_or_z_(cchToCopy) STRSAFE_LPCSTR pszSrc, + _In_ size_t cchToCopy) { if (cchDest > NTSTRSAFE_MAX_CCH || cchToCopy > NTSTRSAFE_MAX_CCH) return STATUS_INVALID_PARAMETER; return RtlStringCopyNWorkerA(pszDest,cchDest,pszSrc,cchToCopy); } -NTSTRSAFEAPI RtlStringCchCopyNW(STRSAFE_LPWSTR pszDest,size_t cchDest,STRSAFE_LPCWSTR pszSrc,size_t cchToCopy) +NTSTRSAFEAPI +RtlStringCchCopyNW( + _Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cchDest, + _In_reads_or_z_(cchToCopy) STRSAFE_LPCWSTR pszSrc, + _In_ size_t cchToCopy) { if (cchDest > NTSTRSAFE_MAX_CCH || cchToCopy > NTSTRSAFE_MAX_CCH) return STATUS_INVALID_PARAMETER; return RtlStringCopyNWorkerW(pszDest,cchDest,pszSrc,cchToCopy); } - -NTSTRSAFEAPI RtlStringCbCopyNA(STRSAFE_LPSTR pszDest,size_t cbDest,STRSAFE_LPCSTR pszSrc,size_t cbToCopy); -NTSTRSAFEAPI RtlStringCbCopyNW(STRSAFE_LPWSTR pszDest,size_t cbDest,STRSAFE_LPCWSTR pszSrc,size_t cbToCopy); - - -NTSTRSAFEAPI RtlStringCbCopyNA(STRSAFE_LPSTR pszDest,size_t cbDest,STRSAFE_LPCSTR pszSrc,size_t cbToCopy) +NTSTRSAFEAPI +RtlStringCbCopyNA( + _Out_writes_bytes_(cbDest) NTSTRSAFE_PSTR pszDest, + _In_ size_t cbDest, + _In_reads_bytes_(cbToCopy) STRSAFE_LPCSTR pszSrc, + _In_ size_t cbToCopy); + +NTSTRSAFEAPI +RtlStringCbCopyNW( + _Out_writes_bytes_(cbDest) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cbDest, + _In_reads_bytes_(cbToCopy) STRSAFE_LPCWSTR pszSrc, + _In_ size_t cbToCopy); + +NTSTRSAFEAPI +RtlStringCbCopyNA( + _Out_writes_bytes_(cbDest) NTSTRSAFE_PSTR pszDest, + _In_ size_t cbDest, + _In_reads_bytes_(cbToCopy) STRSAFE_LPCSTR pszSrc, + _In_ size_t cbToCopy) { if (cbDest > NTSTRSAFE_MAX_CCH || cbToCopy > NTSTRSAFE_MAX_CCH) return STATUS_INVALID_PARAMETER; return RtlStringCopyNWorkerA(pszDest,cbDest,pszSrc,cbToCopy); } -NTSTRSAFEAPI RtlStringCbCopyNW(STRSAFE_LPWSTR pszDest,size_t cbDest,STRSAFE_LPCWSTR pszSrc,size_t cbToCopy) +NTSTRSAFEAPI +RtlStringCbCopyNW( + _Out_writes_bytes_(cbDest) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cbDest, + _In_reads_bytes_(cbToCopy) STRSAFE_LPCWSTR pszSrc, + _In_ size_t cbToCopy) { size_t cchDest = cbDest / sizeof(wchar_t); size_t cchToCopy = cbToCopy / sizeof(wchar_t); @@ -218,31 +357,85 @@ return RtlStringCopyNWorkerW(pszDest,cchDest,pszSrc,cchToCopy); } - -NTSTRSAFEAPI RtlStringCchCopyNExA(STRSAFE_LPSTR pszDest,size_t cchDest,STRSAFE_LPCSTR pszSrc,size_t cchToCopy,STRSAFE_LPSTR *ppszDestEnd,size_t *pcchRemaining,STRSAFE_DWORD dwFlags); -NTSTRSAFEAPI RtlStringCchCopyNExW(STRSAFE_LPWSTR pszDest,size_t cchDest,STRSAFE_LPCWSTR pszSrc,size_t cchToCopy,STRSAFE_LPWSTR *ppszDestEnd,size_t *pcchRemaining,STRSAFE_DWORD dwFlags); - - -NTSTRSAFEAPI RtlStringCchCopyNExA(STRSAFE_LPSTR pszDest,size_t cchDest,STRSAFE_LPCSTR pszSrc,size_t cchToCopy,STRSAFE_LPSTR *ppszDestEnd,size_t *pcchRemaining,STRSAFE_DWORD dwFlags) +NTSTRSAFEAPI +RtlStringCchCopyNExA( + _Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cchDest, + _In_reads_or_z_(cchToCopy) STRSAFE_LPCSTR pszSrc, + _In_ size_t cchToCopy, + _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PSTR *ppszDestEnd, + _Out_opt_ size_t *pcchRemaining, + _In_ STRSAFE_DWORD dwFlags); + +NTSTRSAFEAPI +RtlStringCchCopyNExW( + _Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cchDest, + _In_reads_or_z_(cchToCopy) STRSAFE_LPCWSTR pszSrc, + _In_ size_t cchToCopy, + _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, + _Out_opt_ size_t *pcchRemaining, + _In_ STRSAFE_DWORD dwFlags); + +NTSTRSAFEAPI +RtlStringCchCopyNExA( + _Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cchDest, + _In_reads_or_z_(cchToCopy) STRSAFE_LPCSTR pszSrc, + _In_ size_t cchToCopy, + _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PSTR *ppszDestEnd, + _Out_opt_ size_t *pcchRemaining, + _In_ STRSAFE_DWORD dwFlags) { if (cchDest > NTSTRSAFE_MAX_CCH) return STATUS_INVALID_PARAMETER; return RtlStringCopyNExWorkerA(pszDest,cchDest,cchDest,pszSrc,cchToCopy,ppszDestEnd,pcchRemaining,dwFlags); } -NTSTRSAFEAPI RtlStringCchCopyNExW(STRSAFE_LPWSTR pszDest,size_t cchDest,STRSAFE_LPCWSTR pszSrc,size_t cchToCopy,STRSAFE_LPWSTR *ppszDestEnd,size_t *pcchRemaining,STRSAFE_DWORD dwFlags) +NTSTRSAFEAPI +RtlStringCchCopyNExW( + _Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cchDest, + _In_reads_or_z_(cchToCopy) STRSAFE_LPCWSTR pszSrc, + _In_ size_t cchToCopy, + _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, + _Out_opt_ size_t *pcchRemaining, + _In_ STRSAFE_DWORD dwFlags) { if (cchDest > NTSTRSAFE_MAX_CCH) return STATUS_INVALID_PARAMETER; return RtlStringCopyNExWorkerW(pszDest,cchDest,cchDest * sizeof(wchar_t),pszSrc,cchToCopy,ppszDestEnd,pcchRemaining,dwFlags); } - -NTSTRSAFEAPI RtlStringCbCopyNExA(STRSAFE_LPSTR pszDest,size_t cbDest,STRSAFE_LPCSTR pszSrc,size_t cbToCopy,STRSAFE_LPSTR *ppszDestEnd,size_t *pcbRemaining,STRSAFE_DWORD dwFlags); -NTSTRSAFEAPI RtlStringCbCopyNExW(STRSAFE_LPWSTR pszDest,size_t cbDest,STRSAFE_LPCWSTR pszSrc,size_t cbToCopy,STRSAFE_LPWSTR *ppszDestEnd,size_t *pcbRemaining,STRSAFE_DWORD dwFlags); - - -NTSTRSAFEAPI RtlStringCbCopyNExA(STRSAFE_LPSTR pszDest,size_t cbDest,STRSAFE_LPCSTR pszSrc,size_t cbToCopy,STRSAFE_LPSTR *ppszDestEnd,size_t *pcbRemaining,STRSAFE_DWORD dwFlags) +NTSTRSAFEAPI +RtlStringCbCopyNExA( + _Out_writes_bytes_(cbDest) NTSTRSAFE_PSTR pszDest, + _In_ size_t cbDest, + _In_reads_bytes_(cbToCopy) STRSAFE_LPCSTR pszSrc, + _In_ size_t cbToCopy, + _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PSTR *ppszDestEnd, + _Out_opt_ size_t *pcbRemaining, + _In_ STRSAFE_DWORD dwFlags); + +NTSTRSAFEAPI +RtlStringCbCopyNExW( + _Out_writes_bytes_(cbDest) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cbDest, + _In_reads_bytes_(cbToCopy) STRSAFE_LPCWSTR pszSrc, + _In_ size_t cbToCopy, + _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, + _Out_opt_ size_t *pcbRemaining, + _In_ STRSAFE_DWORD dwFlags); + +NTSTRSAFEAPI +RtlStringCbCopyNExA( + _Out_writes_bytes_(cbDest) STRSAFE_LPSTR pszDest, + _In_ size_t cbDest, + _In_reads_bytes_(cbToCopy) STRSAFE_LPCSTR pszSrc, + _In_ size_t cbToCopy, + _Outptr_opt_result_bytebuffer_(*pcbRemaining) STRSAFE_LPSTR *ppszDestEnd, + _Out_opt_ size_t *pcbRemaining, + _In_ STRSAFE_DWORD dwFlags) { NTSTATUS Status; size_t cchRemaining = 0; @@ -255,7 +448,15 @@ return Status; } -NTSTRSAFEAPI RtlStringCbCopyNExW(STRSAFE_LPWSTR pszDest,size_t cbDest,STRSAFE_LPCWSTR pszSrc,size_t cbToCopy,STRSAFE_LPWSTR *ppszDestEnd,size_t *pcbRemaining,STRSAFE_DWORD dwFlags) +NTSTRSAFEAPI +RtlStringCbCopyNExW( + _Out_writes_bytes_(cbDest) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cbDest, + _In_reads_bytes_(cbToCopy) STRSAFE_LPCWSTR pszSrc, + _In_ size_t cbToCopy, + _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, + _Out_opt_ size_t *pcbRemaining, + _In_ STRSAFE_DWORD dwFlags) { NTSTATUS Status; size_t cchDest; @@ -272,38 +473,68 @@ return Status; } - -NTSTRSAFEAPI RtlStringCchCatA(STRSAFE_LPSTR pszDest,size_t cchDest,STRSAFE_LPCSTR pszSrc); -NTSTRSAFEAPI RtlStringCchCatW(STRSAFE_LPWSTR pszDest,size_t cchDest,STRSAFE_LPCWSTR pszSrc); - - -NTSTRSAFEAPI RtlStringCchCatA(STRSAFE_LPSTR pszDest,size_t cchDest,STRSAFE_LPCSTR pszSrc) +NTSTRSAFEAPI +RtlStringCchCatA( + _Inout_updates_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cchDest, + _In_ NTSTRSAFE_PCSTR pszSrc); + +NTSTRSAFEAPI +RtlStringCchCatW( + _Inout_updates_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cchDest, + _In_ NTSTRSAFE_PCWSTR pszSrc); + +NTSTRSAFEAPI +RtlStringCchCatA( + _Inout_updates_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cchDest, + _In_ NTSTRSAFE_PCSTR pszSrc) { if (cchDest > NTSTRSAFE_MAX_CCH) return STATUS_INVALID_PARAMETER; return RtlStringCatWorkerA(pszDest,cchDest,pszSrc); } -NTSTRSAFEAPI RtlStringCchCatW(STRSAFE_LPWSTR pszDest,size_t cchDest,STRSAFE_LPCWSTR pszSrc) +NTSTRSAFEAPI +RtlStringCchCatW( + _Inout_updates_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cchDest, + _In_ NTSTRSAFE_PCWSTR pszSrc) { if (cchDest > NTSTRSAFE_MAX_CCH) return STATUS_INVALID_PARAMETER; return RtlStringCatWorkerW(pszDest,cchDest,pszSrc); } - -NTSTRSAFEAPI RtlStringCbCatA(STRSAFE_LPSTR pszDest,size_t cbDest,STRSAFE_LPCSTR pszSrc); -NTSTRSAFEAPI RtlStringCbCatW(STRSAFE_LPWSTR pszDest,size_t cbDest,STRSAFE_LPCWSTR pszSrc); - - -NTSTRSAFEAPI RtlStringCbCatA(STRSAFE_LPSTR pszDest,size_t cbDest,STRSAFE_LPCSTR pszSrc) +NTSTRSAFEAPI +RtlStringCbCatA( + _Inout_updates_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cbDest, + _In_ NTSTRSAFE_PCSTR pszSrc); + +NTSTRSAFEAPI +RtlStringCbCatW( + _Inout_updates_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cbDest, + _In_ NTSTRSAFE_PCWSTR pszSrc); + +NTSTRSAFEAPI +RtlStringCbCatA( + _Inout_updates_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cbDest, + _In_ NTSTRSAFE_PCSTR pszSrc) { if (cbDest > NTSTRSAFE_MAX_CCH) return STATUS_INVALID_PARAMETER; return RtlStringCatWorkerA(pszDest,cbDest,pszSrc); } -NTSTRSAFEAPI RtlStringCbCatW(STRSAFE_LPWSTR pszDest,size_t cbDest,STRSAFE_LPCWSTR pszSrc) +NTSTRSAFEAPI +RtlStringCbCatW( + _Inout_updates_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cbDest, + _In_ NTSTRSAFE_PCWSTR pszSrc) { size_t cchDest = cbDest / sizeof(wchar_t); if (cchDest > NTSTRSAFE_MAX_CCH) @@ -311,19 +542,46 @@ return RtlStringCatWorkerW(pszDest,cchDest,pszSrc); } - -NTSTRSAFEAPI RtlStringCchCatExA(STRSAFE_LPSTR pszDest,size_t cchDest,STRSAFE_LPCSTR pszSrc,STRSAFE_LPSTR *ppszDestEnd,size_t *pcchRemaining,STRSAFE_DWORD dwFlags); -NTSTRSAFEAPI RtlStringCchCatExW(STRSAFE_LPWSTR pszDest,size_t cchDest,STRSAFE_LPCWSTR pszSrc,STRSAFE_LPWSTR *ppszDestEnd,size_t *pcchRemaining,STRSAFE_DWORD dwFlags); - - -NTSTRSAFEAPI RtlStringCchCatExA(STRSAFE_LPSTR pszDest,size_t cchDest,STRSAFE_LPCSTR pszSrc,STRSAFE_LPSTR *ppszDestEnd,size_t *pcchRemaining,STRSAFE_DWORD dwFlags) +NTSTRSAFEAPI +RtlStringCchCatExA( + _Inout_updates_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cchDest, + _In_ NTSTRSAFE_PCSTR pszSrc, + _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PSTR *ppszDestEnd, + _Out_opt_ size_t *pcchRemaining, + _In_ STRSAFE_DWORD dwFlags); + +NTSTRSAFEAPI +RtlStringCchCatExW( + _Inout_updates_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cchDest, + _In_ NTSTRSAFE_PCWSTR pszSrc, + _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, + _Out_opt_ size_t *pcchRemaining, + _In_ STRSAFE_DWORD dwFlags); + +NTSTRSAFEAPI +RtlStringCchCatExA( + _Inout_updates_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cchDest, + _In_ NTSTRSAFE_PCSTR pszSrc, + _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PSTR *ppszDestEnd, + _Out_opt_ size_t *pcchRemaining, + _In_ STRSAFE_DWORD dwFlags) { if (cchDest > NTSTRSAFE_MAX_CCH) return STATUS_INVALID_PARAMETER; return RtlStringCatExWorkerA(pszDest,cchDest,cchDest,pszSrc,ppszDestEnd,pcchRemaining,dwFlags); } -NTSTRSAFEAPI RtlStringCchCatExW(STRSAFE_LPWSTR pszDest,size_t cchDest,STRSAFE_LPCWSTR pszSrc,STRSAFE_LPWSTR *ppszDestEnd,size_t *pcchRemaining,STRSAFE_DWORD dwFlags) +NTSTRSAFEAPI +RtlStringCchCatExW( + _Inout_updates_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cchDest, + _In_ NTSTRSAFE_PCWSTR pszSrc, + _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, + _Out_opt_ size_t *pcchRemaining, + _In_ STRSAFE_DWORD dwFlags) { size_t cbDest = cchDest*sizeof(wchar_t); if (cchDest > NTSTRSAFE_MAX_CCH) @@ -331,12 +589,32 @@ return RtlStringCatExWorkerW(pszDest,cchDest,cbDest,pszSrc,ppszDestEnd,pcchRemaining,dwFlags); } - -NTSTRSAFEAPI RtlStringCbCatExA(STRSAFE_LPSTR pszDest,size_t cbDest,STRSAFE_LPCSTR pszSrc,STRSAFE_LPSTR *ppszDestEnd,size_t *pcbRemaining,STRSAFE_DWORD dwFlags); -NTSTRSAFEAPI RtlStringCbCatExW(STRSAFE_LPWSTR pszDest,size_t cbDest,STRSAFE_LPCWSTR pszSrc,STRSAFE_LPWSTR *ppszDestEnd,size_t *pcbRemaining,STRSAFE_DWORD dwFlags); - - -NTSTRSAFEAPI RtlStringCbCatExA(STRSAFE_LPSTR pszDest,size_t cbDest,STRSAFE_LPCSTR pszSrc,STRSAFE_LPSTR *ppszDestEnd,size_t *pcbRemaining,STRSAFE_DWORD dwFlags) +NTSTRSAFEAPI +RtlStringCbCatExA( + _Inout_updates_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cbDest, + _In_ NTSTRSAFE_PCSTR pszSrc, + _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PSTR *ppszDestEnd, + _Out_opt_ size_t *pcbRemaining, + _In_ STRSAFE_DWORD dwFlags); + +NTSTRSAFEAPI +RtlStringCbCatExW( + _Inout_updates_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cbDest, + _In_ NTSTRSAFE_PCWSTR pszSrc, + _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, + _Out_opt_ size_t *pcbRemaining, + _In_ STRSAFE_DWORD dwFlags); + +NTSTRSAFEAPI +RtlStringCbCatExA( + _Inout_updates_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cbDest, + _In_ NTSTRSAFE_PCSTR pszSrc, + _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PSTR *ppszDestEnd, + _Out_opt_ size_t *pcbRemaining, + _In_ STRSAFE_DWORD dwFlags) { NTSTATUS Status; size_t cchRemaining = 0; @@ -349,7 +627,14 @@ return Status; } -NTSTRSAFEAPI RtlStringCbCatExW(STRSAFE_LPWSTR pszDest,size_t cbDest,STRSAFE_LPCWSTR pszSrc,STRSAFE_LPWSTR *ppszDestEnd,size_t *pcbRemaining,STRSAFE_DWORD dwFlags) +NTSTRSAFEAPI +RtlStringCbCatExW( + _Inout_updates_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cbDest, + _In_ NTSTRSAFE_PCWSTR pszSrc, + _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, + _Out_opt_ size_t *pcbRemaining, + _In_ STRSAFE_DWORD dwFlags) { NTSTATUS Status; size_t cchDest = cbDest / sizeof(wchar_t); @@ -364,38 +649,76 @@ return Status; } - -NTSTRSAFEAPI RtlStringCchCatNA(STRSAFE_LPSTR pszDest,size_t cchDest,STRSAFE_LPCSTR pszSrc,size_t cchToAppend); -NTSTRSAFEAPI RtlStringCchCatNW(STRSAFE_LPWSTR pszDest,size_t cchDest,STRSAFE_LPCWSTR pszSrc,size_t cchToAppend); - - -NTSTRSAFEAPI RtlStringCchCatNA(STRSAFE_LPSTR pszDest,size_t cchDest,STRSAFE_LPCSTR pszSrc,size_t cchToAppend) +NTSTRSAFEAPI +RtlStringCchCatNA( + _Inout_updates_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cchDest, + _In_reads_or_z_(cchToAppend) STRSAFE_LPCSTR pszSrc, + _In_ size_t cchToAppend); + +NTSTRSAFEAPI +RtlStringCchCatNW( + _Inout_updates_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cchDest, + _In_reads_or_z_(cchToAppend) STRSAFE_LPCWSTR pszSrc, + _In_ size_t cchToAppend); + +NTSTRSAFEAPI +RtlStringCchCatNA( + _Inout_updates_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cchDest, + _In_reads_or_z_(cchToAppend) STRSAFE_LPCSTR pszSrc, + _In_ size_t cchToAppend) { if (cchDest > NTSTRSAFE_MAX_CCH) return STATUS_INVALID_PARAMETER; return RtlStringCatNWorkerA(pszDest,cchDest,pszSrc,cchToAppend); } -NTSTRSAFEAPI RtlStringCchCatNW(STRSAFE_LPWSTR pszDest,size_t cchDest,STRSAFE_LPCWSTR pszSrc,size_t cchToAppend) +NTSTRSAFEAPI +RtlStringCchCatNW( + _Inout_updates_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cchDest, + _In_reads_or_z_(cchToAppend) STRSAFE_LPCWSTR pszSrc, + _In_ size_t cchToAppend) { if (cchDest > NTSTRSAFE_MAX_CCH) return STATUS_INVALID_PARAMETER; return RtlStringCatNWorkerW(pszDest,cchDest,pszSrc,cchToAppend); } - -NTSTRSAFEAPI RtlStringCbCatNA(STRSAFE_LPSTR pszDest,size_t cbDest,STRSAFE_LPCSTR pszSrc,size_t cbToAppend); -NTSTRSAFEAPI RtlStringCbCatNW(STRSAFE_LPWSTR pszDest,size_t cbDest,STRSAFE_LPCWSTR pszSrc,size_t cbToAppend); - - -NTSTRSAFEAPI RtlStringCbCatNA(STRSAFE_LPSTR pszDest,size_t cbDest,STRSAFE_LPCSTR pszSrc,size_t cbToAppend) +NTSTRSAFEAPI +RtlStringCbCatNA( + _Inout_updates_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cbDest, + _In_reads_bytes_(cbToAppend) STRSAFE_LPCSTR pszSrc, + _In_ size_t cbToAppend); + +NTSTRSAFEAPI +RtlStringCbCatNW( + _Inout_updates_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cbDest, + _In_reads_bytes_(cbToAppend) STRSAFE_LPCWSTR pszSrc, + _In_ size_t cbToAppend); + +NTSTRSAFEAPI +RtlStringCbCatNA( + _Inout_updates_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cbDest, + _In_reads_bytes_(cbToAppend) STRSAFE_LPCSTR pszSrc, + _In_ size_t cbToAppend) { if (cbDest > NTSTRSAFE_MAX_CCH) return STATUS_INVALID_PARAMETER; return RtlStringCatNWorkerA(pszDest,cbDest,pszSrc,cbToAppend); } -NTSTRSAFEAPI RtlStringCbCatNW(STRSAFE_LPWSTR pszDest,size_t cbDest,STRSAFE_LPCWSTR pszSrc,size_t cbToAppend) +NTSTRSAFEAPI +RtlStringCbCatNW( + _Inout_updates_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cbDest, + _In_reads_bytes_(cbToAppend) STRSAFE_LPCWSTR pszSrc, + _In_ size_t cbToAppend) { size_t cchDest = cbDest / sizeof(wchar_t); size_t cchToAppend = cbToAppend / sizeof(wchar_t); @@ -405,31 +728,85 @@ return RtlStringCatNWorkerW(pszDest,cchDest,pszSrc,cchToAppend); } - -NTSTRSAFEAPI RtlStringCchCatNExA(STRSAFE_LPSTR pszDest,size_t cchDest,STRSAFE_LPCSTR pszSrc,size_t cchToAppend,STRSAFE_LPSTR *ppszDestEnd,size_t *pcchRemaining,STRSAFE_DWORD dwFlags); -NTSTRSAFEAPI RtlStringCchCatNExW(STRSAFE_LPWSTR pszDest,size_t cchDest,STRSAFE_LPCWSTR pszSrc,size_t cchToAppend,STRSAFE_LPWSTR *ppszDestEnd,size_t *pcchRemaining,STRSAFE_DWORD dwFlags); - - -NTSTRSAFEAPI RtlStringCchCatNExA(STRSAFE_LPSTR pszDest,size_t cchDest,STRSAFE_LPCSTR pszSrc,size_t cchToAppend,STRSAFE_LPSTR *ppszDestEnd,size_t *pcchRemaining,STRSAFE_DWORD dwFlags) +NTSTRSAFEAPI +RtlStringCchCatNExA( + _Inout_updates_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cchDest, + _In_reads_or_z_(cchToAppend) STRSAFE_LPCSTR pszSrc, + _In_ size_t cchToAppend, + _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PSTR *ppszDestEnd, + _Out_opt_ size_t *pcchRemaining, + _In_ STRSAFE_DWORD dwFlags); + +NTSTRSAFEAPI +RtlStringCchCatNExW( + _Inout_updates_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cchDest, + _In_reads_or_z_(cchToAppend) STRSAFE_LPCWSTR pszSrc, + _In_ size_t cchToAppend, + _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, + _Out_opt_ size_t *pcchRemaining, + _In_ STRSAFE_DWORD dwFlags); + +NTSTRSAFEAPI +RtlStringCchCatNExA( + _Inout_updates_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cchDest, + _In_reads_or_z_(cchToAppend) STRSAFE_LPCSTR pszSrc, + _In_ size_t cchToAppend, + _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PSTR *ppszDestEnd, + _Out_opt_ size_t *pcchRemaining, + _In_ STRSAFE_DWORD dwFlags) { if (cchDest > NTSTRSAFE_MAX_CCH) return STATUS_INVALID_PARAMETER; return RtlStringCatNExWorkerA(pszDest,cchDest,cchDest,pszSrc,cchToAppend,ppszDestEnd,pcchRemaining,dwFlags); } -NTSTRSAFEAPI RtlStringCchCatNExW(STRSAFE_LPWSTR pszDest,size_t cchDest,STRSAFE_LPCWSTR pszSrc,size_t cchToAppend,STRSAFE_LPWSTR *ppszDestEnd,size_t *pcchRemaining,STRSAFE_DWORD dwFlags) +NTSTRSAFEAPI +RtlStringCchCatNExW( + _Inout_updates_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cchDest, + _In_reads_or_z_(cchToAppend) STRSAFE_LPCWSTR pszSrc, + _In_ size_t cchToAppend, + _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, + _Out_opt_ size_t *pcchRemaining, + _In_ STRSAFE_DWORD dwFlags) { if (cchDest > NTSTRSAFE_MAX_CCH) return STATUS_INVALID_PARAMETER; return RtlStringCatNExWorkerW(pszDest,cchDest,(cchDest*sizeof(wchar_t)),pszSrc,cchToAppend,ppszDestEnd,pcchRemaining,dwFlags); } - -NTSTRSAFEAPI RtlStringCbCatNExA(STRSAFE_LPSTR pszDest,size_t cbDest,STRSAFE_LPCSTR pszSrc,size_t cbToAppend,STRSAFE_LPSTR *ppszDestEnd,size_t *pcbRemaining,STRSAFE_DWORD dwFlags); -NTSTRSAFEAPI RtlStringCbCatNExW(STRSAFE_LPWSTR pszDest,size_t cbDest,STRSAFE_LPCWSTR pszSrc,size_t cbToAppend,STRSAFE_LPWSTR *ppszDestEnd,size_t *pcbRemaining,STRSAFE_DWORD dwFlags); - - -NTSTRSAFEAPI RtlStringCbCatNExA(STRSAFE_LPSTR pszDest,size_t cbDest,STRSAFE_LPCSTR pszSrc,size_t cbToAppend,STRSAFE_LPSTR *ppszDestEnd,size_t *pcbRemaining,STRSAFE_DWORD dwFlags) +NTSTRSAFEAPI +RtlStringCbCatNExA( + _Inout_updates_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cbDest, + _In_reads_bytes_(cbToAppend) STRSAFE_LPCSTR pszSrc, + _In_ size_t cbToAppend, + _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PSTR *ppszDestEnd, + _Out_opt_ size_t *pcbRemaining, + _In_ STRSAFE_DWORD dwFlags); + +NTSTRSAFEAPI +RtlStringCbCatNExW( + _Inout_updates_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cbDest, + _In_reads_bytes_(cbToAppend) STRSAFE_LPCWSTR pszSrc, + _In_ size_t cbToAppend, + _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, + _Out_opt_ size_t *pcbRemaining, + _In_ STRSAFE_DWORD dwFlags); + +NTSTRSAFEAPI +RtlStringCbCatNExA( + _Inout_updates_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cbDest, + _In_reads_bytes_(cbToAppend) STRSAFE_LPCSTR pszSrc, + _In_ size_t cbToAppend, + _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PSTR *ppszDestEnd, + _Out_opt_ size_t *pcbRemaining, + _In_ STRSAFE_DWORD dwFlags) { NTSTATUS Status; size_t cchRemaining = 0; @@ -442,7 +819,15 @@ return Status; } -NTSTRSAFEAPI RtlStringCbCatNExW(STRSAFE_LPWSTR pszDest,size_t cbDest,STRSAFE_LPCWSTR pszSrc,size_t cbToAppend,STRSAFE_LPWSTR *ppszDestEnd,size_t *pcbRemaining,STRSAFE_DWORD dwFlags) +NTSTRSAFEAPI +RtlStringCbCatNExW( + _Inout_updates_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cbDest, + _In_reads_bytes_(cbToAppend) STRSAFE_LPCWSTR pszSrc, + _In_ size_t cbToAppend, + _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, + _Out_opt_ size_t *pcbRemaining, + _In_ STRSAFE_DWORD dwFlags) { NTSTATUS Status; size_t cchDest = cbDest / sizeof(wchar_t); @@ -457,38 +842,76 @@ return Status; } - -NTSTRSAFEAPI RtlStringCchVPrintfA(STRSAFE_LPSTR pszDest,size_t cchDest,STRSAFE_LPCSTR pszFormat,va_list argList); -NTSTRSAFEAPI RtlStringCchVPrintfW(STRSAFE_LPWSTR pszDest,size_t cchDest,STRSAFE_LPCWSTR pszFormat,va_list argList); - - -NTSTRSAFEAPI RtlStringCchVPrintfA(STRSAFE_LPSTR pszDest,size_t cchDest,STRSAFE_LPCSTR pszFormat,va_list argList) +NTSTRSAFEAPI +RtlStringCchVPrintfA( + _Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cchDest, + _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat, + _In_ va_list argList); + +NTSTRSAFEAPI +RtlStringCchVPrintfW( + _Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cchDest, + _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat, + _In_ va_list argList); + +NTSTRSAFEAPI +RtlStringCchVPrintfA( + _Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cchDest, + _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat, + _In_ va_list argList) { if (cchDest > NTSTRSAFE_MAX_CCH) return STATUS_INVALID_PARAMETER; return RtlStringVPrintfWorkerA(pszDest,cchDest,pszFormat,argList); } -NTSTRSAFEAPI RtlStringCchVPrintfW(STRSAFE_LPWSTR pszDest,size_t cchDest,STRSAFE_LPCWSTR pszFormat,va_list argList) +NTSTRSAFEAPI +RtlStringCchVPrintfW( + _Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cchDest, + _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat, + _In_ va_list argList) { if (cchDest > NTSTRSAFE_MAX_CCH) return STATUS_INVALID_PARAMETER; return RtlStringVPrintfWorkerW(pszDest,cchDest,pszFormat,argList); } - -NTSTRSAFEAPI RtlStringCbVPrintfA(STRSAFE_LPSTR pszDest,size_t cbDest,STRSAFE_LPCSTR pszFormat,va_list argList); -NTSTRSAFEAPI RtlStringCbVPrintfW(STRSAFE_LPWSTR pszDest,size_t cbDest,STRSAFE_LPCWSTR pszFormat,va_list argList); - - -NTSTRSAFEAPI RtlStringCbVPrintfA(STRSAFE_LPSTR pszDest,size_t cbDest,STRSAFE_LPCSTR pszFormat,va_list argList) +NTSTRSAFEAPI +RtlStringCbVPrintfA( + _Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cbDest, + _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat, + _In_ va_list argList); + +NTSTRSAFEAPI +RtlStringCbVPrintfW( + _Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cbDest, + _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat, + _In_ va_list argList); + +NTSTRSAFEAPI +RtlStringCbVPrintfA( + _Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cbDest, + _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat, + _In_ va_list argList) { if (cbDest > NTSTRSAFE_MAX_CCH) return STATUS_INVALID_PARAMETER; return RtlStringVPrintfWorkerA(pszDest,cbDest,pszFormat,argList); } -NTSTRSAFEAPI RtlStringCbVPrintfW(STRSAFE_LPWSTR pszDest,size_t cbDest,STRSAFE_LPCWSTR pszFormat,va_list argList) +NTSTRSAFEAPI +RtlStringCbVPrintfW( + _Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cbDest, + _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat, + _In_ va_list argList) { size_t cchDest = cbDest / sizeof(wchar_t); if (cchDest > NTSTRSAFE_MAX_CCH) @@ -496,12 +919,26 @@ return RtlStringVPrintfWorkerW(pszDest,cchDest,pszFormat,argList); } - -NTSTRSAFEAPI RtlStringCchPrintfA(STRSAFE_LPSTR pszDest,size_t cchDest,STRSAFE_LPCSTR pszFormat,...); -NTSTRSAFEAPI RtlStringCchPrintfW(STRSAFE_LPWSTR pszDest,size_t cchDest,STRSAFE_LPCWSTR pszFormat,...); - - -NTSTRSAFEAPI RtlStringCchPrintfA(STRSAFE_LPSTR pszDest,size_t cchDest,STRSAFE_LPCSTR pszFormat,...) +NTSTRSAFEAPI +RtlStringCchPrintfA( + _Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cchDest, + _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat, + ...); + +NTSTRSAFEAPI +RtlStringCchPrintfW( + _Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cchDest, + _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat, + ...); + +NTSTRSAFEAPI +RtlStringCchPrintfA( + _Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cchDest, + _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat, + ...) { NTSTATUS Status; va_list argList; @@ -513,7 +950,12 @@ return Status; } -NTSTRSAFEAPI RtlStringCchPrintfW(STRSAFE_LPWSTR pszDest,size_t cchDest,STRSAFE_LPCWSTR pszFormat,...) +NTSTRSAFEAPI +RtlStringCchPrintfW( + _Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cchDest, + _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat, + ...) { NTSTATUS Status; va_list argList; @@ -525,12 +967,26 @@ return Status; } - -NTSTRSAFEAPI RtlStringCbPrintfA(STRSAFE_LPSTR pszDest,size_t cbDest,STRSAFE_LPCSTR pszFormat,...); -NTSTRSAFEAPI RtlStringCbPrintfW(STRSAFE_LPWSTR pszDest,size_t cbDest,STRSAFE_LPCWSTR pszFormat,...); - - -NTSTRSAFEAPI RtlStringCbPrintfA(STRSAFE_LPSTR pszDest,size_t cbDest,STRSAFE_LPCSTR pszFormat,...) +NTSTRSAFEAPI +RtlStringCbPrintfA( + _Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cbDest, + _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat, + ...); + +NTSTRSAFEAPI +RtlStringCbPrintfW( + _Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cbDest, + _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat, + ...); + +NTSTRSAFEAPI +RtlStringCbPrintfA( + _Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cbDest, + _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat, + ...) { NTSTATUS Status; va_list argList; @@ -542,7 +998,12 @@ return Status; } -NTSTRSAFEAPI RtlStringCbPrintfW(STRSAFE_LPWSTR pszDest,size_t cbDest,STRSAFE_LPCWSTR pszFormat,...) +NTSTRSAFEAPI +RtlStringCbPrintfW( + _Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cbDest, + _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat, + ...) { NTSTATUS Status; va_list argList; @@ -555,12 +1016,35 @@ return Status; } - -NTSTRSAFEAPI RtlStringCchPrintfExA(STRSAFE_LPSTR pszDest,size_t cchDest,STRSAFE_LPSTR *ppszDestEnd,size_t *pcchRemaining,STRSAFE_DWORD dwFlags,STRSAFE_LPCSTR pszFormat,...); -NTSTRSAFEAPI RtlStringCchPrintfExW(STRSAFE_LPWSTR pszDest,size_t cchDest,STRSAFE_LPWSTR *ppszDestEnd,size_t *pcchRemaining,STRSAFE_DWORD dwFlags,STRSAFE_LPCWSTR pszFormat,...); - - -NTSTRSAFEAPI RtlStringCchPrintfExA(STRSAFE_LPSTR pszDest,size_t cchDest,STRSAFE_LPSTR *ppszDestEnd,size_t *pcchRemaining,STRSAFE_DWORD dwFlags,STRSAFE_LPCSTR pszFormat,...) +NTSTRSAFEAPI +RtlStringCchPrintfExA( + _Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cchDest, + _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PSTR *ppszDestEnd, + _Out_opt_ size_t *pcchRemaining, + _In_ STRSAFE_DWORD dwFlags, + _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat, + ...); + +NTSTRSAFEAPI +RtlStringCchPrintfExW( + _Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cchDest, + _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, + _Out_opt_ size_t *pcchRemaining, + _In_ STRSAFE_DWORD dwFlags, + _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat, + ...); + +NTSTRSAFEAPI +RtlStringCchPrintfExA( + _Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cchDest, + _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PSTR *ppszDestEnd, + _Out_opt_ size_t *pcchRemaining, + _In_ STRSAFE_DWORD dwFlags, + _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat, + ...) { NTSTATUS Status; va_list argList; @@ -572,7 +1056,15 @@ return Status; } -NTSTRSAFEAPI RtlStringCchPrintfExW(STRSAFE_LPWSTR pszDest,size_t cchDest,STRSAFE_LPWSTR *ppszDestEnd,size_t *pcchRemaining,STRSAFE_DWORD dwFlags,STRSAFE_LPCWSTR pszFormat,...) +NTSTRSAFEAPI +RtlStringCchPrintfExW( + _Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cchDest, + _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, + _Out_opt_ size_t *pcchRemaining, + _In_ STRSAFE_DWORD dwFlags, + _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat, + ...) { NTSTATUS Status; size_t cbDest = cchDest * sizeof(wchar_t); @@ -585,12 +1077,35 @@ return Status; } - -NTSTRSAFEAPI RtlStringCbPrintfExA(STRSAFE_LPSTR pszDest,size_t cbDest,STRSAFE_LPSTR *ppszDestEnd,size_t *pcbRemaining,STRSAFE_DWORD dwFlags,STRSAFE_LPCSTR pszFormat,...); -NTSTRSAFEAPI RtlStringCbPrintfExW(STRSAFE_LPWSTR pszDest,size_t cbDest,STRSAFE_LPWSTR *ppszDestEnd,size_t *pcbRemaining,STRSAFE_DWORD dwFlags,STRSAFE_LPCWSTR pszFormat,...); - - -NTSTRSAFEAPI RtlStringCbPrintfExA(STRSAFE_LPSTR pszDest,size_t cbDest,STRSAFE_LPSTR *ppszDestEnd,size_t *pcbRemaining,STRSAFE_DWORD dwFlags,STRSAFE_LPCSTR pszFormat,...) +NTSTRSAFEAPI +RtlStringCbPrintfExA( + _Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cbDest, + _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PSTR *ppszDestEnd, + _Out_opt_ size_t *pcbRemaining, + _In_ STRSAFE_DWORD dwFlags, + _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat, + ...); + +NTSTRSAFEAPI +RtlStringCbPrintfExW( + _Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cbDest, + _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, + _Out_opt_ size_t *pcbRemaining, + _In_ STRSAFE_DWORD dwFlags, + _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat, + ...); + +NTSTRSAFEAPI +RtlStringCbPrintfExA( + _Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cbDest, + _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PSTR *ppszDestEnd, + _Out_opt_ size_t *pcbRemaining, + _In_ STRSAFE_DWORD dwFlags, + _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat, + ...) { NTSTATUS Status; size_t cchDest; @@ -615,7 +1130,15 @@ return Status; } -NTSTRSAFEAPI RtlStringCbPrintfExW(STRSAFE_LPWSTR pszDest,size_t cbDest,STRSAFE_LPWSTR *ppszDestEnd,size_t *pcbRemaining,STRSAFE_DWORD dwFlags,STRSAFE_LPCWSTR pszFormat,...) +NTSTRSAFEAPI +RtlStringCbPrintfExW( + _Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cbDest, + _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, + _Out_opt_ size_t *pcbRemaining, + _In_ STRSAFE_DWORD dwFlags, + _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat, + ...) { NTSTATUS Status; size_t cchDest; @@ -640,12 +1163,35 @@ return Status; } - -NTSTRSAFEAPI RtlStringCchVPrintfExA(STRSAFE_LPSTR pszDest,size_t cchDest,STRSAFE_LPSTR *ppszDestEnd,size_t *pcchRemaining,STRSAFE_DWORD dwFlags,STRSAFE_LPCSTR pszFormat,va_list argList); -NTSTRSAFEAPI RtlStringCchVPrintfExW(STRSAFE_LPWSTR pszDest,size_t cchDest,STRSAFE_LPWSTR *ppszDestEnd,size_t *pcchRemaining,STRSAFE_DWORD dwFlags,STRSAFE_LPCWSTR pszFormat,va_list argList); - - -NTSTRSAFEAPI RtlStringCchVPrintfExA(STRSAFE_LPSTR pszDest,size_t cchDest,STRSAFE_LPSTR *ppszDestEnd,size_t *pcchRemaining,STRSAFE_DWORD dwFlags,STRSAFE_LPCSTR pszFormat,va_list argList) +NTSTRSAFEAPI +RtlStringCchVPrintfExA( + _Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cchDest, + _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PSTR *ppszDestEnd, + _Out_opt_ size_t *pcchRemaining, + _In_ STRSAFE_DWORD dwFlags, + _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat, + _In_ va_list argList); + +NTSTRSAFEAPI +RtlStringCchVPrintfExW( + _Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cchDest, + _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, + _Out_opt_ size_t *pcchRemaining, + _In_ STRSAFE_DWORD dwFlags, + _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat, + _In_ va_list argList); + +NTSTRSAFEAPI +RtlStringCchVPrintfExA( + _Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, + _In_ size_t cchDest, + _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PSTR *ppszDestEnd, + _Out_opt_ size_t *pcchRemaining, + _In_ STRSAFE_DWORD dwFlags, + _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat, + _In_ va_list argList) { NTSTATUS Status; if (cchDest > NTSTRSAFE_MAX_CCH) @@ -659,7 +1205,15 @@ return Status; } -NTSTRSAFEAPI RtlStringCchVPrintfExW(STRSAFE_LPWSTR pszDest,size_t cchDest,STRSAFE_LPWSTR *ppszDestEnd,size_t *pcchRemaining,STRSAFE_DWORD dwFlags,STRSAFE_LPCWSTR pszFormat,va_list argList) +NTSTRSAFEAPI +RtlStringCchVPrintfExW( + _Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cchDest, + _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, + _Out_opt_ size_t *pcchRemaining, + _In_ STRSAFE_DWORD dwFlags, + _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat, + _In_ va_list argList) { NTSTATUS Status; if (cchDest > NTSTRSAFE_MAX_CCH) @@ -673,12 +1227,35 @@ return Status; } - -NTSTRSAFEAPI RtlStringCbVPrintfExA(STRSAFE_LPSTR pszDest,size_t cbDest,STRSAFE_LPSTR *ppszDestEnd,size_t *pcbRemaining,STRSAFE_DWORD dwFlags,STRSAFE_LPCSTR pszFormat,va_list argList); -NTSTRSAFEAPI RtlStringCbVPrintfExW(STRSAFE_LPWSTR pszDest,size_t cbDest,STRSAFE_LPWSTR *ppszDestEnd,size_t *pcbRemaining,STRSAFE_DWORD dwFlags,STRSAFE_LPCWSTR pszFormat,va_list argList); - - -NTSTRSAFEAPI RtlStringCbVPrintfExA(STRSAFE_LPSTR pszDest,size_t cbDest,STRSAFE_LPSTR *ppszDestEnd,size_t *pcbRemaining,STRSAFE_DWORD dwFlags,STRSAFE_LPCSTR pszFormat,va_list argList) +NTSTRSAFEAPI +RtlStringCbVPrintfExA( + _Out_writes_bytes_(cbDest) NTSTRSAFE_PSTR pszDest, + _In_ size_t cbDest, + _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PSTR *ppszDestEnd, + _Out_opt_ size_t *pcbRemaining, + _In_ STRSAFE_DWORD dwFlags, + _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat, + _In_ va_list argList); + +NTSTRSAFEAPI +RtlStringCbVPrintfExW( + _Out_writes_bytes_(cbDest) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cbDest, + _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, + _Out_opt_ size_t *pcbRemaining, + _In_ STRSAFE_DWORD dwFlags, + _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat, + _In_ va_list argList); + +NTSTRSAFEAPI +RtlStringCbVPrintfExA( + _Out_writes_bytes_(cbDest) NTSTRSAFE_PSTR pszDest, + _In_ size_t cbDest, + _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PSTR *ppszDestEnd, + _Out_opt_ size_t *pcbRemaining, + _In_ STRSAFE_DWORD dwFlags, + _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat, + _In_ va_list argList) { NTSTATUS Status; size_t cchDest; @@ -698,7 +1275,15 @@ return Status; } -NTSTRSAFEAPI RtlStringCbVPrintfExW(STRSAFE_LPWSTR pszDest,size_t cbDest,STRSAFE_LPWSTR *ppszDestEnd,size_t *pcbRemaining,STRSAFE_DWORD dwFlags,STRSAFE_LPCWSTR pszFormat,va_list argList) +NTSTRSAFEAPI +RtlStringCbVPrintfExW( + _Out_writes_bytes_(cbDest) NTSTRSAFE_PWSTR pszDest, + _In_ size_t cbDest, + _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, + _Out_opt_ size_t *pcbRemaining, + _In_ STRSAFE_DWORD dwFlags, + _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat, + _In_ va_list argList) { NTSTATUS Status; size_t cchDest; @@ -719,11 +1304,26 @@ } -NTSTRSAFEAPI RtlStringCchLengthA(STRSAFE_LPCSTR psz,size_t cchMax,size_t *pcchLength); -NTSTRSAFEAPI RtlStringCchLengthW(STRSAFE_LPCWSTR psz,size_t cchMax,size_t *pcchLength); - - -NTSTRSAFEAPI RtlStringCchLengthA(STRSAFE_LPCSTR psz,size_t cchMax,size_t *pcchLength) +_Must_inspect_result_ +NTSTRSAFEAPI +RtlStringCchLengthA( + _In_reads_or_z_(cchMax) STRSAFE_LPCSTR psz, + _In_ _In_range_(1, NTSTRSAFE_MAX_CCH) size_t cchMax, + _Out_opt_ _Deref_out_range_(<, cchMax) _Deref_out_range_(<=, _String_length_(psz)) size_t *pcchLength); + +_Must_inspect_result_ +NTSTRSAFEAPI +RtlStringCchLengthW( + _In_reads_or_z_(cchMax) STRSAFE_LPCWSTR psz, + _In_ _In_range_(1, NTSTRSAFE_MAX_CCH) size_t cchMax, + _Out_opt_ _Deref_out_range_(<, cchMax) _Deref_out_range_(<=, _String_length_(psz)) size_t *pcchLength); + +_Must_inspect_result_ +NTSTRSAFEAPI +RtlStringCchLengthA( + _In_reads_or_z_(cchMax) STRSAFE_LPCSTR psz, + _In_ _In_range_(1, NTSTRSAFE_MAX_CCH) size_t cchMax, + _Out_opt_ _Deref_out_range_(<, cchMax) _Deref_out_range_(<=, _String_length_(psz)) size_t *pcchLength) { NTSTATUS Status; if (!psz || (cchMax > NTSTRSAFE_MAX_CCH)) @@ -737,7 +1337,12 @@ return Status; } -NTSTRSAFEAPI RtlStringCchLengthW(STRSAFE_LPCWSTR psz,size_t cchMax,size_t *pcchLength) +_Must_inspect_result_ +NTSTRSAFEAPI +RtlStringCchLengthW( + _In_reads_or_z_(cchMax) STRSAFE_LPCWSTR psz, + _In_ _In_range_(1, NTSTRSAFE_MAX_CCH) size_t cchMax, + _Out_opt_ _Deref_out_range_(<, cchMax) _Deref_out_range_(<=, _String_length_(psz)) size_t *pcchLength) { NTSTATUS Status; if (!psz || (cchMax > NTSTRSAFE_MAX_CCH)) @@ -751,12 +1356,26 @@ return Status; } - -NTSTRSAFEAPI RtlStringCbLengthA(STRSAFE_LPCSTR psz,size_t cbMax,size_t *pcbLength); -NTSTRSAFEAPI RtlStringCbLengthW(STRSAFE_LPCWSTR psz,size_t cbMax,size_t *pcbLength); - - -NTSTRSAFEAPI RtlStringCbLengthA(STRSAFE_LPCSTR psz,size_t cbMax,size_t *pcbLength) +_Must_inspect_result_ +NTSTRSAFEAPI +RtlStringCbLengthA( + _In_reads_or_z_(cbMax) STRSAFE_LPCSTR psz, + _In_ _In_range_(1, NTSTRSAFE_MAX_CCH * sizeof(char)) size_t cbMax, + _Out_opt_ _Deref_out_range_(<, cbMax) size_t *pcbLength); + +_Must_inspect_result_ +NTSTRSAFEAPI +RtlStringCbLengthW( + _In_reads_or_z_(cbMax / sizeof(wchar_t)) STRSAFE_LPCWSTR psz, + _In_ _In_range_(1, NTSTRSAFE_MAX_CCH * sizeof(wchar_t)) size_t cbMax, + _Out_opt_ _Deref_out_range_(<, cbMax - 1) size_t *pcbLength); + +_Must_inspect_result_ +NTSTRSAFEAPI +RtlStringCbLengthA( + _In_reads_or_z_(cbMax) STRSAFE_LPCSTR psz, + _In_ _In_range_(1, NTSTRSAFE_MAX_CCH * sizeof(char)) size_t cbMax, + _Out_opt_ _Deref_out_range_(<, cbMax) size_t *pcbLength) { NTSTATUS Status; size_t cchMax; @@ -780,7 +1399,12 @@ return Status; } -NTSTRSAFEAPI RtlStringCbLengthW(STRSAFE_LPCWSTR psz,size_t cbMax,size_t *pcbLength) +_Must_inspect_result_ +NTSTRSAFEAPI +RtlStringCbLengthW( + _In_reads_or_z_(cbMax / sizeof(wchar_t)) STRSAFE_LPCWSTR psz, + _In_ _In_range_(1, NTSTRSAFE_MAX_CCH * sizeof(wchar_t)) size_t cbMax, + _Out_opt_ _Deref_out_range_(<, cbMax - 1) size_t *pcbLength) { NTSTATUS Status; size_t cchMax; @@ -2004,7 +2628,11 @@ return Status; } -NTSTRSAFEAPI RtlStringLengthWorkerA(STRSAFE_LPCSTR psz,size_t cchMax,size_t *pcchLength) +NTSTRSAFEAPI +RtlStringLengthWorkerA( + _In_reads_or_z_(cchMax) STRSAFE_LPCSTR psz, + _In_ _In_range_(<=, NTSTRSAFE_MAX_CCH) size_t cchMax, + _Out_opt_ _Deref_out_range_(<, cchMax) size_t *pcchLength) { NTSTATUS Status = STATUS_SUCCESS; size_t cchMaxPrev = cchMax; @@ -2025,7 +2653,11 @@ return Status; } -NTSTRSAFEAPI RtlStringLengthWorkerW(STRSAFE_LPCWSTR psz,size_t cchMax,size_t *pcchLength) +NTSTRSAFEAPI +RtlStringLengthWorkerW( + _In_reads_or_z_(cchMax) STRSAFE_LPCWSTR psz, + _In_ _In_range_(<=, NTSTRSAFE_MAX_CCH) size_t cchMax, + _Out_opt_ _Deref_out_range_(<, cchMax) size_t *pcchLength) { NTSTATUS Status = STATUS_SUCCESS; size_t cchMaxPrev = cchMax; @@ -2045,8 +2677,6 @@ } return Status; } - - #define RtlStringCopyWorkerA RtlStringCopyWorkerA_instead_use_StringCchCopyA_or_StringCchCopyExA; #define RtlStringCopyWorkerW RtlStringCopyWorkerW_instead_use_StringCchCopyW_or_StringCchCopyExW;
11 years, 9 months
1
0
0
0
[akhaldi] 58539: [LIBUSB] * Fix some format specifiers.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Mar 17 15:11:05 2013 New Revision: 58539 URL:
http://svn.reactos.org/svn/reactos?rev=58539&view=rev
Log: [LIBUSB] * Fix some format specifiers. Modified: trunk/reactos/lib/drivers/libusb/hcd_controller.cpp trunk/reactos/lib/drivers/libusb/hub_controller.cpp trunk/reactos/lib/drivers/libusb/usb_device.cpp Modified: trunk/reactos/lib/drivers/libusb/hcd_controller.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/libusb/hcd_con…
============================================================================== --- trunk/reactos/lib/drivers/libusb/hcd_controller.cpp [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/libusb/hcd_controller.cpp [iso-8859-1] Sun Mar 17 15:11:05 2013 @@ -635,7 +635,7 @@ // // construct device name // - swprintf(CharDeviceName, L"\\Device\\USBFDO-%d", UsbDeviceNumber); + swprintf(CharDeviceName, L"\\Device\\USBFDO-%lu", UsbDeviceNumber); // // initialize device name @@ -706,8 +706,8 @@ // // create legacy link // - swprintf(LinkName, L"\\DosDevices\\HCD%d", m_FDODeviceNumber); - swprintf(FDOName, L"\\Device\\USBFDO-%d", m_FDODeviceNumber); + swprintf(LinkName, L"\\DosDevices\\HCD%lu", m_FDODeviceNumber); + swprintf(FDOName, L"\\Device\\USBFDO-%lu", m_FDODeviceNumber); RtlInitUnicodeString(&Link, LinkName); RtlInitUnicodeString(&FDO, FDOName); @@ -729,7 +729,7 @@ // // create legacy link // - swprintf(LinkName, L"\\DosDevices\\HCD%d", m_FDODeviceNumber); + swprintf(LinkName, L"\\DosDevices\\HCD%lu", m_FDODeviceNumber); RtlInitUnicodeString(&Link, LinkName); // Modified: trunk/reactos/lib/drivers/libusb/hub_controller.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/libusb/hub_con…
============================================================================== --- trunk/reactos/lib/drivers/libusb/hub_controller.cpp [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/libusb/hub_controller.cpp [iso-8859-1] Sun Mar 17 15:11:05 2013 @@ -321,7 +321,7 @@ { m_Hardware->GetPortStatus(PortId, &PortStatus, &PortChange); - DPRINT1("[%S] Port %d: Status %x, Change %x\n", m_USBType, PortId, PortStatus, PortChange); + DPRINT1("[%S] Port %lu: Status %x, Change %x\n", m_USBType, PortId, PortStatus, PortChange); // @@ -329,7 +329,7 @@ // if (PortChange != 0) { - DPRINT1("[%S] Change state on port %d\n", m_USBType, PortId); + DPRINT1("[%S] Change state on port %lu\n", m_USBType, PortId); // Set the value for the port number *TransferBuffer = 1 << ((PortId + 1) & 7); Changed = TRUE; @@ -1798,8 +1798,8 @@ DPRINT1("URB_FUNCTION_CLASS_ENDPOINT\n"); DPRINT1("TransferFlags %x\n", Urb->UrbControlVendorClassRequest.TransferFlags); DPRINT1("TransferBufferLength %x\n", Urb->UrbControlVendorClassRequest.TransferBufferLength); - DPRINT1("TransferBuffer %x\n", Urb->UrbControlVendorClassRequest.TransferBuffer); - DPRINT1("TransferBufferMDL %x\n", Urb->UrbControlVendorClassRequest.TransferBufferMDL); + DPRINT1("TransferBuffer %p\n", Urb->UrbControlVendorClassRequest.TransferBuffer); + DPRINT1("TransferBufferMDL %p\n", Urb->UrbControlVendorClassRequest.TransferBufferMDL); DPRINT1("RequestTypeReservedBits %x\n", Urb->UrbControlVendorClassRequest.RequestTypeReservedBits); DPRINT1("Request %x\n", Urb->UrbControlVendorClassRequest.Request); DPRINT1("Value %x\n", Urb->UrbControlVendorClassRequest.Value); @@ -2141,8 +2141,8 @@ DPRINT1("URB_FUNCTION_CLASS_INTERFACE\n"); DPRINT1("TransferFlags %x\n", Urb->UrbControlVendorClassRequest.TransferFlags); DPRINT1("TransferBufferLength %x\n", Urb->UrbControlVendorClassRequest.TransferBufferLength); - DPRINT1("TransferBuffer %x\n", Urb->UrbControlVendorClassRequest.TransferBuffer); - DPRINT1("TransferBufferMDL %x\n", Urb->UrbControlVendorClassRequest.TransferBufferMDL); + DPRINT1("TransferBuffer %p\n", Urb->UrbControlVendorClassRequest.TransferBuffer); + DPRINT1("TransferBufferMDL %p\n", Urb->UrbControlVendorClassRequest.TransferBufferMDL); DPRINT1("RequestTypeReservedBits %x\n", Urb->UrbControlVendorClassRequest.RequestTypeReservedBits); DPRINT1("Request %x\n", Urb->UrbControlVendorClassRequest.Request); DPRINT1("Value %x\n", Urb->UrbControlVendorClassRequest.Value); @@ -3853,7 +3853,7 @@ // // construct device name // - swprintf(CharDeviceName, L"\\Device\\USBPDO-%d", UsbDeviceNumber); + swprintf(CharDeviceName, L"\\Device\\USBPDO-%lu", UsbDeviceNumber); // // initialize device name Modified: trunk/reactos/lib/drivers/libusb/usb_device.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/libusb/usb_dev…
============================================================================== --- trunk/reactos/lib/drivers/libusb/usb_device.cpp [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/libusb/usb_device.cpp [iso-8859-1] Sun Mar 17 15:11:05 2013 @@ -844,7 +844,7 @@ VOID CUSBDevice::DumpDeviceDescriptor(PUSB_DEVICE_DESCRIPTOR DeviceDescriptor) { - DPRINT1("Dumping Device Descriptor %x\n", DeviceDescriptor); + DPRINT1("Dumping Device Descriptor %p\n", DeviceDescriptor); DPRINT1("bLength %x\n", DeviceDescriptor->bLength); DPRINT1("bDescriptorType %x\n", DeviceDescriptor->bDescriptorType); DPRINT1("bcdUSB %x\n", DeviceDescriptor->bcdUSB); @@ -865,7 +865,7 @@ VOID CUSBDevice::DumpConfigurationDescriptor(PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor) { - DPRINT1("Dumping ConfigurationDescriptor %x\n", ConfigurationDescriptor); + DPRINT1("Dumping ConfigurationDescriptor %p\n", ConfigurationDescriptor); DPRINT1("bLength %x\n", ConfigurationDescriptor->bLength); DPRINT1("bDescriptorType %x\n", ConfigurationDescriptor->bDescriptorType); DPRINT1("wTotalLength %x\n", ConfigurationDescriptor->wTotalLength); @@ -1247,10 +1247,10 @@ // copy pipe handle DPRINT1("PipeIndex %lu\n", PipeIndex); DPRINT1("EndpointAddress %x\n", InterfaceInfo->Pipes[PipeIndex].EndpointAddress); - DPRINT1("Interval %d\n", InterfaceInfo->Pipes[PipeIndex].Interval); - DPRINT1("MaximumPacketSize %d\n", InterfaceInfo->Pipes[PipeIndex].MaximumPacketSize); - DPRINT1("MaximumTransferSize %d\n", InterfaceInfo->Pipes[PipeIndex].MaximumTransferSize); - DPRINT1("PipeFlags %d\n", InterfaceInfo->Pipes[PipeIndex].PipeFlags); + DPRINT1("Interval %c\n", InterfaceInfo->Pipes[PipeIndex].Interval); + DPRINT1("MaximumPacketSize %hu\n", InterfaceInfo->Pipes[PipeIndex].MaximumPacketSize); + DPRINT1("MaximumTransferSize %lu\n", InterfaceInfo->Pipes[PipeIndex].MaximumTransferSize); + DPRINT1("PipeFlags %lu\n", InterfaceInfo->Pipes[PipeIndex].PipeFlags); DPRINT1("PipeType %d\n", InterfaceInfo->Pipes[PipeIndex].PipeType); DPRINT1("UsbEndPoint %x\n", InterfaceInfo->Pipes[PipeIndex].EndpointAddress);
11 years, 9 months
1
0
0
0
[akhaldi] 58538: [SAL] * Add _Outptr_result_bytebuffer_maybenull_ and _Readable_elements_ annotations.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Mar 17 14:58:07 2013 New Revision: 58538 URL:
http://svn.reactos.org/svn/reactos?rev=58538&view=rev
Log: [SAL] * Add _Outptr_result_bytebuffer_maybenull_ and _Readable_elements_ annotations. Modified: trunk/reactos/include/psdk/sal.h Modified: trunk/reactos/include/psdk/sal.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/sal.h?rev=585…
============================================================================== --- trunk/reactos/include/psdk/sal.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/sal.h [iso-8859-1] Sun Mar 17 14:58:07 2013 @@ -832,7 +832,7 @@ #define _Outptr_result_bytebuffer_(size) _SAL2_NAME(_Outptr_result_bytebuffer_) _Group_([SA_Pre(Null=SA_No,Notref=1)] [SA_Pre(WritableElementsConst=1,Notref=1)] [SA_Post(Valid=SA_Yes)] [SA_Post(Deref=1,Null=SA_No,Notref=1,WritableBytes="\n" _SA_SPECSTRIZE(size))]) //#define _Outptr_result_bytebuffer_all_(size) //#define _Outptr_result_bytebuffer_all_maybenull_(size) -//#define _Outptr_result_bytebuffer_maybenull_(size) +#define _Outptr_result_bytebuffer_maybenull_(size) _SAL2_NAME(_Outptr_result_bytebuffer_maybenull_) _Group_([SA_Pre(Null=SA_No,Notref=1)] [SA_Pre(WritableElementsConst=1,Notref=1)] [SA_Post(Valid=SA_Yes)] [SA_Post(Deref=1,Null=SA_Maybe,Notref=1,WritableBytes="\n" _SA_SPECSTRIZE(size))]) #define _Outptr_result_bytebuffer_to_(size, count) _SAL2_NAME(_Outptr_result_bytebuffer_to_) _Group_([SA_Pre(Null=SA_No,Notref=1)] [SA_Pre(WritableElementsConst=1,Notref=1)] [SA_Post(Valid=SA_Yes)] [SA_Post(Deref=1,Null=SA_No,Notref=1,WritableBytes="\n" _SA_SPECSTRIZE(size), ValidBytes="\n" _SA_SPECSTRIZE(count))]) //#define _Outptr_result_bytebuffer_to_maybenull_(size, count) #define _Outptr_result_maybenull_ _SAL2_NAME(_Outptr_result_maybenull_) _Group_([SA_Pre(Null=SA_No,Notref=1)] [SA_Pre(WritableElementsConst=1,Notref=1)] [SA_Post(Valid=SA_Yes)] [SA_Post(Deref=1,Null=SA_Maybe,Notref=1,ValidElements="\n""1")] ) @@ -980,7 +980,7 @@ //#define _Raises_SEH_exception_ #define _Maybe_raises_SEH_exception_ #define _Readable_bytes_(size) _SAL2_NAME(_Readable_bytes_) _Group_(_SA_annotes1(SAL_readableTo, byteCount(size))) -//#define _Readable_elements_(size) +#define _Readable_elements_(size) _SAL2_NAME(_Readable_elements_) _Group_([SAL_annotes(Name="SAL_readableTo", p1="elementCount(size)")]) #define _Reserved_ _SAL2_NAME(_Reserved_) _Group_([SA_Pre(Null=SA_Yes)]) //#define _Result_nullonfailure_ //#define _Result_zeroonfailure_
11 years, 9 months
1
0
0
0
[ekohl] 58537: [MSV1_0] - Add LsaApLogonUserEx and LsaApLogonUserEx2 stubs. - Delay import samsrv and lsasrv import libs. - Start the implementation of the logon process.
by ekohl@svn.reactos.org
Author: ekohl Date: Sun Mar 17 13:55:51 2013 New Revision: 58537 URL:
http://svn.reactos.org/svn/reactos?rev=58537&view=rev
Log: [MSV1_0] - Add LsaApLogonUserEx and LsaApLogonUserEx2 stubs. - Delay import samsrv and lsasrv import libs. - Start the implementation of the logon process. Modified: trunk/reactos/dll/win32/msv1_0/CMakeLists.txt trunk/reactos/dll/win32/msv1_0/msv1_0.c trunk/reactos/dll/win32/msv1_0/msv1_0.h trunk/reactos/dll/win32/msv1_0/msv1_0.spec Modified: trunk/reactos/dll/win32/msv1_0/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msv1_0/CMakeList…
============================================================================== --- trunk/reactos/dll/win32/msv1_0/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msv1_0/CMakeLists.txt [iso-8859-1] Sun Mar 17 13:55:51 2013 @@ -13,6 +13,7 @@ add_library(msv1_0 SHARED ${SOURCE}) set_module_type(msv1_0 win32dll UNICODE ENTRYPOINT 0) target_link_libraries(msv1_0 wine ${PSEH_LIB}) +add_delay_importlibs(msv1_0 samsrv lsasrv) add_importlibs(msv1_0 kernel32 ntdll) add_pch(msv1_0 msv1_0.h) add_dependencies(msv1_0 psdk) Modified: trunk/reactos/dll/win32/msv1_0/msv1_0.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msv1_0/msv1_0.c?…
============================================================================== --- trunk/reactos/dll/win32/msv1_0/msv1_0.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msv1_0/msv1_0.c [iso-8859-1] Sun Mar 17 13:55:51 2013 @@ -19,6 +19,55 @@ /* FUNCTIONS ***************************************************************/ + +static +NTSTATUS +GetDomainSid(PRPC_SID *Sid) +{ + LSAPR_HANDLE PolicyHandle = NULL; + PLSAPR_POLICY_INFORMATION PolicyInfo = NULL; + ULONG Length = 0; + NTSTATUS Status; + + Status = LsaIOpenPolicyTrusted(&PolicyHandle); + if (!NT_SUCCESS(Status)) + { + TRACE("LsaIOpenPolicyTrusted() failed (Status 0x%08lx)\n", Status); + return Status; + } + + Status = LsarQueryInformationPolicy(PolicyHandle, + PolicyAccountDomainInformation, + &PolicyInfo); + if (!NT_SUCCESS(Status)) + { + TRACE("LsarQueryInformationPolicy() failed (Status 0x%08lx)\n", Status); + goto done; + } + + Length = RtlLengthSid(PolicyInfo->PolicyAccountDomainInfo.Sid); + + *Sid = RtlAllocateHeap(RtlGetProcessHeap(), 0, Length); + if (*Sid == NULL) + { + ERR("Failed to allocate SID\n"); + Status = STATUS_INSUFFICIENT_RESOURCES; + goto done; + } + + memcpy(*Sid, PolicyInfo->PolicyAccountDomainInfo.Sid, Length); + +done: + if (PolicyInfo != NULL) + LsaIFree_LSAPR_POLICY_INFORMATION(PolicyAccountDomainInformation, + PolicyInfo); + + if (PolicyHandle != NULL) + LsarClose(&PolicyHandle); + + return Status; +} + /* * @unimplemented @@ -95,6 +144,10 @@ /* Get the dispatch table entries */ DispatchTable.AllocateLsaHeap = LsaDispatchTable->AllocateLsaHeap; DispatchTable.FreeLsaHeap = LsaDispatchTable->FreeLsaHeap; + DispatchTable.AllocateClientBuffer = LsaDispatchTable->AllocateClientBuffer; + DispatchTable.FreeClientBuffer = LsaDispatchTable->FreeClientBuffer; + DispatchTable.CopyToClientBuffer = LsaDispatchTable->CopyToClientBuffer; + DispatchTable.CopyFromClientBuffer = LsaDispatchTable->CopyFromClientBuffer; /* Return the package name */ @@ -149,7 +202,186 @@ OUT PLSA_UNICODE_STRING *AccountName, OUT PLSA_UNICODE_STRING *AuthenticatingAuthority) { - TRACE("()\n"); + PMSV1_0_INTERACTIVE_LOGON LogonInfo; + + SAMPR_HANDLE ServerHandle = NULL; + SAMPR_HANDLE DomainHandle = NULL; + PRPC_SID AccountDomainSid = NULL; + RPC_UNICODE_STRING Names[1]; + SAMPR_ULONG_ARRAY RelativeIds = {0, NULL}; + SAMPR_ULONG_ARRAY Use = {0, NULL}; + NTSTATUS Status; + + TRACE("()\n"); + + TRACE("LogonType: %lu\n", LogonType); + TRACE("AuthenticationInformation: %p\n", AuthenticationInformation); + TRACE("AuthenticationInformationLength: %lu\n", AuthenticationInformationLength); + + + *ProfileBuffer = NULL; + *ProfileBufferLength = 0; + *SubStatus = STATUS_SUCCESS; + + if (LogonType == Interactive || + LogonType == Batch || + LogonType == Service) + { + ULONG_PTR PtrOffset; + + LogonInfo = (PMSV1_0_INTERACTIVE_LOGON)AuthenticationInformation; + + /* Fix-up pointers in the authentication info */ + PtrOffset = (ULONG_PTR)AuthenticationInformation - (ULONG_PTR)ClientAuthenticationBase; + + LogonInfo->LogonDomainName.Buffer = (PWSTR)((ULONG_PTR)LogonInfo->LogonDomainName.Buffer + PtrOffset); + LogonInfo->UserName.Buffer = (PWSTR)((ULONG_PTR)LogonInfo->UserName.Buffer + PtrOffset); + LogonInfo->Password.Buffer = (PWSTR)((ULONG_PTR)LogonInfo->Password.Buffer + PtrOffset); + + TRACE("Domain: %S\n", LogonInfo->LogonDomainName.Buffer); + TRACE("User: %S\n", LogonInfo->UserName.Buffer); + TRACE("Password: %S\n", LogonInfo->Password.Buffer); + } + else + { + FIXME("LogonType %lu is not supported yet!\n", LogonType); + return STATUS_NOT_IMPLEMENTED; + } + + Status = GetDomainSid(&AccountDomainSid); + if (!NT_SUCCESS(Status)) + { + TRACE("GetDomainSid() failed (Status 0x%08lx)\n", Status); + return Status; + } + + /* Connect to the SAM server */ + Status = SamIConnect(NULL, + &ServerHandle, + SAM_SERVER_CONNECT | SAM_SERVER_LOOKUP_DOMAIN, + TRUE); + if (!NT_SUCCESS(Status)) + { + TRACE("SamIConnect() failed (Status 0x%08lx)\n", Status); + goto done; + } + + /* Open the account domain */ + Status = SamrOpenDomain(ServerHandle, + DOMAIN_LOOKUP, + AccountDomainSid, + &DomainHandle); + if (!NT_SUCCESS(Status)) + { + TRACE("SamrOpenDomain failed (Status %08lx)\n", Status); + goto done; + } + + Names[0].Length = LogonInfo->UserName.Length; + Names[0].MaximumLength = LogonInfo->UserName.MaximumLength; + Names[0].Buffer = LogonInfo->UserName.Buffer; + + /* Try to get the RID for the user name */ + Status = SamrLookupNamesInDomain(DomainHandle, + 1, + Names, + &RelativeIds, + &Use); + if (!NT_SUCCESS(Status)) + { + TRACE("SamrLookupNamesInDomain failed (Status %08lx)\n", Status); + Status = STATUS_NO_SUCH_USER; + goto done; + } + + /* Fail, if it is not a user account */ + if (Use.Element[0] != SidTypeUser) + { + TRACE("Account is not a user account!\n"); + Status = STATUS_NO_SUCH_USER; + goto done; + } + + + +done: + SamIFree_SAMPR_ULONG_ARRAY(&RelativeIds); + SamIFree_SAMPR_ULONG_ARRAY(&Use); + + if (DomainHandle != NULL) + SamrCloseHandle(&DomainHandle); + + if (ServerHandle != NULL) + SamrCloseHandle(&ServerHandle); + + if (AccountDomainSid != NULL) + RtlFreeHeap(RtlGetProcessHeap(), 0, AccountDomainSid); + + TRACE("LsaApLogonUser done (Status %08lx)\n", Status); + + return Status; +} + + +/* + * @unimplemented + */ +NTSTATUS +NTAPI +LsaApLogonUserEx(IN PLSA_CLIENT_REQUEST ClientRequest, + IN SECURITY_LOGON_TYPE LogonType, + IN PVOID AuthenticationInformation, + IN PVOID ClientAuthenticationBase, + IN ULONG AuthenticationInformationLength, + OUT PVOID *ProfileBuffer, + OUT PULONG ProfileBufferLength, + OUT PLUID LogonId, + OUT PNTSTATUS SubStatus, + OUT PLSA_TOKEN_INFORMATION_TYPE TokenInformationType, + OUT PVOID *TokenInformation, + OUT PUNICODE_STRING *AccountName, + OUT PUNICODE_STRING *AuthenticatingAuthority, + OUT PUNICODE_STRING *MachineName) +{ + TRACE("()\n"); + + TRACE("LogonType: %lu\n", LogonType); + TRACE("AuthenticationInformation: %p\n", AuthenticationInformation); + TRACE("AuthenticationInformationLength: %lu\n", AuthenticationInformationLength); + + return STATUS_NOT_IMPLEMENTED; +} + + +/* + * @unimplemented + */ +NTSTATUS +NTAPI +LsaApLogonUserEx2(IN PLSA_CLIENT_REQUEST ClientRequest, + IN SECURITY_LOGON_TYPE LogonType, + IN PVOID ProtocolSubmitBuffer, + IN PVOID ClientBufferBase, + IN ULONG SubmitBufferSize, + OUT PVOID *ProfileBuffer, + OUT PULONG ProfileBufferSize, + OUT PLUID LogonId, + OUT PNTSTATUS SubStatus, + OUT PLSA_TOKEN_INFORMATION_TYPE TokenInformationType, + OUT PVOID *TokenInformation, + OUT PUNICODE_STRING *AccountName, + OUT PUNICODE_STRING *AuthenticatingAuthority, + OUT PUNICODE_STRING *MachineName, + OUT PSECPKG_PRIMARY_CRED PrimaryCredentials, + OUT PSECPKG_SUPPLEMENTAL_CRED_ARRAY *SupplementalCredentials) +{ + TRACE("()\n"); + + TRACE("LogonType: %lu\n", LogonType); + TRACE("ProtocolSubmitBuffer: %p\n", ProtocolSubmitBuffer); + TRACE("SubmitBufferSize: %lu\n", SubmitBufferSize); + + return STATUS_NOT_IMPLEMENTED; } Modified: trunk/reactos/dll/win32/msv1_0/msv1_0.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msv1_0/msv1_0.h?…
============================================================================== --- trunk/reactos/dll/win32/msv1_0/msv1_0.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msv1_0/msv1_0.h [iso-8859-1] Sun Mar 17 13:55:51 2013 @@ -27,7 +27,145 @@ #include <sspi.h> #include <ntsecapi.h> #include <ntsecpkg.h> +#include <ntsam.h> +#include <ntlsa.h> + +#include <samsrv/samsrv.h> +//#include <lsass/lsasrv.h> #include <wine/debug.h> +typedef struct _RPC_SID +{ + UCHAR Revision; + UCHAR SubAuthorityCount; + SID_IDENTIFIER_AUTHORITY IdentifierAuthority; + DWORD SubAuthority[]; +} RPC_SID, *PRPC_SID; + +typedef struct _RPC_UNICODE_STRING +{ + unsigned short Length; + unsigned short MaximumLength; + wchar_t *Buffer; +} RPC_UNICODE_STRING, *PRPC_UNICODE_STRING; + +typedef wchar_t *PSAMPR_SERVER_NAME; +typedef void *SAMPR_HANDLE; + +typedef struct _SAMPR_ULONG_ARRAY +{ + ULONG Count; + PULONG Element; +} SAMPR_ULONG_ARRAY, *PSAMPR_ULONG_ARRAY; + +NTSTATUS +NTAPI +SamIConnect(IN PSAMPR_SERVER_NAME ServerName, + OUT SAMPR_HANDLE *ServerHandle, + IN ACCESS_MASK DesiredAccess, + IN BOOLEAN Trusted); + +VOID +NTAPI +SamIFree_SAMPR_ULONG_ARRAY(PSAMPR_ULONG_ARRAY Ptr); + +NTSTATUS +NTAPI +SamrCloseHandle(IN OUT SAMPR_HANDLE *SamHandle); + +NTSTATUS +NTAPI +SamrOpenDomain(IN SAMPR_HANDLE ServerHandle, + IN ACCESS_MASK DesiredAccess, + IN PRPC_SID DomainId, + OUT SAMPR_HANDLE *DomainHandle); + +NTSTATUS +NTAPI +SamrLookupNamesInDomain(IN SAMPR_HANDLE DomainHandle, + IN ULONG Count, + IN RPC_UNICODE_STRING Names[], + OUT PSAMPR_ULONG_ARRAY RelativeIds, + OUT PSAMPR_ULONG_ARRAY Use); + +typedef PVOID LSAPR_HANDLE; + +typedef struct _LSAPR_POLICY_AUDIT_EVENTS_INFO +{ + BOOLEAN AuditingMode; + DWORD *EventAuditingOptions; + DWORD MaximumAuditEventCount; +} LSAPR_POLICY_AUDIT_EVENTS_INFO, *PLSAPR_POLICY_AUDIT_EVENTS_INFO; + +typedef struct _LSAPR_POLICY_PRIMARY_DOM_INFO +{ + RPC_UNICODE_STRING Name; + PRPC_SID Sid; +} LSAPR_POLICY_PRIMARY_DOM_INFO, *PLSAPR_POLICY_PRIMARY_DOM_INFO; + +typedef struct _LSAPR_POLICY_ACCOUNT_DOM_INFO +{ + RPC_UNICODE_STRING DomainName; + PRPC_SID Sid; +} LSAPR_POLICY_ACCOUNT_DOM_INFO, *PLSAPR_POLICY_ACCOUNT_DOM_INFO; + +typedef struct _LSAPR_POLICY_PD_ACCOUNT_INFO +{ + RPC_UNICODE_STRING Name; +} LSAPR_POLICY_PD_ACCOUNT_INFO, *PLSAPR_POLICY_PD_ACCOUNT_INFO; + +typedef struct _POLICY_LSA_REPLICA_SRCE_INFO +{ + RPC_UNICODE_STRING ReplicaSource; + RPC_UNICODE_STRING ReplicaAccountName; +} POLICY_LSA_REPLICA_SRCE_INFO, *PPOLICY_LSA_REPLICA_SRCE_INFO; + +typedef struct _LSAPR_POLICY_DNS_DOMAIN_INFO +{ + RPC_UNICODE_STRING Name; + RPC_UNICODE_STRING DnsDomainName; + RPC_UNICODE_STRING DnsForestName; + GUID DomainGuid; + PRPC_SID Sid; +} LSAPR_POLICY_DNS_DOMAIN_INFO, *PLSAPR_POLICY_DNS_DOMAIN_INFO; + +typedef union _LSAPR_POLICY_INFORMATION +{ + POLICY_AUDIT_LOG_INFO PolicyAuditLogInfo; + LSAPR_POLICY_AUDIT_EVENTS_INFO PolicyAuditEventsInfo; + LSAPR_POLICY_PRIMARY_DOM_INFO PolicyPrimaryDomInfo; + LSAPR_POLICY_PD_ACCOUNT_INFO PolicyPdAccountInfo; + LSAPR_POLICY_ACCOUNT_DOM_INFO PolicyAccountDomainInfo; + POLICY_LSA_SERVER_ROLE_INFO PolicyServerRoleInfo; + POLICY_LSA_REPLICA_SRCE_INFO PolicyReplicaSourceInfo; + POLICY_DEFAULT_QUOTA_INFO PolicyDefaultQuotaInfo; + POLICY_MODIFICATION_INFO PolicyModificationInfo; + POLICY_AUDIT_FULL_SET_INFO PolicyAuditFullSetInfo; + POLICY_AUDIT_FULL_QUERY_INFO PolicyAuditFullQueryInfo; + LSAPR_POLICY_DNS_DOMAIN_INFO PolicyDnsDomainInfo; + LSAPR_POLICY_DNS_DOMAIN_INFO PolicyDnsDomainInfoInt; + LSAPR_POLICY_ACCOUNT_DOM_INFO PolicyLocalAccountDomainInfo; +} LSAPR_POLICY_INFORMATION, *PLSAPR_POLICY_INFORMATION; + +VOID +NTAPI +LsaIFree_LSAPR_POLICY_INFORMATION(IN POLICY_INFORMATION_CLASS InformationClass, + IN PLSAPR_POLICY_INFORMATION PolicyInformation); + +NTSTATUS +WINAPI +LsaIOpenPolicyTrusted(OUT LSAPR_HANDLE *PolicyHandle); + +NTSTATUS +WINAPI +LsarClose(IN OUT LSAPR_HANDLE *ObjectHandle); + +NTSTATUS +WINAPI +LsarQueryInformationPolicy(IN LSAPR_HANDLE PolicyHandle, + IN POLICY_INFORMATION_CLASS InformationClass, + OUT PLSAPR_POLICY_INFORMATION *PolicyInformation); + + /* EOF */ Modified: trunk/reactos/dll/win32/msv1_0/msv1_0.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msv1_0/msv1_0.sp…
============================================================================== --- trunk/reactos/dll/win32/msv1_0/msv1_0.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msv1_0/msv1_0.spec [iso-8859-1] Sun Mar 17 13:55:51 2013 @@ -4,8 +4,8 @@ @ stdcall LsaApInitializePackage(long ptr ptr ptr ptr) @ stdcall LsaApLogonTerminated(ptr) @ stdcall LsaApLogonUser(ptr long ptr ptr long ptr ptr ptr ptr ptr ptr ptr ptr) -@ stub LsaApLogonUserEx -@ stub LsaApLogonUserEx2 +#@ stdcall LsaApLogonUserEx(ptr long ptr ptr long ptr ptr ptr ptr ptr ptr ptr ptr ptr) +#@ stdcall LsaApLogonUserEx2(ptr long ptr ptr long ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) @ stub Msv1_0ExportSubAuthenticationRoutine @ stub Msv1_0SubAuthenticationPresent @ stub MsvGetLogonAttemptCount
11 years, 9 months
1
0
0
0
[pschweitzer] 58536: [KSPROXY] Efficiently check for vector emptyness
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Sun Mar 17 13:35:17 2013 New Revision: 58536 URL:
http://svn.reactos.org/svn/reactos?rev=58536&view=rev
Log: [KSPROXY] Efficiently check for vector emptyness Modified: trunk/reactos/dll/directx/ksproxy/output_pin.cpp Modified: trunk/reactos/dll/directx/ksproxy/output_pin.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksproxy/output…
============================================================================== --- trunk/reactos/dll/directx/ksproxy/output_pin.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/directx/ksproxy/output_pin.cpp [iso-8859-1] Sun Mar 17 13:35:17 2013 @@ -1676,7 +1676,7 @@ assert(m_hPin != INVALID_HANDLE_VALUE); // get all supported sets - if (m_Plugins.size() == 0) + if (m_Plugins.empty()) { if (GetSupportedSets(&pGuid, &NumGuids)) {
11 years, 9 months
1
0
0
0
[pschweitzer] 58535: [CMD] Don't leak memory on realloc failure
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Sun Mar 17 12:58:53 2013 New Revision: 58535 URL:
http://svn.reactos.org/svn/reactos?rev=58535&view=rev
Log: [CMD] Don't leak memory on realloc failure Modified: trunk/reactos/base/shell/cmd/copy.c trunk/reactos/base/shell/cmd/filecomp.c Modified: trunk/reactos/base/shell/cmd/copy.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/copy.c?rev=…
============================================================================== --- trunk/reactos/base/shell/cmd/copy.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/copy.c [iso-8859-1] Sun Mar 17 12:58:53 2013 @@ -377,11 +377,15 @@ if (size > 512) { + TCHAR *old_evar = evar; evar = cmd_realloc(evar,size * sizeof(TCHAR) ); if (evar!=NULL) size = GetEnvironmentVariable (_T("COPYCMD"), evar, size); else + { size=0; + evar = old_evar; + } } /* check see if we did get any env variable */ Modified: trunk/reactos/base/shell/cmd/filecomp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/filecomp.c?…
============================================================================== --- trunk/reactos/base/shell/cmd/filecomp.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/filecomp.c [iso-8859-1] Sun Mar 17 12:58:53 2013 @@ -666,6 +666,8 @@ /* aseemble a list of all files names */ do { + FileName * oldFileList = FileList; + if(!_tcscmp (file.cFileName, _T(".")) || !_tcscmp (file.cFileName, _T(".."))) continue; @@ -683,6 +685,8 @@ if(FileList == NULL) { + /* Don't leak old buffer */ + cmd_free(oldFileList); /* Assemble the orginal string and return */ _tcscpy(strOut,szOrginal); FindClose(hFile);
11 years, 9 months
1
0
0
0
[hbelusca] 58534: [SERVICES] - It seems (after testing) that services report now correctly their state to the SCM. So we can start them in SERVICE_START_PENDING state (see revisions r45626 and r456...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sun Mar 17 12:39:44 2013 New Revision: 58534 URL:
http://svn.reactos.org/svn/reactos?rev=58534&view=rev
Log: [SERVICES] - It seems (after testing) that services report now correctly their state to the SCM. So we can start them in SERVICE_START_PENDING state (see revisions r45626 and r45640). - Add some informative comments. - Use a helper function to create start events at initialization time. - When autostart services are up, signal an event. (see revisions r45633 and r45658). - Wait for LSASS just after having created the services database, and before calling ScmGetBootAndSystemDriverState (conform to Windows Internals 4th, page 224). --------- - When starting auto-start services, hold a lock during all the operation in such a way that, if an external program wants to start a service, it is obliged to wait till all the auto-start services have been started (usual service starting also uses that lock). CORE-7001 #resolve #comment Should be fixed by r58534. Do not hesitate to reopen this bug-report if the problem reappears. Modified: trunk/reactos/base/system/services/database.c trunk/reactos/base/system/services/rpcserver.c trunk/reactos/base/system/services/services.c trunk/reactos/base/system/services/services.h Modified: trunk/reactos/base/system/services/database.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/datab…
============================================================================== --- trunk/reactos/base/system/services/database.c [iso-8859-1] (original) +++ trunk/reactos/base/system/services/database.c [iso-8859-1] Sun Mar 17 12:39:44 2013 @@ -19,9 +19,9 @@ /* * Uncomment the line below to start services - * using the SERVICE_START_PENDING state + * using the SERVICE_START_PENDING state. */ -// #define USE_SERVICE_START_PENDING +#define USE_SERVICE_START_PENDING /* * Uncomment the line below to use asynchronous IO operations @@ -38,6 +38,7 @@ static RTL_RESOURCE DatabaseLock; static DWORD ResumeCount = 1; +/* The critical section synchronizes service controls commands */ static CRITICAL_SECTION ControlServiceCriticalSection; static DWORD PipeTimeout = 30000; /* 30 Seconds */ @@ -359,7 +360,7 @@ DWORD ScmCreateNewServiceRecord(LPCWSTR lpServiceName, - PSERVICE *lpServiceRecord) + PSERVICE* lpServiceRecord) { PSERVICE lpService = NULL; @@ -772,13 +773,11 @@ if (Service->Status.dwServiceType == SERVICE_KERNEL_DRIVER) { - RtlInitUnicodeString(&DirName, - L"\\Driver"); - } - else - { - RtlInitUnicodeString(&DirName, - L"\\FileSystem"); + RtlInitUnicodeString(&DirName, L"\\Driver"); + } + else // if (Service->Status.dwServiceType == SERVICE_FILE_SYSTEM_DRIVER) + { + RtlInitUnicodeString(&DirName, L"\\FileSystem"); } InitializeObjectAttributes(&ObjectAttributes, @@ -796,7 +795,7 @@ } BufferLength = sizeof(OBJECT_DIRECTORY_INFORMATION) + - 2 * MAX_PATH * sizeof(WCHAR); + 2 * MAX_PATH * sizeof(WCHAR); DirInfo = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, BufferLength); @@ -1096,7 +1095,7 @@ static DWORD ScmSendStartCommand(PSERVICE Service, DWORD argc, - LPWSTR *argv) + LPWSTR* argv) { PSCM_CONTROL_PACKET ControlPacket; SCM_REPLY_PACKET ReplyPacket; @@ -1496,7 +1495,7 @@ static DWORD ScmStartUserModeService(PSERVICE Service, DWORD argc, - LPWSTR *argv) + LPWSTR* argv) { PROCESS_INFORMATION ProcessInformation; STARTUPINFOW StartupInfo; @@ -1512,6 +1511,7 @@ return ScmSendStartCommand(Service, argc, argv); } + /* Otherwise start its process */ ZeroMemory(&StartupInfo, sizeof(StartupInfo)); StartupInfo.cb = sizeof(StartupInfo); ZeroMemory(&ProcessInformation, sizeof(ProcessInformation)); @@ -1551,9 +1551,7 @@ if (dwError == ERROR_SUCCESS) { /* Send start command */ - dwError = ScmSendStartCommand(Service, - argc, - argv); + dwError = ScmSendStartCommand(Service, argc, argv); } else { @@ -1569,24 +1567,22 @@ } -DWORD -ScmStartService(PSERVICE Service, DWORD argc, LPWSTR *argv) +static DWORD +ScmLoadService(PSERVICE Service, + DWORD argc, + LPWSTR* argv) { PSERVICE_GROUP Group = Service->lpGroup; DWORD dwError = ERROR_SUCCESS; LPCWSTR ErrorLogStrings[2]; WCHAR szErrorBuffer[32]; - DPRINT("ScmStartService() called\n"); - + DPRINT("ScmLoadService() called\n"); DPRINT("Start Service %p (%S)\n", Service, Service->lpServiceName); - EnterCriticalSection(&ControlServiceCriticalSection); - if (Service->Status.dwCurrentState != SERVICE_STOPPED) { DPRINT("Service %S is already running!\n", Service->lpServiceName); - LeaveCriticalSection(&ControlServiceCriticalSection); return ERROR_SERVICE_ALREADY_RUNNING; } @@ -1602,7 +1598,7 @@ Service->Status.dwCurrentState = SERVICE_RUNNING; } } - else + else // if (Service->Status.dwServiceType & (SERVICE_WIN32 | SERVICE_INTERACTIVE_PROCESS)) { /* Start user-mode service */ dwError = ScmCreateOrReferenceServiceImage(Service); @@ -1625,9 +1621,7 @@ } } - LeaveCriticalSection(&ControlServiceCriticalSection); - - DPRINT("ScmStartService() done (Error %lu)\n", dwError); + DPRINT("ScmLoadService() done (Error %lu)\n", dwError); if (dwError == ERROR_SUCCESS) { @@ -1677,17 +1671,80 @@ } +DWORD +ScmStartService(PSERVICE Service, + DWORD argc, + LPWSTR* argv) +{ + DWORD dwError = ERROR_SUCCESS; + SC_RPC_LOCK Lock = NULL; + + DPRINT("ScmStartService() called\n"); + DPRINT("Start Service %p (%S)\n", Service, Service->lpServiceName); + + /* Acquire the service control critical section, to synchronize starts */ + EnterCriticalSection(&ControlServiceCriticalSection); + + /* + * Acquire the user service start lock while the service is starting, if + * needed (i.e. if we are not starting it during the initialization phase). + * If we don't success, bail out. + */ + if (!ScmInitialize) + { + dwError = ScmAcquireServiceStartLock(TRUE, &Lock); + if (dwError != ERROR_SUCCESS) goto done; + } + + /* Really start the service */ + dwError = ScmLoadService(Service, argc, argv); + + /* Release the service start lock, if needed, and the critical section */ + if (Lock) ScmReleaseServiceStartLock(&Lock); + +done: + LeaveCriticalSection(&ControlServiceCriticalSection); + + DPRINT("ScmStartService() done (Error %lu)\n", dwError); + + return dwError; +} + + VOID ScmAutoStartServices(VOID) { + DWORD dwError = ERROR_SUCCESS; + SC_RPC_LOCK Lock = NULL; + PLIST_ENTRY GroupEntry; PLIST_ENTRY ServiceEntry; PSERVICE_GROUP CurrentGroup; PSERVICE CurrentService; WCHAR szSafeBootServicePath[MAX_PATH]; - DWORD dwError; HKEY hKey; ULONG i; + + /* Acquire the service control critical section, to synchronize starts */ + EnterCriticalSection(&ControlServiceCriticalSection); + + /* + * Acquire the user service start lock while the service is starting, if + * needed (i.e. if we are not starting it during the initialization phase). + * If we don't success, bail out. + */ + if (!ScmInitialize) + { + /* + * Actually this code is never executed since we are called + * at initialization time, so that ScmInitialize == TRUE. + * But keep the code here if someday we are called later on + * for whatever reason... + */ + dwError = ScmAcquireServiceStartLock(TRUE, &Lock); + if (dwError != ERROR_SUCCESS) goto done; + } + /* Clear 'ServiceVisited' flag (or set if not to start in Safe Mode) */ ServiceEntry = ServiceListHead.Flink; @@ -1779,7 +1836,7 @@ (CurrentService->dwTag == CurrentGroup->TagArray[i])) { CurrentService->ServiceVisited = TRUE; - ScmStartService(CurrentService, 0, NULL); + ScmLoadService(CurrentService, 0, NULL); } ServiceEntry = ServiceEntry->Flink; @@ -1797,7 +1854,7 @@ (CurrentService->ServiceVisited == FALSE)) { CurrentService->ServiceVisited = TRUE; - ScmStartService(CurrentService, 0, NULL); + ScmLoadService(CurrentService, 0, NULL); } ServiceEntry = ServiceEntry->Flink; @@ -1817,7 +1874,7 @@ (CurrentService->ServiceVisited == FALSE)) { CurrentService->ServiceVisited = TRUE; - ScmStartService(CurrentService, 0, NULL); + ScmLoadService(CurrentService, 0, NULL); } ServiceEntry = ServiceEntry->Flink; @@ -1834,7 +1891,7 @@ (CurrentService->ServiceVisited == FALSE)) { CurrentService->ServiceVisited = TRUE; - ScmStartService(CurrentService, 0, NULL); + ScmLoadService(CurrentService, 0, NULL); } ServiceEntry = ServiceEntry->Flink; @@ -1848,6 +1905,13 @@ CurrentService->ServiceVisited = FALSE; ServiceEntry = ServiceEntry->Flink; } + + + /* Release the service start lock, if needed, and the critical section */ + if (Lock) ScmReleaseServiceStartLock(&Lock); + +done: + LeaveCriticalSection(&ControlServiceCriticalSection); } Modified: trunk/reactos/base/system/services/rpcserver.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/rpcse…
============================================================================== --- trunk/reactos/base/system/services/rpcserver.c [iso-8859-1] (original) +++ trunk/reactos/base/system/services/rpcserver.c [iso-8859-1] Sun Mar 17 12:39:44 2013 @@ -2895,7 +2895,6 @@ DWORD dwError = ERROR_SUCCESS; PSERVICE_HANDLE hSvc; PSERVICE lpService = NULL; - SC_RPC_LOCK Lock = NULL; #ifndef NDEBUG DWORD i; @@ -2941,16 +2940,8 @@ if (lpService->bDeleted) return ERROR_SERVICE_MARKED_FOR_DELETE; - /* Acquire the service start lock until the service has been started */ - dwError = ScmAcquireServiceStartLock(TRUE, &Lock); - if (dwError != ERROR_SUCCESS) - return dwError; - /* Start the service */ dwError = ScmStartService(lpService, argc, (LPWSTR*)argv); - - /* Release the service start lock */ - ScmReleaseServiceStartLock(&Lock); return dwError; } @@ -4171,7 +4162,6 @@ DWORD dwError = ERROR_SUCCESS; PSERVICE_HANDLE hSvc; PSERVICE lpService = NULL; - SC_RPC_LOCK Lock = NULL; LPWSTR *lpVector = NULL; DWORD i; DWORD dwLength; @@ -4244,16 +4234,8 @@ } } - /* Acquire the service start lock until the service has been started */ - dwError = ScmAcquireServiceStartLock(TRUE, &Lock); - if (dwError != ERROR_SUCCESS) - goto done; - /* Start the service */ dwError = ScmStartService(lpService, argc, lpVector); - - /* Release the service start lock */ - ScmReleaseServiceStartLock(&Lock); done: /* Free the Unicode argument vector */ Modified: trunk/reactos/base/system/services/services.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/servi…
============================================================================== --- trunk/reactos/base/system/services/services.c [iso-8859-1] (original) +++ trunk/reactos/base/system/services/services.c [iso-8859-1] Sun Mar 17 12:39:44 2013 @@ -22,6 +22,12 @@ #define PIPE_BUFSIZE 1024 #define PIPE_TIMEOUT 1000 +/* Defined in include/reactos/services/services.h */ +// #define SCM_START_EVENT L"SvcctrlStartEvent_A3752DX" +#define SCM_AUTOSTARTCOMPLETE_EVENT L"SC_AutoStartComplete" +#define LSA_RPC_SERVER_ACTIVE L"LSA_RPC_SERVER_ACTIVE" + +BOOL ScmInitialize = FALSE; BOOL ScmShutdown = FALSE; static HANDLE hScmShutdownEvent = NULL; @@ -77,35 +83,38 @@ BOOL -ScmCreateStartEvent(PHANDLE StartEvent) -{ +ScmCreateControlEvent(PHANDLE Event, + LPCWSTR Name, + DWORD dwDesiredAccess) +{ + /* + * This function creates a generic non-inheritable event + * and return a handle to the caller. The caller must + * close this handle afterwards. + */ + HANDLE hEvent; - hEvent = CreateEventW(NULL, - TRUE, - FALSE, - L"SvcctrlStartEvent_A3752DX"); + hEvent = CreateEventW(NULL, TRUE, FALSE, Name); if (hEvent == NULL) { if (GetLastError() == ERROR_ALREADY_EXISTS) { - hEvent = OpenEventW(EVENT_ALL_ACCESS, - FALSE, - L"SvcctrlStartEvent_A3752DX"); - if (hEvent == NULL) - { - return FALSE; - } + hEvent = OpenEventW(dwDesiredAccess, FALSE, Name); } - else - { - return FALSE; - } - } - - *StartEvent = hEvent; - - return TRUE; + } + + if (hEvent) + { + DPRINT("SERVICES: Created event %S with handle %x\n", Name, hEvent); + *Event = hEvent; + return TRUE; + } + else + { + DPRINT1("SERVICES: Failed to create event %S (Error %lu)\n", Name, GetLastError()); + return FALSE; + } } @@ -113,35 +122,21 @@ ScmWaitForLsa(VOID) { HANDLE hEvent; - DWORD dwError; - - hEvent = CreateEventW(NULL, - TRUE, - FALSE, - L"LSA_RPC_SERVER_ACTIVE"); - if (hEvent == NULL) - { - dwError = GetLastError(); - DPRINT1("Failed to create the notication event (Error %lu)\n", dwError); - - if (dwError == ERROR_ALREADY_EXISTS) - { - hEvent = OpenEventW(SYNCHRONIZE, - FALSE, - L"LSA_RPC_SERVER_ACTIVE"); - if (hEvent == NULL) - { - DPRINT1("Could not open the notification event (Error %lu)\n", GetLastError()); - return; - } - } - } - - DPRINT("Wait for the LSA server!\n"); - WaitForSingleObject(hEvent, INFINITE); - DPRINT("LSA server running!\n"); - - CloseHandle(hEvent); + + if (!ScmCreateControlEvent(&hEvent, + LSA_RPC_SERVER_ACTIVE, + SYNCHRONIZE)) + { + DPRINT1("Failed to create the notification event (Error %lu)\n", GetLastError()); + } + else + { + DPRINT("Wait for the LSA server!\n"); + WaitForSingleObject(hEvent, INFINITE); + DPRINT("LSA server running!\n"); + + CloseHandle(hEvent); + } DPRINT("ScmWaitForLsa() done\n"); } @@ -351,23 +346,38 @@ int nShowCmd) { HANDLE hScmStartEvent = NULL; + HANDLE hScmAutoStartCompleteEvent = NULL; SC_RPC_LOCK Lock = NULL; BOOL bCanDeleteNamedPipeCriticalSection = FALSE; DWORD dwError; DPRINT("SERVICES: Service Control Manager\n"); - /* Create start event */ - if (!ScmCreateStartEvent(&hScmStartEvent)) - { - DPRINT1("SERVICES: Failed to create start event\n"); - goto done; - } - - DPRINT("SERVICES: created start event with handle %p.\n", hScmStartEvent); + /* We are initializing ourselves */ + ScmInitialize = TRUE; + + /* Create the start event */ + if (!ScmCreateControlEvent(&hScmStartEvent, + SCM_START_EVENT, + EVENT_ALL_ACCESS)) + { + DPRINT1("SERVICES: Failed to create the start event\n"); + goto done; + } + DPRINT("SERVICES: Created start event with handle %p.\n", hScmStartEvent); + + /* Create the auto-start complete event */ + if (!ScmCreateControlEvent(&hScmAutoStartCompleteEvent, + SCM_AUTOSTARTCOMPLETE_EVENT, + EVENT_ALL_ACCESS)) + { + DPRINT1("SERVICES: Failed to create the auto-start complete event\n"); + goto done; + } + DPRINT("SERVICES: created auto-start complete event with handle %p.\n", hScmAutoStartCompleteEvent); /* Create the shutdown event */ - hScmShutdownEvent = CreateEvent(NULL, TRUE, FALSE, NULL); + hScmShutdownEvent = CreateEventW(NULL, TRUE, FALSE, NULL); if (hScmShutdownEvent == NULL) { DPRINT1("SERVICES: Failed to create shutdown event\n"); @@ -385,7 +395,7 @@ /* Read the control set values */ if (!ScmGetControlSetValues()) { - DPRINT1("SERVICES: failed to read the control set values\n"); + DPRINT1("SERVICES: Failed to read the control set values\n"); goto done; } @@ -393,49 +403,58 @@ dwError = ScmCreateServiceDatabase(); if (dwError != ERROR_SUCCESS) { - DPRINT1("SERVICES: failed to create SCM database (Error %lu)\n", dwError); - goto done; - } + DPRINT1("SERVICES: Failed to create SCM database (Error %lu)\n", dwError); + goto done; + } + + /* Wait for the LSA server */ + ScmWaitForLsa(); /* Update the services database */ ScmGetBootAndSystemDriverState(); - /* Register the Service Control Manager process with CSRSS */ + /* Register the Service Control Manager process with the ReactOS Subsystem */ if (!RegisterServicesProcess(GetCurrentProcessId())) { DPRINT1("SERVICES: Could not register SCM process\n"); goto done; } - /* Acquire the service start lock until autostart services have been started */ + /* + * Acquire the user service start lock until + * auto-start services have been started. + */ dwError = ScmAcquireServiceStartLock(TRUE, &Lock); if (dwError != ERROR_SUCCESS) { - DPRINT1("SERVICES: failed to acquire the service start lock (Error %lu)\n", dwError); + DPRINT1("SERVICES: Failed to acquire the service start lock (Error %lu)\n", dwError); goto done; } /* Start the RPC server */ ScmStartRpcServer(); - DPRINT("SERVICES: Initialized.\n"); - /* Signal start event */ SetEvent(hScmStartEvent); + DPRINT("SERVICES: Initialized.\n"); + /* Register event handler (used for system shutdown) */ SetConsoleCtrlHandler(ShutdownHandlerRoutine, TRUE); - /* Wait for the LSA server */ - ScmWaitForLsa(); - /* Start auto-start services */ ScmAutoStartServices(); + /* Signal auto-start complete event */ + SetEvent(hScmAutoStartCompleteEvent); + /* FIXME: more to do ? */ /* Release the service start lock */ ScmReleaseServiceStartLock(&Lock); + + /* Initialization finished */ + ScmInitialize = FALSE; DPRINT("SERVICES: Running.\n"); @@ -451,6 +470,10 @@ if (hScmShutdownEvent != NULL) CloseHandle(hScmShutdownEvent); + /* Close the auto-start complete event */ + if (hScmAutoStartCompleteEvent != NULL) + CloseHandle(hScmAutoStartCompleteEvent); + /* Close the start event */ if (hScmStartEvent != NULL) CloseHandle(hScmStartEvent); @@ -458,7 +481,6 @@ DPRINT("SERVICES: Finished.\n"); ExitThread(0); - return 0; } Modified: trunk/reactos/base/system/services/services.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/servi…
============================================================================== --- trunk/reactos/base/system/services/services.h [iso-8859-1] (original) +++ trunk/reactos/base/system/services/services.h [iso-8859-1] Sun Mar 17 12:39:44 2013 @@ -86,6 +86,7 @@ extern LIST_ENTRY ServiceListHead; extern LIST_ENTRY GroupListHead; extern LIST_ENTRY ImageListHead; +extern BOOL ScmInitialize; extern BOOL ScmShutdown;
11 years, 9 months
1
0
0
0
[pschweitzer] 58533: [CMD] Fix potential memory leaks
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Sun Mar 17 11:06:37 2013 New Revision: 58533 URL:
http://svn.reactos.org/svn/reactos?rev=58533&view=rev
Log: [CMD] Fix potential memory leaks Modified: trunk/reactos/base/shell/cmd/filecomp.c Modified: trunk/reactos/base/shell/cmd/filecomp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/filecomp.c?…
============================================================================== --- trunk/reactos/base/shell/cmd/filecomp.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/filecomp.c [iso-8859-1] Sun Mar 17 11:06:37 2013 @@ -491,9 +491,15 @@ INT ret; File1 = cmd_alloc(sizeof(FileName)); + if (!File1) + return 0; + File2 = cmd_alloc(sizeof(FileName)); - if(!File1 || !File2) + if(!File2) + { + cmd_free(File1); return 0; + } memcpy(File1,arg1,sizeof(FileName)); memcpy(File2,arg2,sizeof(FileName)); @@ -666,8 +672,8 @@ /* Don't show files when they are doing 'cd' or 'rd' */ if(!ShowAll && - file.dwFileAttributes != 0xFFFFFFFF && - !(file.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) + file.dwFileAttributes != 0xFFFFFFFF && + !(file.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { continue; } @@ -688,7 +694,7 @@ } while(FindNextFile(hFile,&file)); - FindClose(hFile); + FindClose(hFile); /* Check the size of the list to see if we found any matches */
11 years, 9 months
1
0
0
0
[ekohl] 58532: [LSASRV] - Implement LsaIFree_LSAPR_POLICY_INFORMATION, which will be used by msv1_0.dll. - Fix a potential compiler warning in LsapAddAuthPackage. - Remove an obsolete check from Ls...
by ekohl@svn.reactos.org
Author: ekohl Date: Sun Mar 17 10:49:46 2013 New Revision: 58532 URL:
http://svn.reactos.org/svn/reactos?rev=58532&view=rev
Log: [LSASRV] - Implement LsaIFree_LSAPR_POLICY_INFORMATION, which will be used by msv1_0.dll. - Fix a potential compiler warning in LsapAddAuthPackage. - Remove an obsolete check from LsarSetAuditEvents. Modified: trunk/reactos/dll/win32/lsasrv/authpackage.c trunk/reactos/dll/win32/lsasrv/lsasrv.c trunk/reactos/dll/win32/lsasrv/lsasrv.spec trunk/reactos/dll/win32/lsasrv/policy.c Modified: trunk/reactos/dll/win32/lsasrv/authpackage.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/authpacka…
============================================================================== --- trunk/reactos/dll/win32/lsasrv/authpackage.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/lsasrv/authpackage.c [iso-8859-1] Sun Mar 17 10:49:46 2013 @@ -231,7 +231,7 @@ TRACE("Package Name: %s\n", Package->Name->Buffer); Package->Id = *Id; - *Id++; + (*Id)++; InsertTailList(&PackageListHead, &Package->Entry); Modified: trunk/reactos/dll/win32/lsasrv/lsasrv.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/lsasrv.c?…
============================================================================== --- trunk/reactos/dll/win32/lsasrv/lsasrv.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/lsasrv/lsasrv.c [iso-8859-1] Sun Mar 17 10:49:46 2013 @@ -14,6 +14,113 @@ /* FUNCTIONS ***************************************************************/ + +VOID +NTAPI +LsaIFree_LSAPR_POLICY_INFORMATION(IN POLICY_INFORMATION_CLASS InformationClass, + IN PLSAPR_POLICY_INFORMATION PolicyInformation) +{ + if (PolicyInformation != NULL) + { + switch (InformationClass) + { + case PolicyAuditLogInformation: /* 1 */ + break; + + case PolicyAuditEventsInformation: /* 2 */ + if (PolicyInformation->PolicyAuditEventsInfo.EventAuditingOptions != NULL) + midl_user_free(PolicyInformation->PolicyAuditEventsInfo.EventAuditingOptions); + break; + + case PolicyPrimaryDomainInformation: /* 3 */ + if (PolicyInformation->PolicyPrimaryDomInfo.Name.Buffer != NULL) + midl_user_free(PolicyInformation->PolicyPrimaryDomInfo.Name.Buffer); + + if (PolicyInformation->PolicyPrimaryDomInfo.Sid != NULL) + midl_user_free(PolicyInformation->PolicyPrimaryDomInfo.Sid); + break; + + case PolicyPdAccountInformation: /* 4 */ + if (PolicyInformation->PolicyPdAccountInfo.Name.Buffer != NULL) + midl_user_free(PolicyInformation->PolicyPdAccountInfo.Name.Buffer); + break; + + case PolicyAccountDomainInformation: /* 5 */ + if (PolicyInformation->PolicyAccountDomainInfo.DomainName.Buffer != NULL) + midl_user_free(PolicyInformation->PolicyAccountDomainInfo.DomainName.Buffer); + + if (PolicyInformation->PolicyAccountDomainInfo.Sid != NULL) + midl_user_free(PolicyInformation->PolicyAccountDomainInfo.Sid); + break; + + case PolicyLsaServerRoleInformation: /* 6 */ + break; + + case PolicyReplicaSourceInformation: /* 7 */ + if (PolicyInformation->PolicyReplicaSourceInfo.ReplicaSource.Buffer != NULL) + midl_user_free(PolicyInformation->PolicyReplicaSourceInfo.ReplicaSource.Buffer); + + if (PolicyInformation->PolicyReplicaSourceInfo.ReplicaAccountName.Buffer != NULL) + midl_user_free(PolicyInformation->PolicyReplicaSourceInfo.ReplicaAccountName.Buffer); + break; + + case PolicyDefaultQuotaInformation: /* 8 */ + break; + + case PolicyModificationInformation: /* 9 */ + break; + + case PolicyAuditFullSetInformation: /* 10 (0xA) */ + break; + + case PolicyAuditFullQueryInformation: /* 11 (0xB) */ + break; + + case PolicyDnsDomainInformation: /* 12 (0xC) */ + if (PolicyInformation->PolicyDnsDomainInfo.Name.Buffer != NULL) + midl_user_free(PolicyInformation->PolicyDnsDomainInfo.Name.Buffer); + + if (PolicyInformation->PolicyDnsDomainInfo.DnsDomainName.Buffer != NULL) + midl_user_free(PolicyInformation->PolicyDnsDomainInfo.DnsDomainName.Buffer); + + if (PolicyInformation->PolicyDnsDomainInfo.DnsForestName.Buffer != NULL) + midl_user_free(PolicyInformation->PolicyDnsDomainInfo.DnsForestName.Buffer); + + if (PolicyInformation->PolicyDnsDomainInfo.Sid != NULL) + midl_user_free(PolicyInformation->PolicyDnsDomainInfo.Sid); + break; + + case PolicyDnsDomainInformationInt: /* 13 (0xD) */ + if (PolicyInformation->PolicyDnsDomainInfoInt.Name.Buffer != NULL) + midl_user_free(PolicyInformation->PolicyDnsDomainInfoInt.Name.Buffer); + + if (PolicyInformation->PolicyDnsDomainInfoInt.DnsDomainName.Buffer != NULL) + midl_user_free(PolicyInformation->PolicyDnsDomainInfoInt.DnsDomainName.Buffer); + + if (PolicyInformation->PolicyDnsDomainInfoInt.DnsForestName.Buffer != NULL) + midl_user_free(PolicyInformation->PolicyDnsDomainInfoInt.DnsForestName.Buffer); + + if (PolicyInformation->PolicyDnsDomainInfoInt.Sid != NULL) + midl_user_free(PolicyInformation->PolicyDnsDomainInfoInt.Sid); + break; + + case PolicyLocalAccountDomainInformation: /* 14 (0xE) */ + if (PolicyInformation->PolicyLocalAccountDomainInfo.DomainName.Buffer != NULL) + midl_user_free(PolicyInformation->PolicyLocalAccountDomainInfo.DomainName.Buffer); + + if (PolicyInformation->PolicyLocalAccountDomainInfo.Sid != NULL) + midl_user_free(PolicyInformation->PolicyLocalAccountDomainInfo.Sid); + break; + + default: + ERR("Invalid InformationClass: %lu\n", InformationClass); + break; + } + + midl_user_free(PolicyInformation); + } +} + NTSTATUS WINAPI LsapInitLsa(VOID) Modified: trunk/reactos/dll/win32/lsasrv/lsasrv.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/lsasrv.sp…
============================================================================== --- trunk/reactos/dll/win32/lsasrv/lsasrv.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/lsasrv/lsasrv.spec [iso-8859-1] Sun Mar 17 10:49:46 2013 @@ -1,4 +1,3 @@ - @ stub LsaIAuditNotifyPackageLoad @ stub LsaIAuditSamEvent @ stub LsaIEnumerateSecrets @@ -6,7 +5,7 @@ @ stub LsaIFree_LSAI_SECRET_ENUM_BUFFER @ stub LsaIFree_LSAPR_ACCOUNT_ENUM_BUFFER @ stub LsaIFree_LSAPR_CR_CIPHER_VALUE - @ stub LsaIFree_LSAPR_POLICY_INFORMATION + @ stdcall LsaIFree_LSAPR_POLICY_INFORMATION(long ptr) @ stub LsaIFree_LSAPR_PRIVILEGE_ENUM_BUFFER @ stub LsaIFree_LSAPR_PRIVILEGE_SET @ stub LsaIFree_LSAPR_REFERENCED_DOMAIN_LIST Modified: trunk/reactos/dll/win32/lsasrv/policy.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/policy.c?…
============================================================================== --- trunk/reactos/dll/win32/lsasrv/policy.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/lsasrv/policy.c [iso-8859-1] Sun Mar 17 10:49:46 2013 @@ -824,8 +824,7 @@ AuditData, AttributeSize); - if (AuditData != NULL) - RtlFreeHeap(RtlGetProcessHeap(), 0, AuditData); + RtlFreeHeap(RtlGetProcessHeap(), 0, AuditData); return Status; }
11 years, 9 months
1
0
0
0
← Newer
1
...
7
8
9
10
11
12
13
...
25
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Results per page:
10
25
50
100
200