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
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
January 2012
----- 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
19 participants
559 discussions
Start a n
N
ew thread
[janderwald] 55167: [USBSTOR] - Add debug trace [USBOHCI] - Implement proper GetPortStatus [USBHUB] - Reset all connected ports before sending first SCE - USB Devices present before booting are now...
by janderwald@svn.reactos.org
Author: janderwald Date: Wed Jan 25 03:39:57 2012 New Revision: 55167 URL:
http://svn.reactos.org/svn/reactos?rev=55167&view=rev
Log: [USBSTOR] - Add debug trace [USBOHCI] - Implement proper GetPortStatus [USBHUB] - Reset all connected ports before sending first SCE - USB Devices present before booting are now detected with OHCI controller. EHCI code is present but not yet activated Modified: branches/usb-bringup-trunk/drivers/usb/usbhub_new/fdo.c branches/usb-bringup-trunk/drivers/usb/usbohci/hardware.cpp branches/usb-bringup-trunk/drivers/usb/usbstor/scsi.c Modified: branches/usb-bringup-trunk/drivers/usb/usbhub_new/fdo.c URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/u…
============================================================================== --- branches/usb-bringup-trunk/drivers/usb/usbhub_new/fdo.c [iso-8859-1] (original) +++ branches/usb-bringup-trunk/drivers/usb/usbhub_new/fdo.c [iso-8859-1] Wed Jan 25 03:39:57 2012 @@ -1443,8 +1443,37 @@ PVOID Context) { PDEVICE_OBJECT DeviceObject = (PDEVICE_OBJECT)Context; - - DPRINT1("Sending the initial SCE Request %x\n", DeviceObject); + NTSTATUS Status; + ULONG PortId; + PHUB_DEVICE_EXTENSION HubDeviceExtension; + PORT_STATUS_CHANGE StatusChange; + + HubDeviceExtension = (PHUB_DEVICE_EXTENSION) DeviceObject->DeviceExtension; + + DPRINT1("RootHubInitCallbackFunction Sending the initial SCE Request %x\n", DeviceObject); + + for (PortId = 1; PortId <= HubDeviceExtension->HubDescriptor.bNumberOfPorts; PortId++) + { + // + // get port status + // + Status = GetPortStatusAndChange(HubDeviceExtension->RootHubPhysicalDeviceObject, PortId, &StatusChange); + if (NT_SUCCESS(Status)) + { + // + // is there a device connected + // + if (StatusChange.Status & USB_PORT_STATUS_CONNECT) + { + // + // reset port + // + Status = SetPortFeature(HubDeviceExtension->RootHubPhysicalDeviceObject, PortId, PORT_RESET); + if (!NT_SUCCESS(Status)) + DPRINT1("Failed to reset on port %d\n", PortId); + } + } + } // // Send the first SCE Request @@ -1463,6 +1492,7 @@ PHUB_DEVICE_EXTENSION HubDeviceExtension; PDEVICE_OBJECT RootHubDeviceObject; PVOID HubInterfaceBusContext , UsbDInterfaceBusContext; + PORT_STATUS_CHANGE StatusChange; HubDeviceExtension = (PHUB_DEVICE_EXTENSION) DeviceObject->DeviceExtension; @@ -1800,6 +1830,32 @@ else { // + // reset ports + // + for (PortId = 1; PortId <= HubDeviceExtension->HubDescriptor.bNumberOfPorts; PortId++) + { + // + // get port status + // + Status = GetPortStatusAndChange(HubDeviceExtension->RootHubPhysicalDeviceObject, PortId, &StatusChange); + if (NT_SUCCESS(Status)) + { + // + // is there a device connected + // + if (StatusChange.Status & USB_PORT_STATUS_CONNECT) + { + // + // reset port + // + Status = SetPortFeature(HubDeviceExtension->RootHubPhysicalDeviceObject, PortId, PORT_RESET); + if (!NT_SUCCESS(Status)) + DPRINT1("Failed to reset on port %d\n", PortId); + } + } + } + + // // Send the first SCE Request // QueryStatusChangeEndpoint(DeviceObject); Modified: branches/usb-bringup-trunk/drivers/usb/usbohci/hardware.cpp URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/u…
============================================================================== --- branches/usb-bringup-trunk/drivers/usb/usbohci/hardware.cpp [iso-8859-1] (original) +++ branches/usb-bringup-trunk/drivers/usb/usbohci/hardware.cpp [iso-8859-1] Wed Jan 25 03:39:57 2012 @@ -1036,11 +1036,54 @@ OUT USHORT *PortStatus, OUT USHORT *PortChange) { - // - // FIXME: should read status from hardware - // - *PortStatus = m_PortStatus[PortId].PortStatus; - *PortChange = m_PortStatus[PortId].PortChange; + ULONG Value; + + if (PortId > m_NumberOfPorts) + return STATUS_UNSUCCESSFUL; + + // init result variables + *PortStatus = 0; + *PortChange = 0; + + // + // read port status + // + Value = READ_REGISTER_ULONG((PULONG)((PUCHAR)m_Base + OHCI_RH_PORT_STATUS(PortId))); + DPRINT("GetPortStatus PortId %x Value %x\n", PortId, Value); + + + // connected + if (Value & OHCI_RH_PORTSTATUS_CCS) + *PortStatus |= USB_PORT_STATUS_CONNECT; + + // did a device connect? + if (Value & OHCI_RH_PORTSTATUS_CSC) + *PortChange |= USB_PORT_STATUS_CONNECT; + + // port enabled + if (Value & OHCI_RH_PORTSTATUS_PES) + *PortStatus |= USB_PORT_STATUS_ENABLE; + + // port enabled + if (Value & OHCI_RH_PORTSTATUS_PESC) + *PortChange |= USB_PORT_STATUS_ENABLE; + + // port suspend + if (Value & OHCI_RH_PORTSTATUS_PSS) + *PortStatus |= USB_PORT_STATUS_SUSPEND; + + // port suspend + if (Value & OHCI_RH_PORTSTATUS_PSSC) + *PortChange |= USB_PORT_STATUS_ENABLE; + + // port reset + if (Value & OHCI_RH_PORTSTATUS_PSS) + *PortStatus |= USB_PORT_STATUS_RESET; + + // port reset + if (Value & OHCI_RH_PORTSTATUS_PRSC) + *PortChange |= USB_PORT_STATUS_RESET; + return STATUS_SUCCESS; } Modified: branches/usb-bringup-trunk/drivers/usb/usbstor/scsi.c URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/u…
============================================================================== --- branches/usb-bringup-trunk/drivers/usb/usbstor/scsi.c [iso-8859-1] (original) +++ branches/usb-bringup-trunk/drivers/usb/usbstor/scsi.c [iso-8859-1] Wed Jan 25 03:39:57 2012 @@ -1221,7 +1221,7 @@ } else { - UNIMPLEMENTED; + DPRINT1("UNIMPLEMENTED Operation Code %x\n", pCDB->AsByte[0]); Request->SrbStatus = SRB_STATUS_ERROR; Status = STATUS_NOT_SUPPORTED; DbgBreakPoint();
12 years, 8 months
1
0
0
0
[cgutman] 55166: [USBSTOR] - Fix a bug in SRB queuing
by cgutman@svn.reactos.org
Author: cgutman Date: Wed Jan 25 01:46:35 2012 New Revision: 55166 URL:
http://svn.reactos.org/svn/reactos?rev=55166&view=rev
Log: [USBSTOR] - Fix a bug in SRB queuing Modified: branches/usb-bringup-trunk/drivers/usb/usbstor/queue.c Modified: branches/usb-bringup-trunk/drivers/usb/usbstor/queue.c URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/u…
============================================================================== --- branches/usb-bringup-trunk/drivers/usb/usbstor/queue.c [iso-8859-1] (original) +++ branches/usb-bringup-trunk/drivers/usb/usbstor/queue.c [iso-8859-1] Wed Jan 25 01:46:35 2012 @@ -142,6 +142,8 @@ PFDO_DEVICE_EXTENSION FDODeviceExtension; BOOLEAN IrpListFreeze; BOOLEAN SrbProcessing; + PIO_STACK_LOCATION IoStack = IoGetCurrentIrpStackLocation(Irp); + PSCSI_REQUEST_BLOCK Request = (PSCSI_REQUEST_BLOCK)IoStack->Parameters.Others.Argument1; // // get FDO device extension @@ -201,10 +203,15 @@ // if (SrbProcessing) { + ASSERT(FDODeviceExtension->ActiveSrb != NULL); + OldDriverCancel = IoSetCancelRoutine(Irp, USBSTOR_Cancel); } else { + ASSERT(FDODeviceExtension->ActiveSrb == NULL); + + FDODeviceExtension->ActiveSrb = Request; OldDriverCancel = IoSetCancelRoutine(Irp, USBSTOR_CancelIo); }
12 years, 8 months
1
0
0
0
[cgutman] 55165: [USBSTOR] - Get the actual value for the removable media bit instead of hardcoding it to true
by cgutman@svn.reactos.org
Author: cgutman Date: Wed Jan 25 01:09:59 2012 New Revision: 55165 URL:
http://svn.reactos.org/svn/reactos?rev=55165&view=rev
Log: [USBSTOR] - Get the actual value for the removable media bit instead of hardcoding it to true Modified: branches/usb-bringup-trunk/drivers/usb/usbstor/disk.c Modified: branches/usb-bringup-trunk/drivers/usb/usbstor/disk.c URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/u…
============================================================================== --- branches/usb-bringup-trunk/drivers/usb/usbstor/disk.c [iso-8859-1] (original) +++ branches/usb-bringup-trunk/drivers/usb/usbstor/disk.c [iso-8859-1] Wed Jan 25 01:09:59 2012 @@ -390,7 +390,7 @@ DeviceDescriptor->Size = TotalLength; DeviceDescriptor->DeviceType = InquiryData->DeviceType; DeviceDescriptor->DeviceTypeModifier = (InquiryData->RMB & 0x7F); - DeviceDescriptor->RemovableMedia = TRUE; + DeviceDescriptor->RemovableMedia = (InquiryData->RMB & 0x80) ? TRUE : FALSE; DeviceDescriptor->CommandQueueing = FALSE; DeviceDescriptor->BusType = BusTypeUsb; DeviceDescriptor->VendorIdOffset = sizeof(STORAGE_DEVICE_DESCRIPTOR) - sizeof(UCHAR); @@ -641,7 +641,7 @@ ScsiInquiryData->DeviceTypeQualifier = (UFIInquiryResponse->RMB & 0x7F); /* Hack for IoReadPartitionTable call in disk.sys */ - ScsiInquiryData->RemovableMedia = (ScsiInquiryData->DeviceType != DIRECT_ACCESS_DEVICE) ? 1 : 0; + ScsiInquiryData->RemovableMedia = ((ScsiInquiryData->DeviceType != DIRECT_ACCESS_DEVICE) ? ((UFIInquiryResponse->RMB & 0x80) ? 1 : 0) : 0); ScsiInquiryData->Versions = 0x04; ScsiInquiryData->ResponseDataFormat = 0x02;
12 years, 8 months
1
0
0
0
[cgutman] 55164: [CDROM.INF] - Fix various issues
by cgutman@svn.reactos.org
Author: cgutman Date: Wed Jan 25 00:16:40 2012 New Revision: 55164 URL:
http://svn.reactos.org/svn/reactos?rev=55164&view=rev
Log: [CDROM.INF] - Fix various issues Modified: branches/usb-bringup-trunk/media/inf/cdrom.inf Modified: branches/usb-bringup-trunk/media/inf/cdrom.inf URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/media/inf/cdr…
============================================================================== Binary files - no diff available.
12 years, 8 months
1
0
0
0
[akhaldi] 55163: [MCICDA] * Sync to Wine 1.3.37.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Jan 25 00:15:18 2012 New Revision: 55163 URL:
http://svn.reactos.org/svn/reactos?rev=55163&view=rev
Log: [MCICDA] * Sync to Wine 1.3.37. Modified: trunk/reactos/dll/win32/mcicda/mcicda.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/mcicda/mcicda.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mcicda/mcicda.c?…
============================================================================== --- trunk/reactos/dll/win32/mcicda/mcicda.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mcicda/mcicda.c [iso-8859-1] Wed Jan 25 00:15:18 2012 @@ -33,7 +33,6 @@ #include "wownt32.h" #include "mmddk.h" #include "winioctl.h" -#define __NTDDSTOR_H /* ROS HACK */ #include "ntddcdrm.h" #include "winternl.h" #include "wine/debug.h" @@ -59,7 +58,7 @@ UINT wDevID; int nUseCount; /* Incremented for each shared open */ BOOL fShareable; /* TRUE if first open was shareable */ - WORD wNotifyDeviceID; /* MCI device ID with a pending notification */ + MCIDEVICEID wNotifyDeviceID; /* MCI device ID with a pending notification */ HANDLE hCallback; /* Callback handle for pending notification */ DWORD dwTimeFormat; HANDLE handle; @@ -142,17 +141,12 @@ IDirectSoundBuffer_Stop(wmcda->dsBuf); SetEvent(wmcda->stopEvent); - EnterCriticalSection(&wmcda->cs); - if (wmcda->hCallback) { - mciDriverNotify(wmcda->hCallback, wmcda->wNotifyDeviceID, - FAILED(hr) ? MCI_NOTIFY_FAILURE : - ((endPos!=lastPos) ? MCI_NOTIFY_ABORTED : - MCI_NOTIFY_SUCCESSFUL)); - wmcda->hCallback = NULL; - } - LeaveCriticalSection(&wmcda->cs); - - ExitThread(0); + /* A design bug in native: the independent CD player called by the + * MCI has no means to signal end of playing, therefore the MCI + * notification is left hanging. MCI_NOTIFY_SUPERSEDED will be + * signaled by the next command that has MCI_NOTIFY set (or + * MCI_NOTIFY_ABORTED for MCI_PLAY). */ + return 0; } @@ -167,6 +161,7 @@ WINE_MCICDAUDIO* wmcda; if (!modp) return 0xFFFFFFFF; + /* FIXME: MCIERR_CANNOT_LOAD_DRIVER if there's no drive of type CD-ROM */ wmcda = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WINE_MCICDAUDIO)); @@ -184,6 +179,7 @@ modp->wCustomCommandTable = MCI_NO_COMMAND_TABLE; modp->wType = MCI_DEVTYPE_CD_AUDIO; InitializeCriticalSection(&wmcda->cs); + wmcda->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": WINE_MCICDAUDIO.cs"); return modp->wDeviceID; } @@ -195,6 +191,7 @@ WINE_MCICDAUDIO* wmcda = (WINE_MCICDAUDIO*)mciGetDriverData(dwDevID); if (wmcda) { + wmcda->cs.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&wmcda->cs); HeapFree(GetProcessHeap(), 0, wmcda); mciSetDriverData(dwDevID, 0); @@ -214,6 +211,20 @@ return 0; } return wmcda; +} + +/************************************************************************** + * MCICDA_mciNotify [internal] + * + * Notifications in MCI work like a 1-element queue. + * Each new notification request supersedes the previous one. + */ +static void MCICDA_Notify(DWORD_PTR hWndCallBack, WINE_MCICDAUDIO* wmcda, UINT wStatus) +{ + MCIDEVICEID wDevID = wmcda->wNotifyDeviceID; + HANDLE old = InterlockedExchangePointer(&wmcda->hCallback, NULL); + if (old) mciDriverNotify(old, wDevID, MCI_NOTIFY_SUPERSEDED); + mciDriverNotify(HWND_32(LOWORD(hWndCallBack)), wDevID, wStatus); } /************************************************************************** @@ -270,6 +281,7 @@ switch (GetLastError()) { case ERROR_NOT_READY: return MCIERR_DEVICE_NOT_READY; + case ERROR_NOT_SUPPORTED: case ERROR_IO_DEVICE: return MCIERR_HARDWARE; default: FIXME("Unknown mode %u\n", GetLastError()); @@ -384,7 +396,6 @@ return dwTime; } -static DWORD MCICDA_Seek(UINT wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms); static DWORD MCICDA_Stop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms); /************************************************************************** @@ -392,11 +403,10 @@ */ static DWORD MCICDA_Open(UINT wDevID, DWORD dwFlags, LPMCI_OPEN_PARMSW lpOpenParms) { - DWORD dwDeviceID; - DWORD ret = MCIERR_HARDWARE; + MCIDEVICEID dwDeviceID; + DWORD ret; WINE_MCICDAUDIO* wmcda = (WINE_MCICDAUDIO*)mciGetDriverData(wDevID); WCHAR root[7], drive = 0; - unsigned int count; TRACE("(%04X, %08X, %p);\n", wDevID, dwFlags, lpOpenParms); @@ -420,33 +430,32 @@ if (dwFlags & MCI_OPEN_ELEMENT) { if (dwFlags & MCI_OPEN_ELEMENT_ID) { WARN("MCI_OPEN_ELEMENT_ID %p! Abort\n", lpOpenParms->lpstrElementName); - ret = MCIERR_NO_ELEMENT_ALLOWED; + ret = MCIERR_FLAGS_NOT_COMPATIBLE; goto the_error; } TRACE("MCI_OPEN_ELEMENT element name: %s\n", debugstr_w(lpOpenParms->lpstrElementName)); - if (!isalpha(lpOpenParms->lpstrElementName[0]) || lpOpenParms->lpstrElementName[1] != ':' || - (lpOpenParms->lpstrElementName[2] && lpOpenParms->lpstrElementName[2] != '\\')) + /* Only the first letter counts since w2k + * Win9x-NT accept only d: and w98SE accepts d:\foobar as well. + * Play d:\Track03.cda plays from the first track, not #3. */ + if (!isalpha(lpOpenParms->lpstrElementName[0])) { - WARN("MCI_OPEN_ELEMENT unsupported format: %s\n", - debugstr_w(lpOpenParms->lpstrElementName)); - ret = MCIERR_NO_ELEMENT_ALLOWED; + ret = MCIERR_INVALID_FILE; goto the_error; } drive = toupper(lpOpenParms->lpstrElementName[0]); root[0] = drive; root[1] = ':'; root[2] = '\\'; root[3] = '\0'; if (GetDriveTypeW(root) != DRIVE_CDROM) { - ret = MCIERR_INVALID_DEVICE_NAME; + ret = MCIERR_INVALID_FILE; goto the_error; } } else { - /* drive letter isn't passed... get the dwDeviceID'th cdrom in the system */ root[0] = 'A'; root[1] = ':'; root[2] = '\\'; root[3] = '\0'; - for (count = 0; root[0] <= 'Z'; root[0]++) + for ( ; root[0] <= 'Z'; root[0]++) { - if (GetDriveTypeW(root) == DRIVE_CDROM && ++count >= dwDeviceID) + if (GetDriveTypeW(root) == DRIVE_CDROM) { drive = root[0]; break; @@ -454,7 +463,7 @@ } if (!drive) { - ret = MCIERR_INVALID_DEVICE_ID; + ret = MCIERR_CANNOT_LOAD_DRIVER; /* drvOpen should return this */ goto the_error; } } @@ -466,12 +475,14 @@ root[0] = root[1] = '\\'; root[2] = '.'; root[3] = '\\'; root[4] = drive; root[5] = ':'; root[6] = '\0'; wmcda->handle = CreateFileW(root, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0); if (wmcda->handle == INVALID_HANDLE_VALUE) + { + ret = MCIERR_MUST_USE_SHAREABLE; goto the_error; + } if (dwFlags & MCI_NOTIFY) { - TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpOpenParms->dwCallback); mciDriverNotify(HWND_32(LOWORD(lpOpenParms->dwCallback)), - wmcda->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); + dwDeviceID, MCI_NOTIFY_SUCCESSFUL); } return 0; @@ -496,6 +507,8 @@ if (--wmcda->nUseCount == 0) { CloseHandle(wmcda->handle); } + if ((dwParam & MCI_NOTIFY) && lpParms) + MCICDA_Notify(lpParms->dwCallback, wmcda, MCI_NOTIFY_SUCCESSFUL); return 0; } @@ -505,11 +518,13 @@ static DWORD MCICDA_GetDevCaps(UINT wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_PARMS lpParms) { + WINE_MCICDAUDIO* wmcda = (WINE_MCICDAUDIO*)mciGetDriverData(wDevID); DWORD ret = 0; TRACE("(%04X, %08X, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; + if (wmcda == NULL) return MCIERR_INVALID_DEVICE_ID; if (dwFlags & MCI_GETDEVCAPS_ITEM) { TRACE("MCI_GETDEVCAPS_ITEM dwItem=%08X;\n", lpParms->dwItem); @@ -552,14 +567,17 @@ ret = MCI_RESOURCE_RETURNED; break; default: - ERR("Unsupported %x devCaps item\n", lpParms->dwItem); - return MCIERR_UNRECOGNIZED_COMMAND; + WARN("Unsupported %x devCaps item\n", lpParms->dwItem); + return MCIERR_UNSUPPORTED_FUNCTION; } } else { TRACE("No GetDevCaps-Item !\n"); - return MCIERR_UNRECOGNIZED_COMMAND; + return MCIERR_MISSING_PARAMETER; } TRACE("lpParms->dwReturn=%08X;\n", lpParms->dwReturn); + if (dwFlags & MCI_NOTIFY) { + MCICDA_Notify(lpParms->dwCallback, wmcda, MCI_NOTIFY_SUCCESSFUL); + } return ret; } @@ -632,19 +650,19 @@ str = buffer; } else { WARN("Don't know this info command (%u)\n", dwFlags); - ret = MCIERR_UNRECOGNIZED_COMMAND; - } - if (str) { - if (lpParms->dwRetSize <= strlenW(str)) { - lstrcpynW(lpParms->lpstrReturn, str, lpParms->dwRetSize - 1); - ret = MCIERR_PARAM_OVERFLOW; - } else { - strcpyW(lpParms->lpstrReturn, str); - } - } else { - *lpParms->lpstrReturn = 0; - } - TRACE("=> %s (%d)\n", debugstr_w(lpParms->lpstrReturn), ret); + ret = MCIERR_MISSING_PARAMETER; + } + if (!ret) { + TRACE("=> %s\n", debugstr_w(str)); + if (lpParms->dwRetSize) { + WCHAR zero = 0; + /* FIXME? Since NT, mciwave, mciseq and mcicda set dwRetSize + * to the number of characters written, excluding \0. */ + lstrcpynW(lpParms->lpstrReturn, str ? str : &zero, lpParms->dwRetSize); + } else ret = MCIERR_PARAM_OVERFLOW; + } + if (MMSYSERR_NOERROR==ret && (dwFlags & MCI_NOTIFY)) + MCICDA_Notify(lpParms->dwCallback, wmcda, MCI_NOTIFY_SUCCESSFUL); return ret; } @@ -665,11 +683,6 @@ if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wmcda == NULL) return MCIERR_INVALID_DEVICE_ID; - if (dwFlags & MCI_NOTIFY) { - TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); - mciDriverNotify(HWND_32(LOWORD(lpParms->dwCallback)), - wmcda->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); - } if (dwFlags & MCI_STATUS_ITEM) { TRACE("dwItem = %x\n", lpParms->dwItem); switch (lpParms->dwItem) { @@ -679,6 +692,7 @@ &data, sizeof(data), &br, NULL)) { return MCICDA_GetError(wmcda); + /* alt. data.CurrentPosition.TrackNumber = 1; -- what native yields */ } lpParms->dwReturn = data.CurrentPosition.TrackNumber; TRACE("CURRENT_TRACK=%lu\n", lpParms->dwReturn); @@ -737,7 +751,8 @@ return MCICDA_GetError(wmcda); break; case MCI_STATUS_POSITION: - if (dwFlags & MCI_STATUS_START) { + switch (dwFlags & (MCI_STATUS_START | MCI_TRACK)) { + case MCI_STATUS_START: if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, &toc, sizeof(toc), &br, NULL)) { WARN("error reading TOC !\n"); @@ -745,7 +760,8 @@ } lpParms->dwReturn = FRAME_OF_TOC(toc, toc.FirstTrack); TRACE("get MCI_STATUS_START !\n"); - } else if (dwFlags & MCI_TRACK) { + break; + case MCI_TRACK: if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, &toc, sizeof(toc), &br, NULL)) { WARN("error reading TOC !\n"); @@ -755,13 +771,17 @@ return MCIERR_OUTOFRANGE; lpParms->dwReturn = FRAME_OF_TOC(toc, lpParms->dwTrack); TRACE("get MCI_TRACK #%u !\n", lpParms->dwTrack); - } else { + break; + case 0: fmt.Format = IOCTL_CDROM_CURRENT_POSITION; if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_Q_CHANNEL, &fmt, sizeof(fmt), &data, sizeof(data), &br, NULL)) { return MCICDA_GetError(wmcda); } lpParms->dwReturn = FRAME_OF_ADDR(data.CurrentPosition.AbsoluteAddress); + break; + default: + return MCIERR_FLAGS_NOT_COMPATIBLE; } lpParms->dwReturn = MCICDA_CalcTime(wmcda, wmcda->dwTimeFormat, lpParms->dwReturn, &ret); TRACE("MCI_STATUS_POSITION=%08lX\n", lpParms->dwReturn); @@ -801,16 +821,17 @@ else lpParms->dwReturn = (toc.TrackData[lpParms->dwTrack - toc.FirstTrack].Control & 0x04) ? MCI_CDA_TRACK_OTHER : MCI_CDA_TRACK_AUDIO; + /* FIXME: MAKEMCIRESOURCE "audio" | "other", localised */ } TRACE("MCI_CDA_STATUS_TYPE_TRACK[%d]=%ld\n", lpParms->dwTrack, lpParms->dwReturn); break; default: FIXME("unknown command %08X !\n", lpParms->dwItem); - return MCIERR_UNRECOGNIZED_COMMAND; + return MCIERR_UNSUPPORTED_FUNCTION; } - } else { - WARN("not MCI_STATUS_ITEM !\n"); - } + } else return MCIERR_MISSING_PARAMETER; + if ((dwFlags & MCI_NOTIFY) && HRESULT_CODE(ret)==0) + MCICDA_Notify(lpParms->dwCallback, wmcda, MCI_NOTIFY_SUCCESSFUL); return ret; } @@ -827,24 +848,23 @@ WARN("error reading TOC !\n"); return MCICDA_GetError(wmcda); } - /* Locate first track whose starting frame is bigger than frame */ - for(i=toc.FirstTrack;i<=toc.LastTrack+1;i++) - if ( FRAME_OF_TOC(toc, i) > *frame ) break; - if (i <= toc.FirstTrack && i>toc.LastTrack+1) { - i = 0; /* requested address is out of range: go back to start */ - *frame = FRAME_OF_TOC(toc,toc.FirstTrack); - } - else - i--; + if (*frame < FRAME_OF_TOC(toc,toc.FirstTrack) || + *frame >= FRAME_OF_TOC(toc,toc.LastTrack+1)) /* lead-out */ + return MCIERR_OUTOFRANGE; + for(i=toc.LastTrack+1;i>toc.FirstTrack;i--) + if ( FRAME_OF_TOC(toc, i) <= *frame ) break; /* i points to last track whose start address is not greater than frame. * Now skip non-audio tracks */ - for(;i<=toc.LastTrack+1;i++) + for(;i<=toc.LastTrack;i++) if ( ! (toc.TrackData[i-toc.FirstTrack].Control & 4) ) break; /* The frame will be an address in the next audio track or * address of lead-out. */ if ( FRAME_OF_TOC(toc, i) > *frame ) *frame = FRAME_OF_TOC(toc, i); + /* Lead-out is an invalid seek position (on Linux as well). */ + if (*frame == FRAME_OF_TOC(toc,toc.LastTrack+1)) + (*frame)--; return 0; } @@ -855,6 +875,7 @@ { WINE_MCICDAUDIO* wmcda = MCICDA_GetOpenDrv(wDevID); DWORD ret = 0, start, end; + HANDLE oldcb; DWORD br; CDROM_PLAY_AUDIO_MSF play; CDROM_SUB_Q_DATA_FORMAT fmt; @@ -892,11 +913,26 @@ } if (dwFlags & MCI_TO) { end = MCICDA_CalcFrame(wmcda, lpParms->dwTo); + if ( (ret=MCICDA_SkipDataTracks(wmcda, &end)) ) + return ret; TRACE("MCI_TO=%08X -> %u\n", lpParms->dwTo, end); } else { end = FRAME_OF_TOC(toc, toc.LastTrack + 1) - 1; } + if (end < start) return MCIERR_OUTOFRANGE; TRACE("Playing from %u to %u\n", start, end); + + oldcb = InterlockedExchangePointer(&wmcda->hCallback, + (dwFlags & MCI_NOTIFY) ? HWND_32(LOWORD(lpParms->dwCallback)) : NULL); + if (oldcb) mciDriverNotify(oldcb, wmcda->wNotifyDeviceID, MCI_NOTIFY_ABORTED); + + if (start == end || start == FRAME_OF_TOC(toc,toc.LastTrack+1)-1) { + if (dwFlags & MCI_NOTIFY) { + oldcb = InterlockedExchangePointer(&wmcda->hCallback, NULL); + if (oldcb) mciDriverNotify(oldcb, wDevID, MCI_NOTIFY_SUCCESSFUL); + } + return MMSYSERR_NOERROR; + } if (wmcda->hThread != 0) { SetEvent(wmcda->stopEvent); @@ -913,14 +949,6 @@ IDirectSound_Release(wmcda->dsObj); wmcda->dsObj = NULL; } - else if(wmcda->hCallback) { - mciDriverNotify(wmcda->hCallback, wmcda->wNotifyDeviceID, - MCI_NOTIFY_ABORTED); - wmcda->hCallback = NULL; - } - - if ((dwFlags&MCI_NOTIFY)) - wmcda->hCallback = HWND_32(LOWORD(lpParms->dwCallback)); if (pDirectSoundCreate) { WAVEFORMATEX format; @@ -980,8 +1008,15 @@ wmcda->hThread = CreateThread(NULL, 0, MCICDA_playLoop, wmcda, 0, &br); if (wmcda->hThread != 0) { hr = IDirectSoundBuffer_Play(wmcda->dsBuf, 0, 0, DSBPLAY_LOOPING); - if (SUCCEEDED(hr)) + if (SUCCEEDED(hr)) { + /* FIXME: implement MCI_WAIT and send notification only in that case */ + if (0) { + oldcb = InterlockedExchangePointer(&wmcda->hCallback, NULL); + if (oldcb) mciDriverNotify(oldcb, wmcda->wNotifyDeviceID, + FAILED(hr) ? MCI_NOTIFY_FAILURE : MCI_NOTIFY_SUCCESSFUL); + } return ret; + } SetEvent(wmcda->stopEvent); WaitForSingleObject(wmcda->hThread, INFINITE); @@ -1014,13 +1049,9 @@ NULL, 0, &br, NULL)) { wmcda->hCallback = NULL; ret = MCIERR_HARDWARE; - } else if (dwFlags & MCI_NOTIFY) { - TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); - /* - mciDriverNotify(HWND_32(LOWORD(lpParms->dwCallback)), - wmcda->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); - */ - } + } + /* The independent CD player has no means to signal MCI_NOTIFY when it's done. + * Native sends a notification with MCI_WAIT only. */ return ret; } @@ -1030,11 +1061,15 @@ static DWORD MCICDA_Stop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms) { WINE_MCICDAUDIO* wmcda = MCICDA_GetOpenDrv(wDevID); + HANDLE oldcb; DWORD br; TRACE("(%04X, %08X, %p);\n", wDevID, dwFlags, lpParms); if (wmcda == NULL) return MCIERR_INVALID_DEVICE_ID; + + oldcb = InterlockedExchangePointer(&wmcda->hCallback, NULL); + if (oldcb) mciDriverNotify(oldcb, wmcda->wNotifyDeviceID, MCI_NOTIFY_ABORTED); if (wmcda->hThread != 0) { SetEvent(wmcda->stopEvent); @@ -1053,16 +1088,8 @@ else if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_STOP_AUDIO, NULL, 0, NULL, 0, &br, NULL)) return MCIERR_HARDWARE; - if (wmcda->hCallback) { - mciDriverNotify(wmcda->hCallback, wmcda->wNotifyDeviceID, MCI_NOTIFY_ABORTED); - wmcda->hCallback = NULL; - } - - if (lpParms && (dwFlags & MCI_NOTIFY)) { - TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); - mciDriverNotify(HWND_32(LOWORD(lpParms->dwCallback)), - wmcda->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); - } + if ((dwFlags & MCI_NOTIFY) && lpParms) + MCICDA_Notify(lpParms->dwCallback, wmcda, MCI_NOTIFY_SUCCESSFUL); return 0; } @@ -1072,11 +1099,15 @@ static DWORD MCICDA_Pause(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms) { WINE_MCICDAUDIO* wmcda = MCICDA_GetOpenDrv(wDevID); + HANDLE oldcb; DWORD br; TRACE("(%04X, %08X, %p);\n", wDevID, dwFlags, lpParms); if (wmcda == NULL) return MCIERR_INVALID_DEVICE_ID; + + oldcb = InterlockedExchangePointer(&wmcda->hCallback, NULL); + if (oldcb) mciDriverNotify(oldcb, wmcda->wNotifyDeviceID, MCI_NOTIFY_ABORTED); if (wmcda->hThread != 0) { /* Don't bother calling stop if the playLoop thread has already stopped */ @@ -1087,18 +1118,8 @@ else if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_PAUSE_AUDIO, NULL, 0, NULL, 0, &br, NULL)) return MCIERR_HARDWARE; - EnterCriticalSection(&wmcda->cs); - if (wmcda->hCallback) { - mciDriverNotify(wmcda->hCallback, wmcda->wNotifyDeviceID, MCI_NOTIFY_SUPERSEDED); - wmcda->hCallback = NULL; - } - LeaveCriticalSection(&wmcda->cs); - - if (lpParms && (dwFlags & MCI_NOTIFY)) { - TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); - mciDriverNotify(HWND_32(LOWORD(lpParms->dwCallback)), - wmcda->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); - } + if ((dwFlags & MCI_NOTIFY) && lpParms) + MCICDA_Notify(lpParms->dwCallback, wmcda, MCI_NOTIFY_SUCCESSFUL); return 0; } @@ -1123,11 +1144,8 @@ else if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_RESUME_AUDIO, NULL, 0, NULL, 0, &br, NULL)) return MCIERR_HARDWARE; - if (lpParms && (dwFlags & MCI_NOTIFY)) { - TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); - mciDriverNotify(HWND_32(LOWORD(lpParms->dwCallback)), - wmcda->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); - } + if ((dwFlags & MCI_NOTIFY) && lpParms) + MCICDA_Notify(lpParms->dwCallback, wmcda, MCI_NOTIFY_SUCCESSFUL); return 0; } @@ -1139,20 +1157,29 @@ DWORD at; WINE_MCICDAUDIO* wmcda = MCICDA_GetOpenDrv(wDevID); CDROM_SEEK_AUDIO_MSF seek; - DWORD br, ret; + DWORD br, position, ret; CDROM_TOC toc; TRACE("(%04X, %08X, %p);\n", wDevID, dwFlags, lpParms); if (wmcda == NULL) return MCIERR_INVALID_DEVICE_ID; if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; + + position = dwFlags & (MCI_SEEK_TO_START|MCI_SEEK_TO_END|MCI_TO); + if (!position) return MCIERR_MISSING_PARAMETER; + if (position&(position-1)) return MCIERR_FLAGS_NOT_COMPATIBLE; + + /* Stop sends MCI_NOTIFY_ABORTED when needed. + * Tests show that native first sends ABORTED and reads the TOC, + * then only checks the position flags, then stops and seeks. */ + MCICDA_Stop(wDevID, MCI_WAIT, 0); if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, &toc, sizeof(toc), &br, NULL)) { WARN("error reading TOC !\n"); return MCICDA_GetError(wmcda); } - switch (dwFlags & ~(MCI_NOTIFY|MCI_WAIT)) { + switch (position) { case MCI_SEEK_TO_START: TRACE("Seeking to start\n"); at = FRAME_OF_TOC(toc,toc.FirstTrack); @@ -1161,6 +1188,8 @@ break; case MCI_SEEK_TO_END: TRACE("Seeking to end\n"); + /* End is prior to lead-out + * yet Win9X seeks to even one frame less than that. */ at = FRAME_OF_TOC(toc, toc.LastTrack + 1) - 1; if ( (ret=MCICDA_SkipDataTracks(wmcda, &at)) ) return ret; @@ -1172,18 +1201,10 @@ return ret; break; default: - TRACE("Unknown seek action %08lX\n", - (dwFlags & ~(MCI_NOTIFY|MCI_WAIT))); - return MCIERR_UNSUPPORTED_FUNCTION; - } - - if (wmcda->hThread != 0) { - EnterCriticalSection(&wmcda->cs); - wmcda->start = at - FRAME_OF_TOC(toc, toc.FirstTrack); - /* Flush remaining data, or just let it play into the new data? */ - LeaveCriticalSection(&wmcda->cs); - } - else { + return MCIERR_FLAGS_NOT_COMPATIBLE; + } + + { seek.M = at / CDFRAMES_PERMIN; seek.S = (at / CDFRAMES_PERSEC) % 60; seek.F = at % CDFRAMES_PERSEC; @@ -1192,11 +1213,8 @@ return MCIERR_HARDWARE; } - if (dwFlags & MCI_NOTIFY) { - TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); - mciDriverNotify(HWND_32(LOWORD(lpParms->dwCallback)), - wmcda->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); - } + if (dwFlags & MCI_NOTIFY) + MCICDA_Notify(lpParms->dwCallback, wmcda, MCI_NOTIFY_SUCCESSFUL); return 0; } @@ -1242,7 +1260,6 @@ if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; /* TRACE("dwTimeFormat=%08lX\n", lpParms->dwTimeFormat); - TRACE("dwAudio=%08lX\n", lpParms->dwAudio); */ if (dwFlags & MCI_SET_TIME_FORMAT) { switch (lpParms->dwTimeFormat) { @@ -1256,20 +1273,15 @@ TRACE("MCI_FORMAT_TMSF !\n"); break; default: - WARN("bad time format !\n"); return MCIERR_BAD_TIME_FORMAT; } wmcda->dwTimeFormat = lpParms->dwTimeFormat; } - if (dwFlags & MCI_SET_VIDEO) return MCIERR_UNSUPPORTED_FUNCTION; - if (dwFlags & MCI_SET_ON) return MCIERR_UNSUPPORTED_FUNCTION; - if (dwFlags & MCI_SET_OFF) return MCIERR_UNSUPPORTED_FUNCTION; - if (dwFlags & MCI_NOTIFY) { - TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", - lpParms->dwCallback); - mciDriverNotify(HWND_32(LOWORD(lpParms->dwCallback)), - wmcda->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); - } + if (dwFlags & MCI_SET_AUDIO) /* one xp machine ignored it */ + TRACE("SET_AUDIO %X %x\n", dwFlags, lpParms->dwAudio); + + if (dwFlags & MCI_NOTIFY) + MCICDA_Notify(lpParms->dwCallback, wmcda, MCI_NOTIFY_SUCCESSFUL); return 0; } @@ -1308,10 +1320,11 @@ case MCI_SEEK: return MCICDA_Seek(dwDevID, dwParam1, (LPMCI_SEEK_PARMS)dwParam2); /* commands that should report an error as they are not supported in * the native version */ - case MCI_SET_DOOR_CLOSED: - case MCI_SET_DOOR_OPEN: + case MCI_RECORD: case MCI_LOAD: case MCI_SAVE: + return MCIERR_UNSUPPORTED_FUNCTION; + case MCI_BREAK: case MCI_FREEZE: case MCI_PUT: case MCI_REALIZE: Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Wed Jan 25 00:15:18 2012 @@ -84,7 +84,7 @@ reactos/dll/win32/lz32 # Autosync reactos/dll/win32/mapi32 # Autosync reactos/dll/win32/mciavi32 # Synced to Wine-1.3.37 -reactos/dll/win32/mcicda # Autosync +reactos/dll/win32/mcicda # Synced to Wine-1.3.37 reactos/dll/win32/mciqtz32 # Autosync reactos/dll/win32/mciseq # Autosync reactos/dll/win32/mciwave # Autosync
12 years, 8 months
1
0
0
0
[tfaber] 55162: [WS2_32] - Fix invalid AQ_WIN16 comparisons. Spotted by you-know-what. Fix taken from Wine.
by tfaber@svn.reactos.org
Author: tfaber Date: Wed Jan 25 00:12:18 2012 New Revision: 55162 URL:
http://svn.reactos.org/svn/reactos?rev=55162&view=rev
Log: [WS2_32] - Fix invalid AQ_WIN16 comparisons. Spotted by you-know-what. Fix taken from Wine. Modified: trunk/reactos/dll/win32/ws2_32/misc/async.c Modified: trunk/reactos/dll/win32/ws2_32/misc/async.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32/misc/asyn…
============================================================================== --- trunk/reactos/dll/win32/ws2_32/misc/async.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ws2_32/misc/async.c [iso-8859-1] Wed Jan 25 00:12:18 2012 @@ -200,23 +200,31 @@ WS_hostent *p_to32 = (WS_hostent*)p_to; int size = hostent_size(p_he) + ( - (flag & AQ_WIN16) ? sizeof(struct ws_hostent16) : sizeof(WS_hostent) + (flag & AQ_WIN32) ? sizeof(WS_hostent) : sizeof(struct ws_hostent16) - sizeof(struct hostent) ); if (t_size < size) return -size; p = p_to; - p += (flag & AQ_WIN16) ? - sizeof(struct ws_hostent16) : sizeof(WS_hostent); + p += (flag & AQ_WIN32) ? + sizeof(WS_hostent) : sizeof(struct ws_hostent16); p_name = p; strcpy(p, p_he->h_name); p += strlen(p) + 1; p_aliases = p; - p += list_dup(p_he->h_aliases, p, p_base + (p - (char*)p_to), 0); + p += list_dup(p_he->h_aliases, p, p_base + (p - p_to), 0); p_addr = p; - list_dup(p_he->h_addr_list, p, p_base + (p - (char*)p_to), p_he->h_length); - - if (flag & AQ_WIN16) + list_dup(p_he->h_addr_list, p, p_base + (p - p_to), p_he->h_length); + + if (flag & AQ_WIN32) + { + p_to32->h_addrtype = p_he->h_addrtype; + p_to32->h_length = p_he->h_length; + p_to32->h_name = (p_base + (p_name - p_to)); + p_to32->h_aliases = (char **)(p_base + (p_aliases - p_to)); + p_to32->h_addr_list = (char **)(p_base + (p_addr - p_to)); + } + else { p_to16->h_addrtype = (INT16)p_he->h_addrtype; p_to16->h_length = (INT16)p_he->h_length; @@ -224,14 +232,6 @@ p_to16->h_aliases = (SEGPTR)(p_base + (p_aliases - p_to)); p_to16->h_addr_list = (SEGPTR)(p_base + (p_addr - p_to)); } - else - { - p_to32->h_addrtype = p_he->h_addrtype; - p_to32->h_length = p_he->h_length; - p_to32->h_name = (p_base + (p_name - p_to)); - p_to32->h_aliases = (char **)(p_base + (p_aliases - p_to)); - p_to32->h_addr_list = (char **)(p_base + (p_addr - p_to)); - } return size; } @@ -258,31 +258,30 @@ WS_protoent *p_to32 = (WS_protoent*)p_to; int size = protoent_size(p_pe) + ( - (flag & AQ_WIN16) ? sizeof(struct ws_protoent16) : sizeof(WS_protoent) + (flag & AQ_WIN32) ? sizeof(WS_protoent) : sizeof(struct ws_protoent16) - sizeof(struct protoent) ); if (t_size < size) return -size; p = p_to; - p += (flag & AQ_WIN16) ? - sizeof(struct ws_protoent16) : sizeof(WS_protoent); + p += (flag & AQ_WIN32) ? sizeof(WS_protoent) : sizeof(struct ws_protoent16); p_name = p; strcpy(p, p_pe->p_name); p += strlen(p) + 1; p_aliases = p; - list_dup(p_pe->p_aliases, p, p_base + (p - (char*)p_to), 0); - - if (flag & AQ_WIN16) + list_dup(p_pe->p_aliases, p, p_base + (p - p_to), 0); + + if (flag & AQ_WIN32) + { + p_to32->p_proto = p_pe->p_proto; + p_to32->p_name = (p_base) + (p_name - p_to); + p_to32->p_aliases = (char **)((p_base) + (p_aliases - p_to)); + } + else { p_to16->p_proto = (INT16)p_pe->p_proto; p_to16->p_name = (SEGPTR)(p_base) + (p_name - p_to); p_to16->p_aliases = (SEGPTR)((p_base) + (p_aliases - p_to)); - } - else - { - p_to32->p_proto = p_pe->p_proto; - p_to32->p_name = (p_base) + (p_name - p_to); - p_to32->p_aliases = (char **)((p_base) + (p_aliases - p_to)); } return size; @@ -312,15 +311,14 @@ WS_servent *p_to32 = (WS_servent*)p_to; int size = servent_size(p_se) + ( - (flag & AQ_WIN16) ? sizeof(struct ws_servent16) : sizeof(WS_servent) + (flag & AQ_WIN32) ? sizeof(WS_servent) : sizeof(struct ws_servent16) - sizeof(struct servent) ); if (t_size < size) return -size; p = p_to; - p += (flag & AQ_WIN16) ? - sizeof(struct ws_servent16) : sizeof(WS_servent); + p += (flag & AQ_WIN32) ? sizeof(WS_servent) : sizeof(struct ws_servent16); p_name = p; strcpy(p, p_se->s_name); p += strlen(p) + 1; p_proto = p; @@ -328,19 +326,19 @@ p_aliases = p; list_dup(p_se->s_aliases, p, p_base + (p - p_to), 0); - if (flag & AQ_WIN16) + if (flag & AQ_WIN32) + { + p_to32->s_port = p_se->s_port; + p_to32->s_name = (p_base + (p_name - p_to)); + p_to32->s_proto = (p_base + (p_proto - p_to)); + p_to32->s_aliases = (char **)(p_base + (p_aliases - p_to)); + } + else { p_to16->s_port = (INT16)p_se->s_port; p_to16->s_name = (SEGPTR)(p_base + (p_name - p_to)); p_to16->s_proto = (SEGPTR)(p_base + (p_proto - p_to)); p_to16->s_aliases = (SEGPTR)(p_base + (p_aliases - p_to)); - } - else - { - p_to32->s_port = p_se->s_port; - p_to32->s_name = (p_base + (p_name - p_to)); - p_to32->s_proto = (p_base + (p_proto - p_to)); - p_to32->s_aliases = (char **)(p_base + (p_aliases - p_to)); } return size;
12 years, 8 months
1
0
0
0
[tfaber] 55161: [NTOSKRNL] - Fix some DPRINTs. Spotted by VS11.
by tfaber@svn.reactos.org
Author: tfaber Date: Wed Jan 25 00:09:43 2012 New Revision: 55161 URL:
http://svn.reactos.org/svn/reactos?rev=55161&view=rev
Log: [NTOSKRNL] - Fix some DPRINTs. Spotted by VS11. Modified: trunk/reactos/ntoskrnl/cache/section/io.c trunk/reactos/ntoskrnl/cc/view.c trunk/reactos/ntoskrnl/include/internal/i386/trap_x.h trunk/reactos/ntoskrnl/include/internal/ob_x.h Modified: trunk/reactos/ntoskrnl/cache/section/io.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cache/section/io.…
============================================================================== --- trunk/reactos/ntoskrnl/cache/section/io.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/cache/section/io.c [iso-8859-1] Wed Jan 25 00:09:43 2012 @@ -74,11 +74,11 @@ PMDL Mdl = Irp->MdlAddress; /* Unlock MDL Pages, page 167. */ - DPRINT("MiSimpleReadComplete %x\n", Irp); + DPRINT("MiSimpleReadComplete %p\n", Irp); while (Mdl) { - DPRINT("MDL Unlock %x\n", Mdl); - MmUnlockPages(Mdl); + DPRINT("MDL Unlock %p\n", Mdl); + MmUnlockPages(Mdl); Mdl = Mdl->Next; } @@ -123,8 +123,8 @@ ASSERT(DeviceObject); DPRINT - ("PAGING READ: FileObject %x <%wZ> Offset %08x%08x Length %d\n", - &FileObject, + ("PAGING READ: FileObject %p <%wZ> Offset %08x%08x Length %d\n", + FileObject, &FileObject->FileName, FileOffset->HighPart, FileOffset->LowPart, @@ -215,8 +215,8 @@ ASSERT(DeviceObject); DPRINT - ("PAGING WRITE: FileObject %x Offset %x Length %d (%s:%d)\n", - &FileObject, + ("PAGING WRITE: FileObject %p Offset %x Length %d (%s:%d)\n", + FileObject, FileOffset->LowPart, Length, File, Modified: trunk/reactos/ntoskrnl/cc/view.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/view.c?rev=551…
============================================================================== --- trunk/reactos/ntoskrnl/cc/view.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/cc/view.c [iso-8859-1] Wed Jan 25 00:09:43 2012 @@ -866,7 +866,7 @@ */ *UptoDate = current->Valid; *BaseAddress = current->BaseAddress; - DPRINT("*BaseAddress 0x%.8X\n", *BaseAddress); + DPRINT("*BaseAddress %p\n", *BaseAddress); *CacheSeg = current; *BaseOffset = current->FileOffset; return(STATUS_SUCCESS); Modified: trunk/reactos/ntoskrnl/include/internal/i386/trap_x.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/i386/trap_x.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/i386/trap_x.h [iso-8859-1] Wed Jan 25 00:09:43 2012 @@ -64,7 +64,7 @@ DbgPrint("Ecx: %x\n", TrapFrame->Ecx); DbgPrint("Eax: %x\n", TrapFrame->Eax); DbgPrint("PreviousPreviousMode: %x\n", TrapFrame->PreviousPreviousMode); - DbgPrint("ExceptionList: %x\n", TrapFrame->ExceptionList); + DbgPrint("ExceptionList: %p\n", TrapFrame->ExceptionList); DbgPrint("SegFs: %x\n", TrapFrame->SegFs); DbgPrint("Edi: %x\n", TrapFrame->Edi); DbgPrint("Esi: %x\n", TrapFrame->Esi); Modified: trunk/reactos/ntoskrnl/include/internal/ob_x.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/ob_x.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/ob_x.h [iso-8859-1] Wed Jan 25 00:09:43 2012 @@ -398,7 +398,7 @@ if (CalloutIrql != KeGetCurrentIrql()) { /* Print error */ - DbgPrint("OB: ObjectType: %wZ Procedure: %s Object: %08x\n", + DbgPrint("OB: ObjectType: %wZ Procedure: %s Object: %p\n", &ObjectType->Name, Procedure, Object); DbgPrint(" Returned at %x IRQL, but was called at %x IRQL\n", KeGetCurrentIrql(), CalloutIrql);
12 years, 8 months
1
0
0
0
[cgutman] 55160: [USBSTOR] - Don't lie about removable media support for anything except hard drives
by cgutman@svn.reactos.org
Author: cgutman Date: Wed Jan 25 00:03:18 2012 New Revision: 55160 URL:
http://svn.reactos.org/svn/reactos?rev=55160&view=rev
Log: [USBSTOR] - Don't lie about removable media support for anything except hard drives Modified: branches/usb-bringup-trunk/drivers/usb/usbstor/disk.c Modified: branches/usb-bringup-trunk/drivers/usb/usbstor/disk.c URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/u…
============================================================================== --- branches/usb-bringup-trunk/drivers/usb/usbstor/disk.c [iso-8859-1] (original) +++ branches/usb-bringup-trunk/drivers/usb/usbstor/disk.c [iso-8859-1] Wed Jan 25 00:03:18 2012 @@ -639,7 +639,10 @@ RtlZeroMemory(ScsiInquiryData, sizeof(INQUIRYDATA)); ScsiInquiryData->DeviceType = UFIInquiryResponse->DeviceType; ScsiInquiryData->DeviceTypeQualifier = (UFIInquiryResponse->RMB & 0x7F); - ScsiInquiryData->RemovableMedia = FALSE; //HACK for IoReadPartitionTable + + /* Hack for IoReadPartitionTable call in disk.sys */ + ScsiInquiryData->RemovableMedia = (ScsiInquiryData->DeviceType != DIRECT_ACCESS_DEVICE) ? 1 : 0; + ScsiInquiryData->Versions = 0x04; ScsiInquiryData->ResponseDataFormat = 0x02; ScsiInquiryData->AdditionalLength = 31;
12 years, 8 months
1
0
0
0
[janderwald] 55159: [INF] - Try add support for USB CD/DVD Drives
by janderwald@svn.reactos.org
Author: janderwald Date: Tue Jan 24 23:19:43 2012 New Revision: 55159 URL:
http://svn.reactos.org/svn/reactos?rev=55159&view=rev
Log: [INF] - Try add support for USB CD/DVD Drives Modified: branches/usb-bringup-trunk/media/inf/cdrom.inf Modified: branches/usb-bringup-trunk/media/inf/cdrom.inf URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/media/inf/cdr…
============================================================================== Binary files - no diff available.
12 years, 8 months
1
0
0
0
[akhaldi] 55158: [PSDK] * Update winbase.h annotations.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Jan 24 23:11:46 2012 New Revision: 55158 URL:
http://svn.reactos.org/svn/reactos?rev=55158&view=rev
Log: [PSDK] * Update winbase.h annotations. Modified: trunk/reactos/include/psdk/winbase.h Modified: trunk/reactos/include/psdk/winbase.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winbase.h?rev…
============================================================================== --- trunk/reactos/include/psdk/winbase.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/winbase.h [iso-8859-1] Tue Jan 24 23:11:46 2012 @@ -1152,7 +1152,15 @@ } ACTIVATION_CONTEXT_BASIC_INFORMATION, *PACTIVATION_CONTEXT_BASIC_INFORMATION; typedef const struct _ACTIVATION_CONTEXT_BASIC_INFORMATION *PCACTIVATION_CONTEXT_BASIC_INFORMATION; -typedef BOOL (WINAPI *PQUERYACTCTXW_FUNC)(DWORD,HANDLE,PVOID,ULONG,PVOID,SIZE_T,SIZE_T *); +typedef BOOL +(WINAPI *PQUERYACTCTXW_FUNC)( + _In_ DWORD dwFlags, + _In_ HANDLE hActCtx, + _In_opt_ PVOID pvSubInstance, + _In_ ULONG ulInfoClass, + _Out_writes_bytes_to_opt_(cbBuffer, *pcbWrittenOrRequired) PVOID pvBuffer, + _In_ SIZE_T cbBuffer, + _Out_opt_ SIZE_T *pcbWrittenOrRequired); typedef enum { LowMemoryResourceNotification , @@ -1179,7 +1187,7 @@ typedef RTL_CONDITION_VARIABLE CONDITION_VARIABLE, *PCONDITION_VARIABLE; #endif -typedef DWORD(WINAPI *LPPROGRESS_ROUTINE)(LARGE_INTEGER,LARGE_INTEGER,LARGE_INTEGER,LARGE_INTEGER,DWORD,DWORD,HANDLE,HANDLE,LPVOID); +typedef DWORD(WINAPI *LPPROGRESS_ROUTINE)(_In_ LARGE_INTEGER, _In_ LARGE_INTEGER, _In_ LARGE_INTEGER, _In_ LARGE_INTEGER, _In_ DWORD, _In_ DWORD, _In_ HANDLE, _In_ HANDLE, _In_opt_ LPVOID); typedef VOID (WINAPI *PFIBER_START_ROUTINE)( LPVOID lpFiberParameter ); typedef PFIBER_START_ROUTINE LPFIBER_START_ROUTINE; @@ -1208,28 +1216,69 @@ /* Functions */ #ifndef UNDER_CE -int APIENTRY WinMain(HINSTANCE,HINSTANCE,LPSTR,int); +int APIENTRY WinMain(_In_ HINSTANCE, _In_opt_ HINSTANCE, _In_ LPSTR, _In_ int); #else -int APIENTRY WinMain(HINSTANCE,HINSTANCE,LPWSTR,int); -#endif -int APIENTRY wWinMain(HINSTANCE,HINSTANCE,LPWSTR,int); -long WINAPI _hread(HFILE,LPVOID,long); -long WINAPI _hwrite(HFILE,LPCSTR,long); -HFILE WINAPI _lclose(HFILE); -HFILE WINAPI _lcreat(LPCSTR,int); -LONG WINAPI _llseek(HFILE,LONG,int); -HFILE WINAPI _lopen(LPCSTR,int); -UINT WINAPI _lread(HFILE,LPVOID,UINT); -UINT WINAPI _lwrite(HFILE,LPCSTR,UINT); +int APIENTRY WinMain(_In_ HINSTANCE, _In_opt_ HINSTANCE, _In_ LPWSTR, _In_ int); +#endif +int APIENTRY wWinMain(_In_ HINSTANCE, _In_opt_ HINSTANCE, _In_ LPWSTR, _In_ int); + +long +WINAPI +_hread( + _In_ HFILE hFile, + _Out_writes_bytes_to_(lBytes, return) LPVOID lpBuffer, + _In_ long lBytes); + +long +WINAPI +_hwrite( + _In_ HFILE hFile, + _In_reads_bytes_(lBytes) LPCCH lpBuffer, + _In_ long lBytes); + +HFILE WINAPI _lclose(_In_ HFILE); +HFILE WINAPI _lcreat(_In_ LPCSTR, _In_ int); +LONG WINAPI _llseek(_In_ HFILE, _In_ LONG, _In_ int); +HFILE WINAPI _lopen(_In_ LPCSTR, _In_ int); + +UINT +WINAPI +_lread( + _In_ HFILE hFile, + _Out_writes_bytes_to_(uBytes, return) LPVOID lpBuffer, + _In_ UINT uBytes); + +UINT +WINAPI +_lwrite( + _In_ HFILE hFile, + _In_reads_bytes_(uBytes) LPCCH lpBuffer, + _In_ UINT uBytes); + BOOL WINAPI AccessCheck(PSECURITY_DESCRIPTOR,HANDLE,DWORD,PGENERIC_MAPPING,PPRIVILEGE_SET,PDWORD,PDWORD,PBOOL); -BOOL WINAPI AccessCheckAndAuditAlarmA(LPCSTR,LPVOID,LPSTR,LPSTR,PSECURITY_DESCRIPTOR,DWORD,PGENERIC_MAPPING,BOOL,PDWORD,PBOOL,PBOOL); + +BOOL +WINAPI +AccessCheckAndAuditAlarmA( + _In_ LPCSTR SubsystemName, + _In_opt_ LPVOID HandleId, + _In_ LPSTR ObjectTypeName, + _In_opt_ LPSTR ObjectName, + _In_ PSECURITY_DESCRIPTOR SecurityDescriptor, + _In_ DWORD DesiredAccess, + _In_ PGENERIC_MAPPING GenericMapping, + _In_ BOOL ObjectCreation, + _Out_ LPDWORD GrantedAccess, + _Out_ LPBOOL AccessStatus, + _Out_ LPBOOL pfGenerateOnClose); + BOOL WINAPI AccessCheckAndAuditAlarmW(LPCWSTR,LPVOID,LPWSTR,LPWSTR,PSECURITY_DESCRIPTOR,DWORD,PGENERIC_MAPPING,BOOL,PDWORD,PBOOL,PBOOL); #if (_WIN32_WINNT >= 0x0600) VOID WINAPI AcquireSRWLockExclusive(PSRWLOCK); VOID WINAPI AcquireSRWLockShared(PSRWLOCK); #endif #if (_WIN32_WINNT >= 0x0501) -BOOL WINAPI ActivateActCtx(HANDLE,ULONG_PTR*); +BOOL WINAPI ActivateActCtx(_Inout_opt_ HANDLE, _Out_ ULONG_PTR*); #endif BOOL WINAPI AddAccessAllowedAce(PACL,DWORD,DWORD,PSID); BOOL WINAPI AddAccessDeniedAce(PACL,DWORD,DWORD,PSID); @@ -1240,17 +1289,17 @@ BOOL WINAPI AddAccessDeniedObjectAce(PACL,DWORD,DWORD,DWORD,GUID*,GUID*,PSID); #endif BOOL WINAPI AddAce(PACL,DWORD,DWORD,PVOID,DWORD); -ATOM WINAPI AddAtomA(LPCSTR); -ATOM WINAPI AddAtomW(LPCWSTR); +ATOM WINAPI AddAtomA(_In_opt_ LPCSTR); +ATOM WINAPI AddAtomW(_In_opt_ LPCWSTR); BOOL WINAPI AddAuditAccessAce(PACL,DWORD,DWORD,PSID,BOOL,BOOL); #if (_WIN32_WINNT >= 0x0500) BOOL WINAPI AddAuditAccessObjectAce(PACL,DWORD,DWORD,DWORD,GUID*,GUID*,PSID,BOOL,BOOL); #endif #if (_WIN32_WINNT >= 0x0501) -void WINAPI AddRefActCtx(HANDLE); -#endif -#if (_WIN32_WINNT >= 0x0500) -PVOID WINAPI AddVectoredExceptionHandler(ULONG,PVECTORED_EXCEPTION_HANDLER); +void WINAPI AddRefActCtx(_Inout_ HANDLE); +#endif +#if (_WIN32_WINNT >= 0x0500) +_Ret_maybenull_ PVOID WINAPI AddVectoredExceptionHandler(_In_ ULONG, _In_ PVECTORED_EXCEPTION_HANDLER); #endif BOOL WINAPI AccessCheckByType(PSECURITY_DESCRIPTOR,PSID,HANDLE,DWORD,POBJECT_TYPE_LIST,DWORD,PGENERIC_MAPPING,PPRIVILEGE_SET,LPDWORD,LPDWORD,LPBOOL); BOOL WINAPI AdjustTokenGroups(HANDLE,BOOL,PTOKEN_GROUPS,DWORD,PTOKEN_GROUPS,PDWORD); @@ -1261,54 +1310,116 @@ BOOL WINAPI AreAllAccessesGranted(DWORD,DWORD); BOOL WINAPI AreAnyAccessesGranted(DWORD,DWORD); BOOL WINAPI AreFileApisANSI(void); -BOOL WINAPI BackupEventLogA(HANDLE,LPCSTR); -BOOL WINAPI BackupEventLogW(HANDLE,LPCWSTR); -BOOL WINAPI BackupRead(HANDLE,LPBYTE,DWORD,LPDWORD,BOOL,BOOL,LPVOID*); -BOOL WINAPI BackupSeek(HANDLE,DWORD,DWORD,LPDWORD,LPDWORD,LPVOID*); -BOOL WINAPI BackupWrite(HANDLE,LPBYTE,DWORD,LPDWORD,BOOL,BOOL,LPVOID*); +BOOL WINAPI BackupEventLogA(_In_ HANDLE, _In_ LPCSTR); +BOOL WINAPI BackupEventLogW(_In_ HANDLE, _In_ LPCWSTR); + +BOOL +WINAPI +BackupRead( + _In_ HANDLE hFile, + _Out_writes_bytes_to_(nNumberOfBytesToRead, *lpNumberOfBytesRead) LPBYTE lpBuffer, + _In_ DWORD nNumberOfBytesToRead, + _Out_ LPDWORD lpNumberOfBytesRead, + _In_ BOOL bAbort, + _In_ BOOL bProcessSecurity, + _Inout_ LPVOID *lpContext); + +BOOL WINAPI BackupSeek(_In_ HANDLE, _In_ DWORD, _In_ DWORD, _Out_ LPDWORD, _Out_ LPDWORD, _Inout_ LPVOID*); + +BOOL +WINAPI +BackupWrite( + _In_ HANDLE hFile, + _In_reads_bytes_(nNumberOfBytesToWrite) LPBYTE lpBuffer, + _In_ DWORD nNumberOfBytesToWrite, + _Out_ LPDWORD lpNumberOfBytesWritten, + _In_ BOOL bAbort, + _In_ BOOL bProcessSecurity, + _Inout_ LPVOID *lpContext); + BOOL WINAPI Beep(DWORD,DWORD); -HANDLE WINAPI BeginUpdateResourceA(LPCSTR,BOOL); -HANDLE WINAPI BeginUpdateResourceW(LPCWSTR,BOOL); -#if (_WIN32_WINNT >= 0x0500) -BOOL WINAPI BindIoCompletionCallback(HANDLE,LPOVERLAPPED_COMPLETION_ROUTINE,ULONG); -#endif -BOOL WINAPI BuildCommDCBA(LPCSTR,LPDCB); -BOOL WINAPI BuildCommDCBW(LPCWSTR,LPDCB); -BOOL WINAPI BuildCommDCBAndTimeoutsA(LPCSTR,LPDCB,LPCOMMTIMEOUTS); -BOOL WINAPI BuildCommDCBAndTimeoutsW(LPCWSTR,LPDCB,LPCOMMTIMEOUTS); -BOOL WINAPI CallNamedPipeA(LPCSTR,PVOID,DWORD,PVOID,DWORD,PDWORD,DWORD); -BOOL WINAPI CallNamedPipeW(LPCWSTR,PVOID,DWORD,PVOID,DWORD,PDWORD,DWORD); -BOOL WINAPI CancelDeviceWakeupRequest(HANDLE); +HANDLE WINAPI BeginUpdateResourceA(_In_ LPCSTR, _In_ BOOL); +HANDLE WINAPI BeginUpdateResourceW(_In_ LPCWSTR, _In_ BOOL); +#if (_WIN32_WINNT >= 0x0500) +BOOL WINAPI BindIoCompletionCallback(_In_ HANDLE, _In_ LPOVERLAPPED_COMPLETION_ROUTINE, _In_ ULONG); +#endif +BOOL WINAPI BuildCommDCBA(_In_ LPCSTR, _Out_ LPDCB); +BOOL WINAPI BuildCommDCBW(_In_ LPCWSTR, _Out_ LPDCB); +BOOL WINAPI BuildCommDCBAndTimeoutsA(_In_ LPCSTR, _Out_ LPDCB, _Out_ LPCOMMTIMEOUTS); +BOOL WINAPI BuildCommDCBAndTimeoutsW(_In_ LPCWSTR, _Out_ LPDCB, _Out_ LPCOMMTIMEOUTS); + +BOOL +WINAPI +CallNamedPipeA( + _In_ LPCSTR lpNamedPipeName, + _In_reads_bytes_opt_(nInBufferSize) LPVOID lpInBuffer, + _In_ DWORD nInBufferSize, + _Out_writes_bytes_to_opt_(nOutBufferSize, *lpBytesRead) LPVOID lpOutBuffer, + _In_ DWORD nOutBufferSize, + _Out_ LPDWORD lpBytesRead, + _In_ DWORD nTimeOut); + +BOOL +WINAPI +CallNamedPipeW( + _In_ LPCWSTR lpNamedPipeName, + _In_reads_bytes_opt_(nInBufferSize) LPVOID lpInBuffer, + _In_ DWORD nInBufferSize, + _Out_writes_bytes_to_opt_(nOutBufferSize, *lpBytesRead) LPVOID lpOutBuffer, + _In_ DWORD nOutBufferSize, + _Out_ LPDWORD lpBytesRead, + _In_ DWORD nTimeOut); + +BOOL WINAPI CancelDeviceWakeupRequest(_In_ HANDLE); BOOL WINAPI CancelIo(HANDLE); #if (_WIN32_WINNT >= 0x0600) BOOL WINAPI CancelIoEx(HANDLE,LPOVERLAPPED); BOOL WINAPI CancelSynchronousIo(HANDLE); #endif BOOL WINAPI CancelWaitableTimer(HANDLE); -#if (_WIN32_WINNT >= 0x0501) -BOOL WINAPI CheckNameLegalDOS8Dot3A(LPCSTR,LPSTR,DWORD,PBOOL,PBOOL); -BOOL WINAPI CheckNameLegalDOS8Dot3W(LPCWSTR,LPSTR,DWORD,PBOOL,PBOOL); -BOOL WINAPI CheckRemoteDebuggerPresent(HANDLE,PBOOL); -#endif -BOOL WINAPI ClearCommBreak(HANDLE); -BOOL WINAPI ClearCommError(HANDLE,PDWORD,LPCOMSTAT); -BOOL WINAPI ClearEventLogA(HANDLE,LPCSTR); -BOOL WINAPI ClearEventLogW(HANDLE,LPCWSTR); -BOOL WINAPI CloseEventLog(HANDLE); + +#if (_WIN32_WINNT >= 0x0501) + +BOOL +WINAPI +CheckNameLegalDOS8Dot3A( + _In_ LPCSTR lpName, + _Out_writes_opt_(OemNameSize) LPSTR lpOemName, + _In_ DWORD OemNameSize, + _Out_opt_ PBOOL pbNameContainsSpaces, + _Out_ PBOOL pbNameLegal); + +BOOL +WINAPI +CheckNameLegalDOS8Dot3W( + _In_ LPCWSTR lpName, + _Out_writes_opt_(OemNameSize) LPSTR lpOemName, + _In_ DWORD OemNameSize, + _Out_opt_ PBOOL pbNameContainsSpaces, + _Out_ PBOOL pbNameLegal); + +BOOL WINAPI CheckRemoteDebuggerPresent(_In_ HANDLE, _Out_ PBOOL); +#endif + +BOOL WINAPI ClearCommBreak(_In_ HANDLE); +BOOL WINAPI ClearCommError(_In_ HANDLE, _Out_opt_ PDWORD, _Out_opt_ LPCOMSTAT); +BOOL WINAPI ClearEventLogA(_In_ HANDLE, _In_opt_ LPCSTR); +BOOL WINAPI ClearEventLogW(_In_ HANDLE, _In_opt_ LPCWSTR); +BOOL WINAPI CloseEventLog(_In_ HANDLE); BOOL WINAPI CloseHandle(HANDLE); -BOOL WINAPI CommConfigDialogA(LPCSTR,HWND,LPCOMMCONFIG); -BOOL WINAPI CommConfigDialogW(LPCWSTR,HWND,LPCOMMCONFIG); +BOOL WINAPI CommConfigDialogA(_In_ LPCSTR, _In_opt_ HWND, _Inout_ LPCOMMCONFIG); +BOOL WINAPI CommConfigDialogW(_In_ LPCWSTR, _In_opt_ HWND, _Inout_ LPCOMMCONFIG); LONG WINAPI CompareFileTime(CONST FILETIME*,CONST FILETIME*); BOOL WINAPI ConnectNamedPipe(HANDLE,LPOVERLAPPED); BOOL WINAPI ContinueDebugEvent(DWORD,DWORD,DWORD); #if (_WIN32_WINNT >= 0x0400) BOOL WINAPI ConvertFiberToThread(void); #endif -PVOID WINAPI ConvertThreadToFiber(PVOID); -BOOL WINAPI CopyFileA(LPCSTR,LPCSTR,BOOL); -BOOL WINAPI CopyFileW(LPCWSTR,LPCWSTR,BOOL); -BOOL WINAPI CopyFileExA(LPCSTR,LPCSTR,LPPROGRESS_ROUTINE,LPVOID,LPBOOL,DWORD); -BOOL WINAPI CopyFileExW(LPCWSTR,LPCWSTR,LPPROGRESS_ROUTINE,LPVOID,LPBOOL,DWORD); +_Ret_maybenull_ PVOID WINAPI ConvertThreadToFiber(_In_opt_ PVOID); +BOOL WINAPI CopyFileA(_In_ LPCSTR, _In_ LPCSTR, _In_ BOOL); +BOOL WINAPI CopyFileW(_In_ LPCWSTR, _In_ LPCWSTR, _In_ BOOL); +BOOL WINAPI CopyFileExA(_In_ LPCSTR, _In_ LPCSTR, _In_opt_ LPPROGRESS_ROUTINE, _In_opt_ LPVOID, _In_opt_ LPBOOL, _In_ DWORD); +BOOL WINAPI CopyFileExW(_In_ LPCWSTR, _In_ LPCWSTR, _In_opt_ LPPROGRESS_ROUTINE, _In_opt_ LPVOID, _In_opt_ LPBOOL, _In_ DWORD); #define MoveMemory RtlMoveMemory #define CopyMemory RtlCopyMemory #define FillMemory RtlFillMemory @@ -1316,40 +1427,40 @@ #define SecureZeroMemory RtlSecureZeroMemory BOOL WINAPI CopySid(DWORD,PSID,PSID); #if (_WIN32_WINNT >= 0x0501) -HANDLE WINAPI CreateActCtxA(PCACTCTXA); -HANDLE WINAPI CreateActCtxW(PCACTCTXW); +HANDLE WINAPI CreateActCtxA(_In_ PCACTCTXA); +HANDLE WINAPI CreateActCtxW(_In_ PCACTCTXW); #endif BOOL WINAPI CreateDirectoryA(LPCSTR,LPSECURITY_ATTRIBUTES); BOOL WINAPI CreateDirectoryW(LPCWSTR,LPSECURITY_ATTRIBUTES); -BOOL WINAPI CreateDirectoryExA(LPCSTR,LPCSTR,LPSECURITY_ATTRIBUTES); -BOOL WINAPI CreateDirectoryExW(LPCWSTR,LPCWSTR,LPSECURITY_ATTRIBUTES); +BOOL WINAPI CreateDirectoryExA(_In_ LPCSTR, _In_ LPCSTR, _In_opt_ LPSECURITY_ATTRIBUTES); +BOOL WINAPI CreateDirectoryExW(_In_ LPCWSTR, _In_ LPCWSTR, _In_opt_ LPSECURITY_ATTRIBUTES); HANDLE WINAPI CreateEventA(LPSECURITY_ATTRIBUTES,BOOL,BOOL,LPCSTR); HANDLE WINAPI CreateEventW(LPSECURITY_ATTRIBUTES,BOOL,BOOL,LPCWSTR); #if (_WIN32_WINNT >= 0x0600) HANDLE WINAPI CreateEventExA(LPSECURITY_ATTRIBUTES,LPCSTR,DWORD,DWORD); HANDLE WINAPI CreateEventExW(LPSECURITY_ATTRIBUTES,LPCWSTR,DWORD,DWORD); #endif -LPVOID WINAPI CreateFiber(SIZE_T,LPFIBER_START_ROUTINE,LPVOID); +_Ret_maybenull_ LPVOID WINAPI CreateFiber(_In_ SIZE_T, _In_ LPFIBER_START_ROUTINE, _In_opt_ LPVOID); #if (_WIN32_WINNT >= 0x0400) -LPVOID WINAPI CreateFiberEx(SIZE_T,SIZE_T,DWORD,LPFIBER_START_ROUTINE,LPVOID); +_Ret_maybenull_ LPVOID WINAPI CreateFiberEx(_In_ SIZE_T, _In_ SIZE_T, _In_ DWORD, _In_ LPFIBER_START_ROUTINE, _In_opt_ LPVOID); #endif HANDLE WINAPI CreateFileA(LPCSTR,DWORD,DWORD,LPSECURITY_ATTRIBUTES,DWORD,DWORD,HANDLE); HANDLE WINAPI CreateFileW(LPCWSTR,DWORD,DWORD,LPSECURITY_ATTRIBUTES,DWORD,DWORD,HANDLE); -HANDLE WINAPI CreateFileMappingA(HANDLE,LPSECURITY_ATTRIBUTES,DWORD,DWORD,DWORD,LPCSTR); +_Ret_maybenull_ HANDLE WINAPI CreateFileMappingA(_In_ HANDLE, _In_opt_ LPSECURITY_ATTRIBUTES, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_opt_ LPCSTR); HANDLE WINAPI CreateFileMappingW(HANDLE,LPSECURITY_ATTRIBUTES,DWORD,DWORD,DWORD,LPCWSTR); #if (_WIN32_WINNT >= 0x0500) -BOOL WINAPI CreateHardLinkA(LPCSTR,LPCSTR,LPSECURITY_ATTRIBUTES); -BOOL WINAPI CreateHardLinkW(LPCWSTR,LPCWSTR,LPSECURITY_ATTRIBUTES); +BOOL WINAPI CreateHardLinkA(_In_ LPCSTR, _In_ LPCSTR, _Reserved_ LPSECURITY_ATTRIBUTES); +BOOL WINAPI CreateHardLinkW(_In_ LPCWSTR, _In_ LPCWSTR, _Reserved_ LPSECURITY_ATTRIBUTES); #endif HANDLE WINAPI CreateIoCompletionPort(HANDLE,HANDLE,ULONG_PTR,DWORD); #if (_WIN32_WINNT >= 0x0500) -HANDLE WINAPI CreateJobObjectA(LPSECURITY_ATTRIBUTES,LPCSTR); -HANDLE WINAPI CreateJobObjectW(LPSECURITY_ATTRIBUTES,LPCWSTR); -BOOL WINAPI TerminateJobObject(HANDLE,UINT); -BOOL WINAPI AssignProcessToJobObject(HANDLE,HANDLE); -#endif -HANDLE WINAPI CreateMailslotA(LPCSTR,DWORD,DWORD,LPSECURITY_ATTRIBUTES); -HANDLE WINAPI CreateMailslotW(LPCWSTR,DWORD,DWORD,LPSECURITY_ATTRIBUTES); +_Ret_maybenull_ HANDLE WINAPI CreateJobObjectA(_In_opt_ LPSECURITY_ATTRIBUTES, _In_opt_ LPCSTR); +_Ret_maybenull_ HANDLE WINAPI CreateJobObjectW(_In_opt_ LPSECURITY_ATTRIBUTES, _In_opt_ LPCWSTR); +BOOL WINAPI TerminateJobObject(_In_ HANDLE, _In_ UINT); +BOOL WINAPI AssignProcessToJobObject(_In_ HANDLE, _In_ HANDLE); +#endif +HANDLE WINAPI CreateMailslotA(_In_ LPCSTR, _In_ DWORD, _In_ DWORD, _In_opt_ LPSECURITY_ATTRIBUTES); +HANDLE WINAPI CreateMailslotW(_In_ LPCWSTR, _In_ DWORD, _In_ DWORD, _In_opt_ LPSECURITY_ATTRIBUTES); #if (_WIN32_WINNT >= 0x0501) HANDLE WINAPI CreateMemoryResourceNotification(MEMORY_RESOURCE_NOTIFICATION_TYPE); #endif @@ -1359,36 +1470,51 @@ HANDLE WINAPI CreateMutexExA(LPSECURITY_ATTRIBUTES,LPCSTR,DWORD,DWORD); HANDLE WINAPI CreateMutexExW(LPSECURITY_ATTRIBUTES,LPCWSTR,DWORD,DWORD); #endif -HANDLE WINAPI CreateNamedPipeA(LPCSTR,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,LPSECURITY_ATTRIBUTES); -HANDLE WINAPI CreateNamedPipeW(LPCWSTR,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,LPSECURITY_ATTRIBUTES); +HANDLE WINAPI CreateNamedPipeA(_In_ LPCSTR, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_opt_ LPSECURITY_ATTRIBUTES); +HANDLE WINAPI CreateNamedPipeW(_In_ LPCWSTR, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_opt_ LPSECURITY_ATTRIBUTES); BOOL WINAPI CreatePipe(PHANDLE,PHANDLE,LPSECURITY_ATTRIBUTES,DWORD); BOOL WINAPI CreatePrivateObjectSecurity(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR*,BOOL,HANDLE,PGENERIC_MAPPING); BOOL WINAPI CreateProcessA(LPCSTR,LPSTR,LPSECURITY_ATTRIBUTES,LPSECURITY_ATTRIBUTES,BOOL,DWORD,PVOID,LPCSTR,LPSTARTUPINFOA,LPPROCESS_INFORMATION); BOOL WINAPI CreateProcessW(LPCWSTR,LPWSTR,LPSECURITY_ATTRIBUTES,LPSECURITY_ATTRIBUTES,BOOL,DWORD,PVOID,LPCWSTR,LPSTARTUPINFOW,LPPROCESS_INFORMATION); -BOOL WINAPI CreateProcessAsUserA(HANDLE,LPCSTR,LPSTR,LPSECURITY_ATTRIBUTES,LPSECURITY_ATTRIBUTES,BOOL,DWORD,PVOID,LPCSTR,LPSTARTUPINFOA,LPPROCESS_INFORMATION); + +BOOL +WINAPI +CreateProcessAsUserA( + _In_opt_ HANDLE, + _In_opt_ LPCSTR, + _Inout_opt_ LPSTR, + _In_opt_ LPSECURITY_ATTRIBUTES, + _In_opt_ LPSECURITY_ATTRIBUTES, + _In_ BOOL, + _In_ DWORD, + _In_opt_ PVOID, + _In_opt_ LPCSTR, + _In_ LPSTARTUPINFOA, + _Out_ LPPROCESS_INFORMATION); + BOOL WINAPI CreateProcessAsUserW(HANDLE,LPCWSTR,LPWSTR,LPSECURITY_ATTRIBUTES,LPSECURITY_ATTRIBUTES,BOOL,DWORD,PVOID,LPCWSTR,LPSTARTUPINFOW,LPPROCESS_INFORMATION); HANDLE WINAPI CreateRemoteThread(HANDLE,LPSECURITY_ATTRIBUTES,DWORD,LPTHREAD_START_ROUTINE,LPVOID,DWORD,LPDWORD); -HANDLE WINAPI CreateSemaphoreA(LPSECURITY_ATTRIBUTES,LONG,LONG,LPCSTR); -HANDLE WINAPI CreateSemaphoreW(LPSECURITY_ATTRIBUTES,LONG,LONG,LPCWSTR); +_Ret_maybenull_ HANDLE WINAPI CreateSemaphoreA(_In_opt_ LPSECURITY_ATTRIBUTES, _In_ LONG, _In_ LONG, _In_opt_ LPCSTR); +_Ret_maybenull_ HANDLE WINAPI CreateSemaphoreW(_In_opt_ LPSECURITY_ATTRIBUTES, _In_ LONG, _In_ LONG, _In_opt_ LPCWSTR); #if (_WIN32_WINNT >= 0x0600) -HANDLE WINAPI CreateSemaphoreExA(LPSECURITY_ATTRIBUTES,LONG,LONG,LPCSTR,DWORD,DWORD); +_Ret_maybenull_ HANDLE WINAPI CreateSemaphoreExA(_In_opt_ LPSECURITY_ATTRIBUTES, _In_ LONG, _In_ LONG, _In_opt_ LPCSTR, _Reserved_ DWORD, _In_ DWORD); HANDLE WINAPI CreateSemaphoreExW(LPSECURITY_ATTRIBUTES,LONG,LONG,LPCWSTR,DWORD,DWORD); #endif -DWORD WINAPI CreateTapePartition(HANDLE,DWORD,DWORD,DWORD); +DWORD WINAPI CreateTapePartition(_In_ HANDLE, _In_ DWORD, _In_ DWORD, _In_ DWORD); #if (_WIN32_WINNT >= 0x0500) HANDLE WINAPI CreateTimerQueue(void); BOOL WINAPI CreateTimerQueueTimer(PHANDLE,HANDLE,WAITORTIMERCALLBACK,PVOID,DWORD,DWORD,ULONG); #endif HANDLE WINAPI CreateThread(LPSECURITY_ATTRIBUTES,DWORD,LPTHREAD_START_ROUTINE,PVOID,DWORD,PDWORD); -HANDLE WINAPI CreateWaitableTimerA(LPSECURITY_ATTRIBUTES,BOOL,LPCSTR); -HANDLE WINAPI CreateWaitableTimerW(LPSECURITY_ATTRIBUTES,BOOL,LPCWSTR); +_Ret_maybenull_ HANDLE WINAPI CreateWaitableTimerA(_In_opt_ LPSECURITY_ATTRIBUTES, _In_ BOOL, _In_opt_ LPCSTR); +_Ret_maybenull_ HANDLE WINAPI CreateWaitableTimerW(_In_opt_ LPSECURITY_ATTRIBUTES, _In_ BOOL, _In_opt_ LPCWSTR); #if (_WIN32_WINNT >= 0x0600) -HANDLE WINAPI CreateWaitableTimerExA(LPSECURITY_ATTRIBUTES,LPCSTR,DWORD,DWORD); +_Ret_maybenull_ HANDLE WINAPI CreateWaitableTimerExA(_In_opt_ LPSECURITY_ATTRIBUTES, _In_opt_ LPCSTR, _In_ DWORD, _In_ DWORD); HANDLE WINAPI CreateWaitableTimerExW(LPSECURITY_ATTRIBUTES,LPCWSTR,DWORD,DWORD); #endif #if (_WIN32_WINNT >= 0x0501) BOOL WINAPI CreateWellKnownSid(WELL_KNOWN_SID_TYPE,PSID,PSID,DWORD*); -BOOL WINAPI DeactivateActCtx(DWORD,ULONG_PTR); +BOOL WINAPI DeactivateActCtx(_In_ DWORD, _In_ ULONG_PTR); #endif BOOL WINAPI DebugActiveProcess(DWORD); #if (_WIN32_WINNT >= 0x0501) @@ -1396,78 +1522,95 @@ #endif void WINAPI DebugBreak(void); #if (_WIN32_WINNT >= 0x0501) -BOOL WINAPI DebugBreakProcess(HANDLE); -BOOL WINAPI DebugSetProcessKillOnExit(BOOL); +BOOL WINAPI DebugBreakProcess(_In_ HANDLE); +BOOL WINAPI DebugSetProcessKillOnExit(_In_ BOOL); #endif PVOID WINAPI DecodePointer(PVOID); PVOID WINAPI DecodeSystemPointer(PVOID); -BOOL WINAPI DecryptFileA(LPCSTR,DWORD); -BOOL WINAPI DecryptFileW(LPCWSTR,DWORD); -BOOL WINAPI DefineDosDeviceA(DWORD,LPCSTR,LPCSTR); +BOOL WINAPI DecryptFileA(_In_ LPCSTR, _Reserved_ DWORD); +BOOL WINAPI DecryptFileW(_In_ LPCWSTR, _Reserved_ DWORD); +BOOL WINAPI DefineDosDeviceA(_In_ DWORD, _In_ LPCSTR, _In_opt_ LPCSTR); BOOL WINAPI DefineDosDeviceW(DWORD,LPCWSTR,LPCWSTR); #define DefineHandleTable(w) ((w),TRUE) BOOL WINAPI DeleteAce(PACL,DWORD); -ATOM WINAPI DeleteAtom(ATOM); +ATOM WINAPI DeleteAtom(_In_ ATOM); void WINAPI DeleteCriticalSection(PCRITICAL_SECTION); -void WINAPI DeleteFiber(PVOID); +void WINAPI DeleteFiber(_In_ PVOID); BOOL WINAPI DeleteFileA(LPCSTR); BOOL WINAPI DeleteFileW(LPCWSTR); #if (_WIN32_WINNT >= 0x0500) -BOOL WINAPI DeleteTimerQueue(HANDLE); +_Must_inspect_result_ BOOL WINAPI DeleteTimerQueue(_In_ HANDLE); BOOL WINAPI DeleteTimerQueueEx(HANDLE,HANDLE); BOOL WINAPI DeleteTimerQueueTimer(HANDLE,HANDLE,HANDLE); -BOOL WINAPI DeleteVolumeMountPointA(LPCSTR); +BOOL WINAPI DeleteVolumeMountPointA(_In_ LPCSTR); BOOL WINAPI DeleteVolumeMountPointW(LPCWSTR); #endif -BOOL WINAPI DeregisterEventSource(HANDLE); +BOOL WINAPI DeregisterEventSource(_In_ HANDLE); BOOL WINAPI DestroyPrivateObjectSecurity(PSECURITY_DESCRIPTOR*); BOOL WINAPI DeviceIoControl(HANDLE,DWORD,PVOID,DWORD,PVOID,DWORD,PDWORD,POVERLAPPED); BOOL WINAPI DisableThreadLibraryCalls(HMODULE); -#if (_WIN32_WINNT >= 0x0500) -BOOL WINAPI DnsHostnameToComputerNameA(LPCSTR,LPSTR,LPDWORD); -BOOL WINAPI DnsHostnameToComputerNameW(LPCWSTR,LPWSTR,LPDWORD); -#endif + +#if (_WIN32_WINNT >= 0x0500) + +_Success_(return != FALSE) +BOOL +WINAPI +DnsHostnameToComputerNameA( + _In_ LPCSTR Hostname, + _Out_writes_to_opt_(*nSize, *nSize + 1) LPSTR ComputerName, + _Inout_ LPDWORD nSize); + +_Success_(return != FALSE) +BOOL +WINAPI +DnsHostnameToComputerNameW( + _In_ LPCWSTR Hostname, + _Out_writes_to_opt_(*nSize, *nSize + 1) LPWSTR ComputerName, + _Inout_ LPDWORD nSize); + +#endif + BOOL WINAPI DisconnectNamedPipe(HANDLE); -BOOL WINAPI DosDateTimeToFileTime(WORD,WORD,LPFILETIME); +BOOL WINAPI DosDateTimeToFileTime(_In_ WORD, _In_ WORD, _Out_ LPFILETIME); BOOL WINAPI DuplicateHandle(HANDLE,HANDLE,HANDLE,PHANDLE,DWORD,BOOL,DWORD); BOOL WINAPI DuplicateToken(HANDLE,SECURITY_IMPERSONATION_LEVEL,PHANDLE); BOOL WINAPI DuplicateTokenEx(HANDLE,DWORD,LPSECURITY_ATTRIBUTES,SECURITY_IMPERSONATION_LEVEL,TOKEN_TYPE,PHANDLE); PVOID WINAPI EncodePointer(PVOID); PVOID WINAPI EncodeSystemPointer(PVOID); -BOOL WINAPI EncryptFileA(LPCSTR); -BOOL WINAPI EncryptFileW(LPCWSTR); -BOOL WINAPI EndUpdateResourceA(HANDLE,BOOL); -BOOL WINAPI EndUpdateResourceW(HANDLE,BOOL); +BOOL WINAPI EncryptFileA(_In_ LPCSTR); +BOOL WINAPI EncryptFileW(_In_ LPCWSTR); +BOOL WINAPI EndUpdateResourceA(_In_ HANDLE, _In_ BOOL); +BOOL WINAPI EndUpdateResourceW(_In_ HANDLE, _In_ BOOL); void WINAPI EnterCriticalSection(LPCRITICAL_SECTION); -BOOL WINAPI EnumResourceLanguagesA(HMODULE,LPCSTR,LPCSTR,ENUMRESLANGPROCA,LONG_PTR); -BOOL WINAPI EnumResourceLanguagesW(HMODULE,LPCWSTR,LPCWSTR,ENUMRESLANGPROCW,LONG_PTR); -BOOL WINAPI EnumResourceNamesA(HMODULE,LPCSTR,ENUMRESNAMEPROCA,LONG_PTR); -BOOL WINAPI EnumResourceNamesW(HMODULE,LPCWSTR,ENUMRESNAMEPROCW,LONG_PTR); -BOOL WINAPI EnumResourceTypesA(HMODULE,ENUMRESTYPEPROCA,LONG_PTR); -BOOL WINAPI EnumResourceTypesW(HMODULE,ENUMRESTYPEPROCW,LONG_PTR); +BOOL WINAPI EnumResourceLanguagesA(_In_opt_ HMODULE, _In_ LPCSTR, _In_ LPCSTR, _In_ ENUMRESLANGPROCA, _In_ LONG_PTR); +BOOL WINAPI EnumResourceLanguagesW(_In_opt_ HMODULE, _In_ LPCWSTR, _In_ LPCWSTR, _In_ ENUMRESLANGPROCW, _In_ LONG_PTR); +BOOL WINAPI EnumResourceNamesA(_In_opt_ HMODULE, _In_ LPCSTR, _In_ ENUMRESNAMEPROCA, _In_ LONG_PTR); +BOOL WINAPI EnumResourceNamesW(_In_opt_ HMODULE, _In_ LPCWSTR, _In_ ENUMRESNAMEPROCW, _In_ LONG_PTR); +BOOL WINAPI EnumResourceTypesA(_In_opt_ HMODULE, _In_ ENUMRESTYPEPROCA, _In_ LONG_PTR); +BOOL WINAPI EnumResourceTypesW(_In_opt_ HMODULE, _In_ ENUMRESTYPEPROCW, _In_ LONG_PTR); BOOL WINAPI EqualPrefixSid(PSID,PSID); BOOL WINAPI EqualSid(PSID,PSID); -DWORD WINAPI EraseTape(HANDLE,DWORD,BOOL); -BOOL WINAPI EscapeCommFunction(HANDLE,DWORD); +DWORD WINAPI EraseTape(_In_ HANDLE, _In_ DWORD, _In_ BOOL); +BOOL WINAPI EscapeCommFunction(_In_ HANDLE, _In_ DWORD); DECLSPEC_NORETURN void WINAPI ExitProcess(UINT); DECLSPEC_NORETURN void WINAPI ExitThread(DWORD); DWORD WINAPI ExpandEnvironmentStringsA(LPCSTR,LPSTR,DWORD); DWORD WINAPI ExpandEnvironmentStringsW(LPCWSTR,LPWSTR,DWORD); void WINAPI FatalAppExitA(UINT,LPCSTR); void WINAPI FatalAppExitW(UINT,LPCWSTR); -void WINAPI FatalExit(int); -BOOL WINAPI FileEncryptionStatusA(LPCSTR,LPDWORD); -BOOL WINAPI FileEncryptionStatusW(LPCWSTR,LPDWORD); -BOOL WINAPI FileTimeToDosDateTime(CONST FILETIME *,LPWORD,LPWORD); +__analysis_noreturn void WINAPI FatalExit(_In_ int); +BOOL WINAPI FileEncryptionStatusA(_In_ LPCSTR, _Out_ LPDWORD); +BOOL WINAPI FileEncryptionStatusW(_In_ LPCWSTR, _Out_ LPDWORD); +BOOL WINAPI FileTimeToDosDateTime(_In_ CONST FILETIME *, _Out_ LPWORD, _Out_ LPWORD); BOOL WINAPI FileTimeToLocalFileTime(CONST FILETIME *,LPFILETIME); BOOL WINAPI FileTimeToSystemTime(CONST FILETIME *,LPSYSTEMTIME); #if (_WIN32_WINNT >= 0x0501) -BOOL WINAPI FindActCtxSectionGuid(DWORD,const GUID*,ULONG,const GUID*,PACTCTX_SECTION_KEYED_DATA); -BOOL WINAPI FindActCtxSectionStringA(DWORD,const GUID*,ULONG,LPCSTR,PACTCTX_SECTION_KEYED_DATA); -BOOL WINAPI FindActCtxSectionStringW(DWORD,const GUID*,ULONG,LPCWSTR,PACTCTX_SECTION_KEYED_DATA); -#endif -ATOM WINAPI FindAtomA(LPCSTR); -ATOM WINAPI FindAtomW(LPCWSTR); +BOOL WINAPI FindActCtxSectionGuid(_In_ DWORD, _Reserved_ const GUID*, _In_ ULONG, _In_opt_ const GUID*, _Out_ PACTCTX_SECTION_KEYED_DATA); +BOOL WINAPI FindActCtxSectionStringA(_In_ DWORD, _Reserved_ const GUID*, _In_ ULONG, _In_ LPCSTR, _Out_ PACTCTX_SECTION_KEYED_DATA); +BOOL WINAPI FindActCtxSectionStringW(_In_ DWORD, _Reserved_ const GUID*, _In_ ULONG, _In_ LPCWSTR, _Out_ PACTCTX_SECTION_KEYED_DATA); +#endif +ATOM WINAPI FindAtomA(_In_opt_ LPCSTR); +ATOM WINAPI FindAtomW(_In_opt_ LPCWSTR); BOOL WINAPI FindClose(HANDLE); BOOL WINAPI FindCloseChangeNotification(HANDLE); HANDLE WINAPI FindFirstChangeNotificationA(LPCSTR,BOOL,DWORD); @@ -1477,36 +1620,95 @@ HANDLE WINAPI FindFirstFileExA(LPCSTR,FINDEX_INFO_LEVELS,PVOID,FINDEX_SEARCH_OPS,PVOID,DWORD); HANDLE WINAPI FindFirstFileExW(LPCWSTR,FINDEX_INFO_LEVELS,PVOID,FINDEX_SEARCH_OPS,PVOID,DWORD); #if (_WIN32_WINNT >= 0x0501) -HANDLE WINAPI FindFirstStreamW(LPCWSTR,STREAM_INFO_LEVELS,LPVOID,DWORD); +HANDLE WINAPI FindFirstStreamW(_In_ LPCWSTR, _In_ STREAM_INFO_LEVELS, _Out_ LPVOID, _Reserved_ DWORD); #endif BOOL WINAPI FindFirstFreeAce(PACL,PVOID*); -#if (_WIN32_WINNT >= 0x0500) -HANDLE WINAPI FindFirstVolumeA(LPSTR,DWORD); + +#if (_WIN32_WINNT >= 0x0500) + +HANDLE +WINAPI +FindFirstVolumeA( + _Out_writes_(cchBufferLength) LPSTR lpszVolumeName, + _In_ DWORD cchBufferLength); + HANDLE WINAPI FindFirstVolumeW(LPWSTR,DWORD); -HANDLE WINAPI FindFirstVolumeMountPointA(LPCSTR,LPSTR,DWORD); -HANDLE WINAPI FindFirstVolumeMountPointW(LPCWSTR,LPWSTR,DWORD); -#endif + +HANDLE +WINAPI +FindFirstVolumeMountPointA( + _In_ LPCSTR lpszRootPathName, + _Out_writes_(cchBufferLength) LPSTR lpszVolumeMountPoint, + _In_ DWORD cchBufferLength); + +HANDLE +WINAPI +FindFirstVolumeMountPointW( + _In_ LPCWSTR lpszRootPathName, + _Out_writes_(cchBufferLength) LPWSTR lpszVolumeMountPoint, + _In_ DWORD cchBufferLength); + +#endif + BOOL WINAPI FindNextChangeNotification(HANDLE); BOOL WINAPI FindNextFileA(HANDLE,LPWIN32_FIND_DATAA); BOOL WINAPI FindNextFileW(HANDLE,LPWIN32_FIND_DATAW); #if (_WIN32_WINNT >= 0x0501) -BOOL WINAPI FindNextStreamW(HANDLE,LPVOID); -#endif -#if (_WIN32_WINNT >= 0x0500) -BOOL WINAPI FindNextVolumeA(HANDLE,LPSTR,DWORD); +BOOL WINAPI FindNextStreamW(_In_ HANDLE, _Out_ LPVOID); +#endif + +#if (_WIN32_WINNT >= 0x0500) + +BOOL +WINAPI +FindNextVolumeA( + _Inout_ HANDLE hFindVolume, + _Out_writes_(cchBufferLength) LPSTR lpszVolumeName, + _In_ DWORD cchBufferLength); + BOOL WINAPI FindNextVolumeW(HANDLE,LPWSTR,DWORD); -BOOL WINAPI FindNextVolumeMountPointA(HANDLE,LPSTR,DWORD); -BOOL WINAPI FindNextVolumeMountPointW(HANDLE,LPWSTR,DWORD); + +BOOL +WINAPI +FindNextVolumeMountPointA( + _In_ HANDLE hFindVolumeMountPoint, + _Out_writes_(cchBufferLength) LPSTR lpszVolumeMountPoint, + _In_ DWORD cchBufferLength); + +BOOL +WINAPI +FindNextVolumeMountPointW( + _In_ HANDLE hFindVolumeMountPoint, + _Out_writes_(cchBufferLength) LPWSTR lpszVolumeMountPoint, + _In_ DWORD cchBufferLength); + BOOL WINAPI FindVolumeClose(HANDLE); -BOOL WINAPI FindVolumeMountPointClose(HANDLE); -#endif -HRSRC WINAPI FindResourceA(HMODULE,LPCSTR,LPCSTR); -HRSRC WINAPI FindResourceW(HINSTANCE,LPCWSTR,LPCWSTR); -HRSRC WINAPI FindResourceExA(HINSTANCE,LPCSTR,LPCSTR,WORD); +BOOL WINAPI FindVolumeMountPointClose(_In_ HANDLE); + +#endif + +_Ret_maybenull_ HRSRC WINAPI FindResourceA(_In_opt_ HMODULE,_In_ LPCSTR, _In_ LPCSTR); +_Ret_maybenull_ HRSRC WINAPI FindResourceW(_In_opt_ HMODULE,_In_ LPCWSTR, _In_ LPCWSTR); +_Ret_maybenull_ HRSRC WINAPI FindResourceExA(_In_opt_ HMODULE, _In_ LPCSTR, _In_ LPCSTR, _In_ WORD); HRSRC WINAPI FindResourceExW(HINSTANCE,LPCWSTR,LPCWSTR,WORD); #if (_WIN32_WINNT >= 0x0502) -DWORD WINAPI GetFirmwareEnvironmentVariableA(LPCSTR,LPCSTR,PVOID,DWORD); -DWORD WINAPI GetFirmwareEnvironmentVariableW(LPCWSTR,LPCWSTR,PVOID,DWORD); + +DWORD +WINAPI +GetFirmwareEnvironmentVariableA( + _In_ LPCSTR lpName, + _In_ LPCSTR lpGuid, + _Out_writes_bytes_to_opt_(nSize, return) PVOID pBuffer, + _In_ DWORD nSize); + +DWORD +WINAPI +GetFirmwareEnvironmentVariableW( + _In_ LPCWSTR lpName, + _In_ LPCWSTR lpGuid, + _Out_writes_bytes_to_opt_(nSize, return) PVOID pBuffer, + _In_ DWORD nSize); + #endif BOOL WINAPI FlushFileBuffers(HANDLE); BOOL WINAPI FlushInstructionCache(HANDLE,LPCVOID,SIZE_T); @@ -1530,51 +1732,113 @@ BOOL WINAPI GetAce(PACL,DWORD,LPVOID*); BOOL WINAPI GetAclInformation(PACL,PVOID,DWORD,ACL_INFORMATION_CLASS); #if (_WIN32_WINNT >= 0x0600) -HRESULT WINAPI GetApplicationRecoveryCallback(HANDLE,APPLICATION_RECOVERY_CALLBACK*,PVOID*, DWORD*, DWORD*); +HRESULT WINAPI GetApplicationRecoveryCallback(_In_ HANDLE, _Out_ APPLICATION_RECOVERY_CALLBACK*, _Outptr_opt_result_maybenull_ PVOID*, _Out_opt_ DWORD*, _Out_opt_ DWORD*); HRESULT WINAPI GetApplicationRestart(HANDLE,PWSTR,PDWORD,PDWORD); #endif -UINT WINAPI GetAtomNameA(ATOM,LPSTR,int); -UINT WINAPI GetAtomNameW(ATOM,LPWSTR,int); -BOOL WINAPI GetBinaryTypeA(LPCSTR,PDWORD); -BOOL WINAPI GetBinaryTypeW(LPCWSTR,PDWORD); + +UINT +WINAPI +GetAtomNameA( + _In_ ATOM nAtom, + _Out_writes_to_(nSize, return + 1) LPSTR lpBuffer, + _In_ int nSize); + +UINT +WINAPI +GetAtomNameW( + _In_ ATOM nAtom, + _Out_writes_to_(nSize, return + 1) LPWSTR lpBuffer, + _In_ int nSize); + +BOOL WINAPI GetBinaryTypeA(_In_ LPCSTR, _Out_ PDWORD); +BOOL WINAPI GetBinaryTypeW(_In_ LPCWSTR, _Out_ PDWORD); LPSTR WINAPI GetCommandLineA(VOID); LPWSTR WINAPI GetCommandLineW(VOID); -BOOL WINAPI GetCommConfig(HANDLE,LPCOMMCONFIG,PDWORD); -BOOL WINAPI GetCommMask(HANDLE,PDWORD); -BOOL WINAPI GetCommModemStatus(HANDLE,PDWORD); -BOOL WINAPI GetCommProperties(HANDLE,LPCOMMPROP); -BOOL WINAPI GetCommState(HANDLE,LPDCB); -BOOL WINAPI GetCommTimeouts(HANDLE,LPCOMMTIMEOUTS); -DWORD WINAPI GetCompressedFileSizeA(LPCSTR,PDWORD); -DWORD WINAPI GetCompressedFileSizeW(LPCWSTR,PDWORD); -BOOL WINAPI GetComputerNameA(LPSTR,PDWORD); -BOOL WINAPI GetComputerNameW(LPWSTR,PDWORD); + +_Success_(return != FALSE) +BOOL +WINAPI +GetCommConfig( + _In_ HANDLE hCommDev, + _Out_writes_bytes_opt_(*lpdwSize) LPCOMMCONFIG lpCC, + _Inout_ LPDWORD lpdwSize); + +BOOL WINAPI GetCommMask(_In_ HANDLE, _Out_ PDWORD); +BOOL WINAPI GetCommModemStatus(_In_ HANDLE, _Out_ PDWORD); +BOOL WINAPI GetCommProperties(_In_ HANDLE, _Inout_ LPCOMMPROP); +BOOL WINAPI GetCommState(_In_ HANDLE, _Out_ LPDCB); +BOOL WINAPI GetCommTimeouts(_In_ HANDLE, _Out_ LPCOMMTIMEOUTS); +DWORD WINAPI GetCompressedFileSizeA(_In_ LPCSTR, _Out_opt_ PDWORD); +DWORD WINAPI GetCompressedFileSizeW(_In_ LPCWSTR, _Out_opt_ PDWORD); + +_Success_(return != 0) +BOOL +WINAPI +GetComputerNameA( + _Out_writes_to_opt_(*nSize, *nSize + 1) LPSTR lpBuffer, + _Inout_ LPDWORD nSize); + +_Success_(return != 0) +BOOL +WINAPI +GetComputerNameW( + _Out_writes_to_opt_(*nSize, *nSize + 1) LPWSTR lpBuffer, + _Inout_ LPDWORD nSize); + #if (_WIN32_WINNT >= 0x0500) BOOL WINAPI GetComputerNameExA(COMPUTER_NAME_FORMAT,LPSTR,LPDWORD); BOOL WINAPI GetComputerNameExW(COMPUTER_NAME_FORMAT,LPWSTR,LPDWORD); #endif #if (_WIN32_WINNT >= 0x0501) -BOOL WINAPI GetCurrentActCtx(HANDLE*); +BOOL WINAPI GetCurrentActCtx( _Outptr_ HANDLE*); #endif DWORD WINAPI GetCurrentDirectoryA(DWORD,LPSTR); DWORD WINAPI GetCurrentDirectoryW(DWORD,LPWSTR); -BOOL WINAPI GetCurrentHwProfileA(LPHW_PROFILE_INFOA); -BOOL WINAPI GetCurrentHwProfileW(LPHW_PROFILE_INFOW); +BOOL WINAPI GetCurrentHwProfileA(_Out_ LPHW_PROFILE_INFOA); +BOOL WINAPI GetCurrentHwProfileW(_Out_ LPHW_PROFILE_INFOW); HANDLE WINAPI GetCurrentProcess(void); DWORD WINAPI GetCurrentProcessId(void); HANDLE WINAPI GetCurrentThread(void); DWORD WINAPI GetCurrentThreadId(void); #define GetCurrentTime GetTickCount -BOOL WINAPI GetDefaultCommConfigA(LPCSTR,LPCOMMCONFIG,PDWORD); -BOOL WINAPI GetDefaultCommConfigW(LPCWSTR,LPCOMMCONFIG,PDWORD); + +BOOL +WINAPI +GetDefaultCommConfigA( + _In_ LPCSTR lpszName, + _Out_writes_bytes_to_(*lpdwSize, *lpdwSize) LPCOMMCONFIG lpCC, + _Inout_ LPDWORD lpdwSize); + +BOOL +WINAPI +GetDefaultCommConfigW( + _In_ LPCWSTR lpszName, + _Out_writes_bytes_to_(*lpdwSize, *lpdwSize) LPCOMMCONFIG lpCC, + _Inout_ LPDWORD lpdwSize); + BOOL WINAPI GetDiskFreeSpaceA(LPCSTR,PDWORD,PDWORD,PDWORD,PDWORD); BOOL WINAPI GetDiskFreeSpaceW(LPCWSTR,PDWORD,PDWORD,PDWORD,PDWORD); BOOL WINAPI GetDiskFreeSpaceExA(LPCSTR,PULARGE_INTEGER,PULARGE_INTEGER,PULARGE_INTEGER); BOOL WINAPI GetDiskFreeSpaceExW(LPCWSTR,PULARGE_INTEGER,PULARGE_INTEGER,PULARGE_INTEGER); + #if (_WIN32_WINNT >= 0x0502) -DWORD WINAPI GetDllDirectoryA(DWORD,LPSTR); -DWORD WINAPI GetDllDirectoryW(DWORD,LPWSTR); -#endif + +_Success_(return != 0 && return < nBufferLength) +DWORD +WINAPI +GetDllDirectoryA( + _In_ DWORD nBufferLength, + _Out_writes_to_opt_(nBufferLength, return + 1) LPSTR lpBuffer); + +_Success_(return != 0 && return < nBufferLength) +DWORD +WINAPI +GetDllDirectoryW( + _In_ DWORD nBufferLength, + _Out_writes_to_opt_(nBufferLength, return + 1) LPWSTR lpBuffer); + +#endif + UINT WINAPI GetDriveTypeA(LPCSTR); UINT WINAPI GetDriveTypeW(LPCWSTR); LPSTR WINAPI GetEnvironmentStrings(void); @@ -1593,10 +1857,19 @@ BOOL WINAPI GetFileAttributesExA(LPCSTR,GET_FILEEX_INFO_LEVELS,PVOID); BOOL WINAPI GetFileAttributesExW(LPCWSTR,GET_FILEEX_INFO_LEVELS,PVOID); #if (_WIN32_WINNT >= 0x0600) -BOOL WINAPI GetFileBandwidthReservation(HANDLE,LPDWORD,LPDWORD,LPBOOL,LPDWORD,LPDWORD); +BOOL WINAPI GetFileBandwidthReservation(_In_ HANDLE, _Out_ LPDWORD, _Out_ LPDWORD, _Out_ LPBOOL, _Out_ LPDWORD, _Out_ LPDWORD); #endif BOOL WINAPI GetFileInformationByHandle(HANDLE,LPBY_HANDLE_FILE_INFORMATION); -BOOL WINAPI GetFileSecurityA(LPCSTR,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,DWORD,PDWORD); + +BOOL +WINAPI +GetFileSecurityA( + _In_ LPCSTR lpFileName, + _In_ SECURITY_INFORMATION RequestedInformation, + _Out_writes_bytes_to_opt_(nLength, *lpnLengthNeeded) PSECURITY_DESCRIPTOR pSecurityDescriptor, + _In_ DWORD nLength, + _Out_ LPDWORD lpnLengthNeeded); + BOOL WINAPI GetFileSecurityW(LPCWSTR,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,DWORD,PDWORD); DWORD WINAPI GetFileSize(HANDLE,PDWORD); BOOL WINAPI GetFileSizeEx(HANDLE,PLARGE_INTEGER); @@ -1611,13 +1884,20 @@ DWORD WINAPI GetLengthSid(PSID); void WINAPI GetLocalTime(LPSYSTEMTIME); DWORD WINAPI GetLogicalDrives(void); -DWORD WINAPI GetLogicalDriveStringsA(DWORD,LPSTR); + +_Success_(return != 0 && return <= nBufferLength) +DWORD +WINAPI +GetLogicalDriveStringsA( + _In_ DWORD nBufferLength, + _Out_writes_to_opt_(nBufferLength, return + 1) LPSTR lpBuffer); + DWORD WINAPI GetLogicalDriveStringsW(DWORD,LPWSTR); #if (_WIN32_WINNT >= 0x0500 || _WIN32_WINDOWS >= 0x0410) DWORD WINAPI GetLongPathNameA(LPCSTR,LPSTR,DWORD); DWORD WINAPI GetLongPathNameW(LPCWSTR,LPWSTR,DWORD); #endif -BOOL WINAPI GetMailslotInfo(HANDLE,PDWORD,PDWORD,PDWORD,PDWORD); +BOOL WINAPI GetMailslotInfo(_In_ HANDLE, _Out_opt_ PDWORD, _Out_opt_ PDWORD, _Out_opt_ PDWORD, _Out_opt_ PDWORD); DWORD WINAPI GetModuleFileNameA(HINSTANCE,LPSTR,DWORD); DWORD WINAPI GetModuleFileNameW(HINSTANCE,LPWSTR,DWORD); HMODULE WINAPI GetModuleHandleA(LPCSTR); @@ -1632,32 +1912,122 @@ WINBASEAPI WINBOOL WINAPI NeedCurrentDirectoryForExePathW(LPCWSTR ExeName); #endif -BOOL WINAPI GetNamedPipeHandleStateA(HANDLE,PDWORD,PDWORD,PDWORD,PDWORD,LPSTR,DWORD); -BOOL WINAPI GetNamedPipeHandleStateW(HANDLE,PDWORD,PDWORD,PDWORD,PDWORD,LPWSTR,DWORD); -BOOL WINAPI GetNamedPipeInfo(HANDLE,PDWORD,PDWORD,PDWORD,PDWORD); +BOOL +WINAPI +GetNamedPipeHandleStateA( + _In_ HANDLE hNamedPipe, + _Out_opt_ LPDWORD lpState, + _Out_opt_ LPDWORD lpCurInstances, + _Out_opt_ LPDWORD lpMaxCollectionCount, + _Out_opt_ LPDWORD lpCollectDataTimeout, + _Out_writes_opt_(nMaxUserNameSize) LPSTR lpUserName, + _In_ DWORD nMaxUserNameSize); + +BOOL +WINAPI +GetNamedPipeHandleStateW( + _In_ HANDLE hNamedPipe, + _Out_opt_ LPDWORD lpState, + _Out_opt_ LPDWORD lpCurInstances, + _Out_opt_ LPDWORD lpMaxCollectionCount, + _Out_opt_ LPDWORD lpCollectDataTimeout, + _Out_writes_opt_(nMaxUserNameSize) LPWSTR lpUserName, + _In_ DWORD nMaxUserNameSize); + +BOOL WINAPI GetNamedPipeInfo(_In_ HANDLE, _Out_opt_ PDWORD, _Out_opt_ PDWORD, _Out_opt_ PDWORD, _Out_opt_ PDWORD); #if (_WIN32_WINNT >= 0x0501) VOID WINAPI GetNativeSystemInfo(LPSYSTEM_INFO); #endif -BOOL WINAPI GetEventLogInformation(HANDLE,DWORD,LPVOID,DWORD,LPDWORD); -BOOL WINAPI GetNumberOfEventLogRecords(HANDLE,PDWORD); -BOOL WINAPI GetOldestEventLogRecord(HANDLE,PDWORD); + +BOOL +WINAPI +GetEventLogInformation( + _In_ HANDLE hEventLog, + _In_ DWORD dwInfoLevel, + _Out_writes_bytes_to_(cbBufSize, *pcbBytesNeeded) LPVOID lpBuffer, + _In_ DWORD cbBufSize, + _Out_ LPDWORD pcbBytesNeeded); + +BOOL WINAPI GetNumberOfEventLogRecords(_In_ HANDLE, _Out_ PDWORD); +BOOL WINAPI GetOldestEventLogRecord(_In_ HANDLE, _Out_ PDWORD); BOOL WINAPI GetOverlappedResult(HANDLE,LPOVERLAPPED,PDWORD,BOOL); DWORD WINAPI GetPriorityClass(HANDLE); BOOL WINAPI GetPrivateObjectSecurity(PSECURITY_DESCRIPTOR,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,DWORD,PDWORD); -UINT WINAPI GetPrivateProfileIntA(LPCSTR,LPCSTR,INT,LPCSTR); -UINT WINAPI GetPrivateProfileIntW(LPCWSTR,LPCWSTR,INT,LPCWSTR); -DWORD WINAPI GetPrivateProfileSectionA(LPCSTR,LPSTR,DWORD,LPCSTR); -DWORD WINAPI GetPrivateProfileSectionW(LPCWSTR,LPWSTR,DWORD,LPCWSTR); -DWORD WINAPI GetPrivateProfileSectionNamesA(LPSTR,DWORD,LPCSTR); -DWORD WINAPI GetPrivateProfileSectionNamesW(LPWSTR,DWORD,LPCWSTR); -DWORD WINAPI GetPrivateProfileStringA(LPCSTR,LPCSTR,LPCSTR,LPSTR,DWORD,LPCSTR); -DWORD WINAPI GetPrivateProfileStringW(LPCWSTR,LPCWSTR,LPCWSTR,LPWSTR,DWORD,LPCWSTR); -BOOL WINAPI GetPrivateProfileStructA(LPCSTR,LPCSTR,LPVOID,UINT,LPCSTR); -BOOL WINAPI GetPrivateProfileStructW(LPCWSTR,LPCWSTR,LPVOID,UINT,LPCWSTR); +UINT WINAPI GetPrivateProfileIntA(_In_ LPCSTR, _In_ LPCSTR, _In_ INT, _In_opt_ LPCSTR); +UINT WINAPI GetPrivateProfileIntW(_In_ LPCWSTR, _In_ LPCWSTR, _In_ INT, _In_opt_ LPCWSTR); + +DWORD +WINAPI +GetPrivateProfileSectionA( + _In_ LPCSTR lpAppName, + _Out_writes_to_opt_(nSize, return + 1) LPSTR lpReturnedString, + _In_ DWORD nSize, + _In_opt_ LPCSTR lpFileName); + +DWORD +WINAPI +GetPrivateProfileSectionW( + _In_ LPCWSTR lpAppName, + _Out_writes_to_opt_(nSize, return + 1) LPWSTR lpReturnedString, + _In_ DWORD nSize, + _In_opt_ LPCWSTR lpFileName); + +DWORD +WINAPI +GetPrivateProfileSectionNamesA( + _Out_writes_to_opt_(nSize, return + 1) LPSTR lpszReturnBuffer, + _In_ DWORD nSize, + _In_opt_ LPCSTR lpFileName); + +DWORD +WINAPI +GetPrivateProfileSectionNamesW( + _Out_writes_to_opt_(nSize, return + 1) LPWSTR lpszReturnBuffer, + _In_ DWORD nSize, + _In_opt_ LPCWSTR lpFileName); + +DWORD +WINAPI +GetPrivateProfileStringA( + _In_opt_ LPCSTR lpAppName, + _In_opt_ LPCSTR lpKeyName, + _In_opt_ LPCSTR lpDefault, + _Out_writes_to_opt_(nSize, return + 1) LPSTR lpReturnedString, + _In_ DWORD nSize, + _In_opt_ LPCSTR lpFileName); + +DWORD +WINAPI +GetPrivateProfileStringW( + _In_opt_ LPCWSTR lpAppName, + _In_opt_ LPCWSTR lpKeyName, + _In_opt_ LPCWSTR lpDefault, + _Out_writes_to_opt_(nSize, return + 1) LPWSTR lpReturnedString, + _In_ DWORD nSize, + _In_opt_ LPCWSTR lpFileName); + +BOOL +WINAPI +GetPrivateProfileStructA( + _In_ LPCSTR lpszSection, + _In_ LPCSTR lpszKey, + _Out_writes_bytes_opt_(uSizeStruct) LPVOID lpStruct, + _In_ UINT uSizeStruct, + _In_opt_ LPCSTR szFile); + +BOOL +WINAPI +GetPrivateProfileStructW( + _In_ LPCWSTR lpszSection, + _In_ LPCWSTR lpszKey, + _Out_writes_bytes_opt_(uSizeStruct) LPVOID lpStruct, + _In_ UINT uSizeStruct, + _In_opt_ LPCWSTR szFile); + FARPROC WINAPI GetProcAddress(HINSTANCE,LPCSTR); -BOOL WINAPI GetProcessAffinityMask(HANDLE,PDWORD_PTR,PDWORD_PTR); +BOOL WINAPI GetProcessAffinityMask(_In_ HANDLE, _Out_ PDWORD_PTR, _Out_ PDWORD_PTR); #if (_WIN32_WINNT >= 0x0502) -BOOL WINAPI GetProcessHandleCount(HANDLE,PDWORD); +BOOL WINAPI GetProcessHandleCount(_In_ HANDLE, _Out_ PDWORD); #endif HANDLE WINAPI GetProcessHeap(VOID); DWORD WINAPI GetProcessHeaps(DWORD,PHANDLE); @@ -1665,20 +2035,49 @@ DWORD WINAPI GetProcessId(HANDLE); #endif #if (_WIN32_WINNT >= 0x0500) -BOOL WINAPI GetProcessIoCounters(HANDLE,PIO_COUNTERS); -#endif -BOOL WINAPI GetProcessPriorityBoost(HANDLE,PBOOL); -BOOL WINAPI GetProcessShutdownParameters(PDWORD,PDWORD); +BOOL WINAPI GetProcessIoCounters(_In_ HANDLE, _Out_ PIO_COUNTERS); +#endif +BOOL WINAPI GetProcessPriorityBoost(_In_ HANDLE, _Out_ PBOOL); +BOOL WINAPI GetProcessShutdownParameters(_Out_ PDWORD, _Out_ PDWORD); BOOL WINAPI GetProcessTimes(HANDLE,LPFILETIME,LPFILETIME,LPFILETIME,LPFILETIME); DWORD WINAPI GetProcessVersion(DWORD); HWINSTA WINAPI GetProcessWindowStation(void); -BOOL WINAPI GetProcessWorkingSetSize(HANDLE,PSIZE_T,PSIZE_T); -UINT WINAPI GetProfileIntA(LPCSTR,LPCSTR,INT); -UINT WINAPI GetProfileIntW(LPCWSTR,LPCWSTR,INT); -DWORD WINAPI GetProfileSectionA(LPCSTR,LPSTR,DWORD); -DWORD WINAPI GetProfileSectionW(LPCWSTR,LPWSTR,DWORD); -DWORD WINAPI GetProfileStringA(LPCSTR,LPCSTR,LPCSTR,LPSTR,DWORD); -DWORD WINAPI GetProfileStringW(LPCWSTR,LPCWSTR,LPCWSTR,LPWSTR,DWORD); +BOOL WINAPI GetProcessWorkingSetSize(_In_ HANDLE, _Out_ PSIZE_T, _Out_ PSIZE_T); +UINT WINAPI GetProfileIntA(_In_ LPCSTR, _In_ LPCSTR, _In_ INT); +UINT WINAPI GetProfileIntW(_In_ LPCWSTR, _In_ LPCWSTR, _In_ INT); + +DWORD +WINAPI +GetProfileSectionA( + _In_ LPCSTR lpAppName, + _Out_writes_to_opt_(nSize, return + 1) LPSTR lpReturnedString, + _In_ DWORD nSize); + +DWORD +WINAPI +GetProfileSectionW( + _In_ LPCWSTR lpAppName, + _Out_writes_to_opt_(nSize, return + 1) LPWSTR lpReturnedString, + _In_ DWORD nSize); + +DWORD +WINAPI +GetProfileStringA( + _In_opt_ LPCSTR lpAppName, + _In_opt_ LPCSTR lpKeyName, + _In_opt_ LPCSTR lpDefault, + _Out_writes_to_opt_(nSize, return + 1) LPSTR lpReturnedString, + _In_ DWORD nSize); + +DWORD +WINAPI +GetProfileStringW( + _In_opt_ LPCWSTR lpAppName, + _In_opt_ LPCWSTR lpKeyName, + _In_opt_ LPCWSTR lpDefault, + _Out_writes_to_opt_(nSize, return + 1) LPWSTR lpReturnedString, + _In_ DWORD nSize); + BOOL WINAPI GetQueuedCompletionStatus(HANDLE,PDWORD,PULONG_PTR,LPOVERLAPPED*,DWORD); BOOL WINAPI GetSecurityDescriptorControl(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR_CONTROL,PDWORD); BOOL WINAPI GetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR,LPBOOL,PACL*,LPBOOL); @@ -1687,25 +2086,33 @@ BOOL WINAPI GetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR,PSID*,LPBOOL); DWORD WINAPI GetSecurityDescriptorRMControl(PSECURITY_DESCRIPTOR,PUCHAR); BOOL WINAPI GetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR,LPBOOL,PACL*,LPBOOL); -DWORD WINAPI GetShortPathNameA(LPCSTR,LPSTR,DWORD); + +_Success_(return != 0 && return < cchBuffer) +DWORD +WINAPI +GetShortPathNameA( + _In_ LPCSTR lpszLongPath, + _Out_writes_to_opt_(cchBuffer, return + 1) LPSTR lpszShortPath, + _In_ DWORD cchBuffer); + DWORD WINAPI GetShortPathNameW(LPCWSTR,LPWSTR,DWORD); PSID_IDENTIFIER_AUTHORITY WINAPI GetSidIdentifierAuthority(PSID); DWORD WINAPI GetSidLengthRequired(UCHAR); PDWORD WINAPI GetSidSubAuthority(PSID,DWORD); PUCHAR WINAPI GetSidSubAuthorityCount(PSID); -VOID WINAPI GetStartupInfoA(LPSTARTUPINFOA); +VOID WINAPI GetStartupInfoA(_Out_ LPSTARTUPINFOA); VOID WINAPI GetStartupInfoW(LPSTARTUPINFOW); HANDLE WINAPI GetStdHandle(DWORD); UINT WINAPI GetSystemDirectoryA(LPSTR,UINT); UINT WINAPI GetSystemDirectoryW(LPWSTR,UINT); VOID WINAPI GetSystemInfo(LPSYSTEM_INFO); -BOOL WINAPI GetSystemPowerStatus(LPSYSTEM_POWER_STATUS); +BOOL WINAPI GetSystemPowerStatus(_Out_ LPSYSTEM_POWER_STATUS); #if (_WIN32_WINNT >= 0x0502) -BOOL WINAPI GetSystemRegistryQuota(PDWORD,PDWORD); +BOOL WINAPI GetSystemRegistryQuota(_Out_opt_ PDWORD, _Out_opt_ PDWORD); #endif VOID WINAPI GetSystemTime(LPSYSTEMTIME); #if (_WIN32_WINNT >= 0x0501) -BOOL WINAPI GetSystemTimes(LPFILETIME,LPFILETIME,LPFILETIME); +BOOL WINAPI GetSystemTimes(_Out_opt_ LPFILETIME, _Out_opt_ LPFILETIME, _Out_opt_ LPFILETIME); #endif BOOL WINAPI GetSystemTimeAdjustment(PDWORD,PDWORD,PBOOL); void WINAPI GetSystemTimeAsFileTime(LPFILETIME); @@ -1713,24 +2120,60 @@ UINT WINAPI GetSystemWindowsDirectoryA(LPSTR,UINT); UINT WINAPI GetSystemWindowsDirectoryW(LPWSTR,UINT); #endif -#if (_WIN32_WINNT >= 0x0501) -UINT WINAPI GetSystemWow64DirectoryA(LPSTR,UINT); -UINT WINAPI GetSystemWow64DirectoryW(LPWSTR,UINT); -#endif -DWORD WINAPI GetTapeParameters(HANDLE,DWORD,PDWORD,PVOID); -DWORD WINAPI GetTapePosition(HANDLE,DWORD,PDWORD,PDWORD,PDWORD); -DWORD WINAPI GetTapeStatus(HANDLE); -UINT WINAPI GetTempFileNameA(LPCSTR,LPCSTR,UINT,LPSTR); + +#if (_WIN32_WINNT >= 0x0501) + +_Success_(return != 0 && return < uSize) +UINT +WINAPI +GetSystemWow64DirectoryA( + _Out_writes_to_opt_(uSize, return + 1) LPSTR lpBuffer, + _In_ UINT uSize); + +_Success_(return != 0 && return < uSize) +UINT +WINAPI +GetSystemWow64DirectoryW( + _Out_writes_to_opt_(uSize, return + 1) LPWSTR lpBuffer, + _In_ UINT uSize); + +#endif + +DWORD +WINAPI +GetTapeParameters( + _In_ HANDLE hDevice, + _In_ DWORD dwOperation, + _Inout_ LPDWORD lpdwSize, + _Out_writes_bytes_(*lpdwSize) LPVOID lpTapeInformation); + +DWORD WINAPI GetTapePosition(_In_ HANDLE, _In_ DWORD, _Out_ PDWORD, _Out_ PDWORD, _Out_ PDWORD); +DWORD WINAPI GetTapeStatus(_In_ HANDLE); + +UINT +WINAPI +GetTempFileNameA( + _In_ LPCSTR lpPathName, + _In_ LPCSTR lpPrefixString, + _In_ UINT uUnique, + _Out_writes_(MAX_PATH) LPSTR lpTempFileName); + UINT WINAPI GetTempFileNameW(LPCWSTR,LPCWSTR,UINT,LPWSTR); -DWORD WINAPI GetTempPathA(DWORD,LPSTR); + +DWORD +WINAPI +GetTempPathA( + _In_ DWORD nBufferLength, + _Out_writes_to_opt_(nBufferLength, return + 1) LPSTR lpBuffer); + DWORD WINAPI GetTempPathW(DWORD,LPWSTR); BOOL WINAPI GetThreadContext(HANDLE,LPCONTEXT); #if (_WIN32_WINNT >= 0x0502) -BOOL WINAPI GetThreadIOPendingFlag(HANDLE,PBOOL); +BOOL WINAPI GetThreadIOPendingFlag(_In_ HANDLE, _Out_ PBOOL); #endif int WINAPI GetThreadPriority(HANDLE); BOOL WINAPI GetThreadPriorityBoost(HANDLE,PBOOL); -BOOL WINAPI GetThreadSelectorEntry(HANDLE,DWORD,LPLDT_ENTRY); +BOOL WINAPI GetThreadSelectorEntry(_In_ HANDLE, _In_ DWORD, _Out_ LPLDT_ENTRY); BOOL WINAPI GetThreadTimes(HANDLE,LPFILETIME,LPFILETIME,LPFILETIME,LPFILETIME); DWORD WINAPI GetTickCount(VOID); #if (_WIN32_WINNT >= 0x0600) @@ -1739,52 +2182,115 @@ DWORD WINAPI GetThreadId(HANDLE); DWORD WINAPI GetTimeZoneInformation(LPTIME_ZONE_INFORMATION); BOOL WINAPI GetTokenInformation(HANDLE,TOKEN_INFORMATION_CLASS,PVOID,DWORD,PDWORD); -BOOL WINAPI GetUserNameA (LPSTR,PDWORD); -BOOL WINAPI GetUserNameW(LPWSTR,PDWORD); + +BOOL +WINAPI +GetUserNameA( + _Out_writes_to_opt_(*pcbBuffer, *pcbBuffer) LPSTR lpBuffer, + _Inout_ LPDWORD pcbBuffer); + +BOOL +WINAPI +GetUserNameW( + _Out_writes_to_opt_(*pcbBuffer, *pcbBuffer) LPWSTR lpBuffer, + _Inout_ LPDWORD pcbBuffer); + DWORD WINAPI GetVersion(void); BOOL WINAPI GetVersionExA(LPOSVERSIONINFOA); BOOL WINAPI GetVersionExW(LPOSVERSIONINFOW); -BOOL WINAPI GetVolumeInformationA(LPCSTR,LPSTR,DWORD,PDWORD,PDWORD,PDWORD,LPSTR,DWORD); + +BOOL +WINAPI +GetVolumeInformationA( + _In_opt_ LPCSTR lpRootPathName, + _Out_writes_opt_(nVolumeNameSize) LPSTR lpVolumeNameBuffer, + _In_ DWORD nVolumeNameSize, + _Out_opt_ LPDWORD lpVolumeSerialNumber, + _Out_opt_ LPDWORD lpMaximumComponentLength, + _Out_opt_ LPDWORD lpFileSystemFlags, + _Out_writes_opt_(nFileSystemNameSize) LPSTR lpFileSystemNameBuffer, + _In_ DWORD nFileSystemNameSize); + BOOL WINAPI GetVolumeInformationW(LPCWSTR,LPWSTR,DWORD,PDWORD,PDWORD,PDWORD,LPWSTR,DWORD); -#if (_WIN32_WINNT >= 0x0500) -BOOL WINAPI GetVolumeNameForVolumeMountPointA(LPCSTR,LPSTR,DWORD); + +#if (_WIN32_WINNT >= 0x0500) + +BOOL +WINAPI +GetVolumeNameForVolumeMountPointA( + _In_ LPCSTR lpszVolumeMountPoint, + _Out_writes_(cchBufferLength) LPSTR lpszVolumeName, + _In_ DWORD cchBufferLength); + BOOL WINAPI GetVolumeNameForVolumeMountPointW(LPCWSTR,LPWSTR,DWORD); -BOOL WINAPI GetVolumePathNameA(LPCSTR,LPSTR,DWORD); + +BOOL +WINAPI +GetVolumePathNameA( + _In_ LPCSTR lpszFileName, + _Out_writes_(cchBufferLength) LPSTR lpszVolumePathName, + _In_ DWORD cchBufferLength); + BOOL WINAPI GetVolumePathNameW(LPCWSTR,LPWSTR,DWORD); -#endif -#if (_WIN32_WINNT >= 0x0501) -BOOL WINAPI GetVolumePathNamesForVolumeNameA(LPCSTR,LPSTR,DWORD,PDWORD); + +#endif + +#if (_WIN32_WINNT >= 0x0501) + +BOOL +WINAPI +GetVolumePathNamesForVolumeNameA( + _In_ LPCSTR lpszVolumeName, + _Out_writes_to_opt_(cchBufferLength, *lpcchReturnLength) _Post_ _NullNull_terminated_ LPCH lpszVolumePathNames, + _In_ DWORD cchBufferLength, + _Out_ PDWORD lpcchReturnLength); + BOOL WINAPI GetVolumePathNamesForVolumeNameW(LPCWSTR,LPWSTR,DWORD,PDWORD); -#endif + +#endif + UINT WINAPI GetWindowsDirectoryA(LPSTR,UINT); UINT WINAPI GetWindowsDirectoryW(LPWSTR,UINT); DWORD WINAPI GetWindowThreadProcessId(HWND,PDWORD); UINT WINAPI GetWriteWatch(DWORD,PVOID,SIZE_T,PVOID*,PULONG_PTR,PULONG); -ATOM WINAPI GlobalAddAtomA(LPCSTR); -ATOM WINAPI GlobalAddAtomW( LPCWSTR); +ATOM WINAPI GlobalAddAtomA(_In_opt_ LPCSTR); +ATOM WINAPI GlobalAddAtomW(_In_opt_ LPCWSTR); HGLOBAL WINAPI GlobalAlloc(UINT,SIZE_T); -SIZE_T WINAPI GlobalCompact(DWORD); /* Obsolete: Has no effect. */ -ATOM WINAPI GlobalDeleteAtom(ATOM); +SIZE_T WINAPI GlobalCompact(_In_ DWORD); /* Obsolete: Has no effect. */ +ATOM WINAPI GlobalDeleteAtom(_In_ ATOM); #define GlobalDiscard(m) GlobalReAlloc((m),0,GMEM_MOVEABLE) -ATOM WINAPI GlobalFindAtomA(LPCSTR); -ATOM WINAPI GlobalFindAtomW(LPCWSTR); -VOID WINAPI GlobalFix(HGLOBAL); /* Obsolete: Has no effect. */ -UINT WINAPI GlobalFlags(HGLOBAL); /* Obsolete: Has no effect. */ +ATOM WINAPI GlobalFindAtomA(_In_opt_ LPCSTR); +ATOM WINAPI GlobalFindAtomW(_In_opt_ LPCWSTR); +VOID WINAPI GlobalFix(_In_ HGLOBAL); /* Obsolete: Has no effect. */ +UINT WINAPI GlobalFlags(_In_ HGLOBAL); /* Obsolete: Has no effect. */ HGLOBAL WINAPI GlobalFree(HGLOBAL); -UINT WINAPI GlobalGetAtomNameA(ATOM,LPSTR,int); -UINT WINAPI GlobalGetAtomNameW(ATOM,LPWSTR,int); -HGLOBAL WINAPI GlobalHandle(LPCVOID); -LPVOID WINAPI GlobalLock(HGLOBAL); -VOID WINAPI GlobalMemoryStatus(LPMEMORYSTATUS); + +UINT +WINAPI +GlobalGetAtomNameA( + _In_ ATOM nAtom, + _Out_writes_to_(nSize, return + 1) LPSTR lpBuffer, + _In_ int nSize); + +UINT +WINAPI +GlobalGetAtomNameW( + _In_ ATOM nAtom, + _Out_writes_to_(nSize, return + 1) LPWSTR lpBuffer, + _In_ int nSize); + +_Ret_maybenull_ HGLOBAL WINAPI GlobalHandle(_In_ LPCVOID); +_Ret_maybenull_ LPVOID WINAPI GlobalLock(_In_ HGLOBAL); +VOID WINAPI GlobalMemoryStatus(_Out_ LPMEMORYSTATUS); #if (_WIN32_WINNT >= 0x0500) BOOL WINAPI GlobalMemoryStatusEx(LPMEMORYSTATUSEX); #endif HGLOBAL WINAPI GlobalReAlloc(HGLOBAL,SIZE_T,UINT); -SIZE_T WINAPI GlobalSize(HGLOBAL); -VOID WINAPI GlobalUnfix(HGLOBAL); /* Obsolete: Has no effect. */ -BOOL WINAPI GlobalUnlock(HGLOBAL); -BOOL WINAPI GlobalUnWire(HGLOBAL); /* Obsolete: Has no effect. */ -PVOID WINAPI GlobalWire(HGLOBAL); /* Obsolete: Has no effect. */ +SIZE_T WINAPI GlobalSize(_In_ HGLOBAL); +VOID WINAPI GlobalUnfix(_In_ HGLOBAL); /* Obsolete: Has no effect. */ +BOOL WINAPI GlobalUnlock(_In_ HGLOBAL); +BOOL WINAPI GlobalUnWire(_In_ HGLOBAL); /* Obsolete: Has no effect. */ +PVOID WINAPI GlobalWire(_In_ HGLOBAL); /* Obsolete: Has no effect. */ #define HasOverlappedIoCompleted(lpOverlapped) ((lpOverlapped)->Internal != STATUS_PENDING) PVOID WINAPI HeapAlloc(HANDLE,DWORD,SIZE_T); SIZE_T WINAPI HeapCompact(HANDLE,DWORD); @@ -1807,7 +2313,7 @@ BOOL WINAPI ImpersonateLoggedOnUser(HANDLE); BOOL WINAPI ImpersonateNamedPipeClient(HANDLE); BOOL WINAPI ImpersonateSelf(SECURITY_IMPERSONATION_LEVEL); -BOOL WINAPI InitAtomTable(DWORD); +BOOL WINAPI InitAtomTable(_In_ DWORD); BOOL WINAPI InitializeAcl(PACL,DWORD,DWORD); #if (_WIN32_WINNT >= 0x0600) VOID WINAPI InitializeConditionVariable(PCONDITION_VARIABLE); @@ -1957,20 +2463,27 @@ #endif /* __INTERLOCKED_DECLARED */ -BOOL WINAPI IsBadCodePtr(FARPROC); -BOOL WINAPI IsBadHugeReadPtr(CONST VOID*,UINT_PTR); -BOOL WINAPI IsBadHugeWritePtr(PVOID,UINT_PTR); -BOOL WINAPI IsBadReadPtr(CONST VOID*,UINT_PTR); -BOOL WINAPI IsBadStringPtrA(LPCSTR,UINT_PTR); -BOOL WINAPI IsBadStringPtrW(LPCWSTR,UINT_PTR); -BOOL WINAPI IsBadWritePtr(PVOID,UINT_PTR); +BOOL WINAPI IsBadCodePtr(_In_opt_ FARPROC); +BOOL WINAPI IsBadHugeReadPtr(_In_opt_ CONST VOID*, _In_ UINT_PTR); +BOOL WINAPI IsBadHugeWritePtr(_In_opt_ PVOID, _In_ UINT_PTR); +BOOL WINAPI IsBadReadPtr(_In_opt_ CONST VOID*, _In_ UINT_PTR); +BOOL WINAPI IsBadStringPtrA(_In_opt_ LPCSTR, _In_ UINT_PTR); +BOOL WINAPI IsBadStringPtrW(_In_opt_ LPCWSTR, _In_ UINT_PTR); +BOOL WINAPI IsBadWritePtr(_In_opt_ PVOID, _In_ UINT_PTR); BOOL WINAPI IsDebuggerPresent(void); #if (_WIN32_WINNT >= 0x0501) BOOL WINAPI IsProcessInJob(HANDLE,HANDLE,PBOOL); #endif BOOL WINAPI IsProcessorFeaturePresent(DWORD); BOOL WINAPI IsSystemResumeAutomatic(void); -BOOL WINAPI IsTextUnicode(CONST VOID*,int,LPINT); + +BOOL +WINAPI +IsTextUnicode( + _In_reads_bytes_(iSize) CONST VOID *lpv, + _In_ int iSize, + _Inout_opt_ LPINT lpiResult); + #if (_WIN32_WINNT >= 0x0600) BOOL WINAPI IsThreadAFiber(VOID); #endif @@ -1983,50 +2496,151 @@ #endif void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION); #define LimitEmsPages(n) -HINSTANCE WINAPI LoadLibraryA(LPCSTR); +_Ret_maybenull_ HINSTANCE WINAPI LoadLibraryA(_In_ LPCSTR); +_Ret_maybenull_ HINSTANCE WINAPI LoadLibraryW(_In_ LPCWSTR); HINSTANCE WINAPI LoadLibraryExA(LPCSTR,HANDLE,DWORD); HINSTANCE WINAPI LoadLibraryExW(LPCWSTR,HANDLE,DWORD); -HINSTANCE WINAPI LoadLibraryW(LPCWSTR); -DWORD WINAPI LoadModule(LPCSTR,PVOID); +DWORD WINAPI LoadModule(_In_ LPCSTR, _In_ PVOID); HGLOBAL WINAPI LoadResource(HINSTANCE,HRSRC); HLOCAL WINAPI LocalAlloc(UINT,SIZE_T); -SIZE_T WINAPI LocalCompact(UINT); /* Obsolete: Has no effect. */ +SIZE_T WINAPI LocalCompact(_In_ UINT); /* Obsolete: Has no effect. */ #define LocalDiscard(m) (LocalReAlloc((m),0,LMEM_MOVEABLE)) BOOL WINAPI LocalFileTimeToFileTime(CONST FILETIME *,LPFILETIME); -UINT WINAPI LocalFlags(HLOCAL); /* Obsolete: Has no effect. */ +UINT WINAPI LocalFlags(_In_ HLOCAL); /* Obsolete: Has no effect. */ HLOCAL WINAPI LocalFree(HLOCAL); -HLOCAL WINAPI LocalHandle(LPCVOID); +_Ret_maybenull_ HLOCAL WINAPI LocalHandle(_In_ LPCVOID); PVOID WINAPI LocalLock(HLOCAL); HLOCAL WINAPI LocalReAlloc(HLOCAL,SIZE_T,UINT); -SIZE_T WINAPI LocalShrink(HLOCAL,UINT); /* Obsolete: Has no effect. */ -SIZE_T WINAPI LocalSize(HLOCAL); +SIZE_T WINAPI LocalShrink(_In_ HLOCAL, _In_ UINT); /* Obsolete: Has no effect. */ +SIZE_T WINAPI LocalSize(_In_ HLOCAL); BOOL WINAPI LocalUnlock(HLOCAL); BOOL WINAPI LockFile(HANDLE,DWORD,DWORD,DWORD,DWORD); BOOL WINAPI LockFileEx(HANDLE,DWORD,DWORD,DWORD,DWORD,LPOVERLAPPED); PVOID WINAPI LockResource(HGLOBAL); #define LockSegment(w) GlobalFix((HANDLE)(w)) /* Obsolete: Has no effect. */ -BOOL WINAPI LogonUserA(LPSTR,LPSTR,LPSTR,DWORD,DWORD,PHANDLE); -BOOL WINAPI LogonUserW(LPWSTR,LPWSTR,LPWSTR,DWORD,DWORD,PHANDLE); -BOOL WINAPI LookupAccountNameA(LPCSTR,LPCSTR,PSID,PDWORD,LPSTR,PDWORD,PSID_NAME_USE); -BOOL WINAPI LookupAccountNameW(LPCWSTR,LPCWSTR,PSID,PDWORD,LPWSTR,PDWORD,PSID_NAME_USE); -BOOL WINAPI LookupAccountSidA(LPCSTR,PSID,LPSTR,PDWORD,LPSTR,PDWORD,PSID_NAME_USE); -BOOL WINAPI LookupAccountSidW(LPCWSTR,PSID,LPWSTR,PDWORD,LPWSTR,PDWORD,PSID_NAME_USE); -BOOL WINAPI LookupPrivilegeDisplayNameA(LPCSTR,LPCSTR,LPSTR,PDWORD,PDWORD); -BOOL WINAPI LookupPrivilegeDisplayNameW(LPCWSTR,LPCWSTR,LPWSTR,PDWORD,PDWORD); -BOOL WINAPI LookupPrivilegeNameA(LPCSTR,PLUID,LPSTR,PDWORD); -BOOL WINAPI LookupPrivilegeNameW(LPCWSTR,PLUID,LPWSTR,PDWORD); -BOOL WINAPI LookupPrivilegeValueA(LPCSTR,LPCSTR,PLUID); -BOOL WINAPI LookupPrivilegeValueW(LPCWSTR,LPCWSTR,PLUID); -LPSTR WINAPI lstrcatA(LPSTR,LPCSTR); -LPWSTR WINAPI lstrcatW(LPWSTR,LPCWSTR); +BOOL WINAPI LogonUserA(_In_ LPSTR, _In_opt_ LPSTR, _In_opt_ LPSTR, _In_ DWORD, _In_ DWORD, _Outptr_ PHANDLE); +BOOL WINAPI LogonUserW(_In_ LPWSTR, _In_opt_ LPWSTR, _In_opt_ LPWSTR, _In_ DWORD, _In_ DWORD, _Outptr_ PHANDLE); + +_Success_(return != FALSE) +BOOL +WINAPI +LookupAccountNameA( + _In_opt_ LPCSTR lpSystemName, + _In_ LPCSTR lpAccountName, + _Out_writes_bytes_to_opt_(*cbSid, *cbSid) PSID Sid, + _Inout_ LPDWORD cbSid, + _Out_writes_to_opt_(*cchReferencedDomainName, *cchReferencedDomainName + 1) LPSTR ReferencedDomainName, + _Inout_ LPDWORD cchReferencedDomainName, + _Out_ PSID_NAME_USE peUse); + +_Success_(return != FALSE) +BOOL +WINAPI +LookupAccountNameW( + _In_opt_ LPCWSTR lpSystemName, + _In_ LPCWSTR lpAccountName, + _Out_writes_bytes_to_opt_(*cbSid, *cbSid) PSID Sid, + _Inout_ LPDWORD cbSid, + _Out_writes_to_opt_(*cchReferencedDomainName, *cchReferencedDomainName + 1) LPWSTR ReferencedDomainName, + _Inout_ LPDWORD cchReferencedDomainName, + _Out_ PSID_NAME_USE peUse); + +_Success_(return != FALSE) +BOOL +WINAPI +LookupAccountSidA( + _In_opt_ LPCSTR lpSystemName, + _In_ PSID Sid, + _Out_writes_to_opt_(*cchName, *cchName + 1) LPSTR Name, + _Inout_ LPDWORD cchName, + _Out_writes_to_opt_(*cchReferencedDomainName, *cchReferencedDomainName + 1) LPSTR ReferencedDomainName, + _Inout_ LPDWORD cchReferencedDomainName, + _Out_ PSID_NAME_USE peUse); + +_Success_(return != FALSE) +BOOL +WINAPI +LookupAccountSidW( + _In_opt_ LPCWSTR lpSystemName, + _In_ PSID Sid, + _Out_writes_to_opt_(*cchName, *cchName + 1) LPWSTR Name, + _Inout_ LPDWORD cchName, + _Out_writes_to_opt_(*cchReferencedDomainName, *cchReferencedDomainName + 1) LPWSTR ReferencedDomainName, + _Inout_ LPDWORD cchReferencedDomainName, + _Out_ PSID_NAME_USE peUse); + +_Success_(return != FALSE) +BOOL +WINAPI +LookupPrivilegeDisplayNameA( + _In_opt_ LPCSTR lpSystemName, + _In_ LPCSTR lpName, + _Out_writes_to_opt_(*cchDisplayName, *cchDisplayName + 1) LPSTR lpDisplayName, + _Inout_ LPDWORD cchDisplayName, + _Out_ LPDWORD lpLanguageId); + +_Success_(return != FALSE) +BOOL +WINAPI +LookupPrivilegeDisplayNameW( + _In_opt_ LPCWSTR lpSystemName, + _In_ LPCWSTR lpName, + _Out_writes_to_opt_(*cchDisplayName, *cchDisplayName + 1) LPWSTR lpDisplayName, + _Inout_ LPDWORD cchDisplayName, + _Out_ LPDWORD lpLanguageId); + +_Success_(return != FALSE) +BOOL +WINAPI +LookupPrivilegeNameA( + _In_opt_ LPCSTR lpSystemName, + _In_ PLUID lpLuid, + _Out_writes_to_opt_(*cchName, *cchName + 1) LPSTR lpName, + _Inout_ LPDWORD cchName); + +_Success_(return != FALSE) +BOOL +WINAPI +LookupPrivilegeNameW( + _In_opt_ LPCWSTR lpSystemName, + _In_ PLUID lpLuid, + _Out_writes_to_opt_(*cchName, *cchName + 1) LPWSTR lpName, + _Inout_ LPDWORD cchName); + +BOOL WINAPI LookupPrivilegeValueA(_In_opt_ LPCSTR, _In_ LPCSTR, _Out_ PLUID); +BOOL WINAPI LookupPrivilegeValueW(_In_opt_ LPCWSTR, _In_ LPCWSTR, _Out_ PLUID); + +LPSTR +WINAPI +lstrcatA( + _Inout_updates_z_(_String_length_(lpString1) + _String_length_(lpString2) + 1) LPSTR lpString1, + _In_ LPCSTR lpString2); + +LPWSTR +WINAPI +lstrcatW( + _Inout_updates_z_(_String_length_(lpString1) + _String_length_(lpString2) + 1) LPWSTR lpString1, + _In_ LPCWSTR lpString2); + int WINAPI lstrcmpA(LPCSTR,LPCSTR); int WINAPI lstrcmpiA(LPCSTR,LPCSTR); int WINAPI lstrcmpiW( LPCWSTR,LPCWSTR); int WINAPI lstrcmpW(LPCWSTR,LPCWSTR); -LPSTR WINAPI lstrcpyA(LPSTR,LPCSTR); + +LPSTR +WINAPI +lstrcpyA( + _Out_writes_(_String_length_(lpString2) + 1) LPSTR lpString1, + _In_ LPCSTR lpString2); + +LPWSTR +WINAPI +lstrcpyW( + _Out_writes_(_String_length_(lpString2) + 1) LPWSTR lpString1, + _In_ LPCWSTR lpString2); + LPSTR WINAPI lstrcpynA(LPSTR,LPCSTR,int); LPWSTR WINAPI lstrcpynW(LPWSTR,LPCWSTR,int); -LPWSTR WINAPI lstrcpyW(LPWSTR,LPCWSTR); int WINAPI lstrlenA(LPCSTR); int WINAPI lstrlenW(LPCWSTR); BOOL WINAPI MakeAbsoluteSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PDWORD,PACL,PDWORD,PACL,PDWORD,PSID,PDWORD,PSID,PDWORD); @@ -2035,61 +2649,78 @@ VOID WINAPI MapGenericMask(PDWORD,PGENERIC_MAPPING); PVOID WINAPI MapViewOfFile(HANDLE,DWORD,DWORD,DWORD,SIZE_T); PVOID WINAPI MapViewOfFileEx(HANDLE,DWORD,DWORD,DWORD,SIZE_T,PVOID); -BOOL WINAPI MoveFileA(LPCSTR,LPCSTR); -BOOL WINAPI MoveFileExA(LPCSTR,LPCSTR,DWORD); -BOOL WINAPI MoveFileExW(LPCWSTR,LPCWSTR,DWORD); -BOOL WINAPI MoveFileW(LPCWSTR,LPCWSTR); -int WINAPI MulDiv(int,int,int); -BOOL WINAPI NotifyChangeEventLog(HANDLE,HANDLE); -BOOL WINAPI ObjectCloseAuditAlarmA(LPCSTR,PVOID,BOOL); +BOOL WINAPI MoveFileA(_In_ LPCSTR, _In_ LPCSTR); +BOOL WINAPI MoveFileW(_In_ LPCWSTR, _In_ LPCWSTR); +BOOL WINAPI MoveFileExA(_In_ LPCSTR, _In_opt_ LPCSTR, _In_ DWORD); +BOOL WINAPI MoveFileExW(_In_ LPCWSTR, _In_opt_ LPCWSTR, _In_ DWORD); +int WINAPI MulDiv(_In_ int, _In_ int, _In_ int); +BOOL WINAPI NotifyChangeEventLog(_In_ HANDLE, _In_ HANDLE); +BOOL WINAPI ObjectCloseAuditAlarmA(_In_ LPCSTR, _In_ PVOID, _In_ BOOL); BOOL WINAPI ObjectCloseAuditAlarmW(LPCWSTR,PVOID,BOOL); -BOOL WINAPI ObjectDeleteAuditAlarmA(LPCSTR,PVOID,BOOL); +BOOL WINAPI ObjectDeleteAuditAlarmA(_In_ LPCSTR, _In_ PVOID, _In_ BOOL); BOOL WINAPI ObjectDeleteAuditAlarmW(LPCWSTR,PVOID,BOOL); -BOOL WINAPI ObjectOpenAuditAlarmA(LPCSTR,PVOID,LPSTR,LPSTR,PSECURITY_DESCRIPTOR,HANDLE,DWORD,DWORD,PPRIVILEGE_SET,BOOL,BOOL,PBOOL); +BOOL WINAPI ObjectOpenAuditAlarmA(_In_ LPCSTR, _In_ PVOID, _In_ LPSTR, _In_opt_ LPSTR, _In_ PSECURITY_DESCRIPTOR, _In_ HANDLE, _In_ DWORD, _In_ DWORD, _In_opt_ PPRIVILEGE_SET, _In_ BOOL, _In_ BOOL, _Out_ PBOOL); BOOL WINAPI ObjectOpenAuditAlarmW(LPCWSTR,PVOID,LPWSTR,LPWSTR,PSECURITY_DESCRIPTOR,HANDLE,DWORD,DWORD,PPRIVILEGE_SET,BOOL,BOOL,PBOOL); -BOOL WINAPI ObjectPrivilegeAuditAlarmA(LPCSTR,PVOID,HANDLE,DWORD,PPRIVILEGE_SET,BOOL); +BOOL WINAPI ObjectPrivilegeAuditAlarmA(_In_ LPCSTR, _In_ PVOID, _In_ HANDLE, _In_ DWORD, _In_ PPRIVILEGE_SET, _In_ BOOL); BOOL WINAPI ObjectPrivilegeAuditAlarmW(LPCWSTR,PVOID,HANDLE,DWORD,PPRIVILEGE_SET,BOOL); -HANDLE WINAPI OpenBackupEventLogA(LPCSTR,LPCSTR); -HANDLE WINAPI OpenBackupEventLogW(LPCWSTR,LPCWSTR); +HANDLE WINAPI OpenBackupEventLogA(_In_opt_ LPCSTR, _In_ LPCSTR); +HANDLE WINAPI OpenBackupEventLogW(_In_opt_ LPCWSTR, _In_ LPCWSTR); HANDLE WINAPI OpenEventA(DWORD,BOOL,LPCSTR); -HANDLE WINAPI OpenEventLogA (LPCSTR,LPCSTR); -HANDLE WINAPI OpenEventLogW(LPCWSTR,LPCWSTR); +HANDLE WINAPI OpenEventLogA(_In_opt_ LPCSTR, _In_ LPCSTR); +HANDLE WINAPI OpenEventLogW(_In_opt_ LPCWSTR, _In_ LPCWSTR); HANDLE WINAPI OpenEventW(DWORD,BOOL,LPCWSTR); -HFILE WINAPI OpenFile(LPCSTR,LPOFSTRUCT,UINT); +HFILE WINAPI OpenFile(_In_ LPCSTR, _Inout_ LPOFSTRUCT, _In_ UINT); #if (_WIN32_WINNT >= 0x0600) -HANDLE WINAPI OpenFileById(HANDLE,LPFILE_ID_DESCRIPTOR,DWORD,DWORD,LPSECURITY_ATTRIBUTES,DWORD); -#endif -HANDLE WINAPI OpenFileMappingA(DWORD,BOOL,LPCSTR); +HANDLE WINAPI OpenFileById(_In_ HANDLE, _In_ LPFILE_ID_DESCRIPTOR, _In_ DWORD, _In_ DWORD, _In_opt_ LPSECURITY_ATTRIBUTES, _In_ DWORD); +#endif +HANDLE WINAPI OpenFileMappingA(_In_ DWORD, _In_ BOOL, _In_ LPCSTR); HANDLE WINAPI OpenFileMappingW(DWORD,BOOL,LPCWSTR); -HANDLE WINAPI OpenMutexA(DWORD,BOOL,LPCSTR); +_Ret_maybenull_ HANDLE WINAPI OpenMutexA(_In_ DWORD, _In_ BOOL, _In_ LPCSTR); HANDLE WINAPI OpenMutexW(DWORD,BOOL,LPCWSTR); HANDLE WINAPI OpenProcess(DWORD,BOOL,DWORD); BOOL WINAPI OpenProcessToken(HANDLE,DWORD,PHANDLE); -HANDLE WINAPI OpenSemaphoreA(DWORD,BOOL,LPCSTR); +_Ret_maybenull_ HANDLE WINAPI OpenSemaphoreA(_In_ DWORD, _In_ BOOL, _In_ LPCSTR); HANDLE WINAPI OpenSemaphoreW(DWORD,BOOL,LPCWSTR); #if (_WIN32_WINNT >= 0x0500) || (_WIN32_WINDOWS >= 0x0490) HANDLE WINAPI OpenThread(DWORD,BOOL,DWORD); #endif BOOL WINAPI OpenThreadToken(HANDLE,DWORD,BOOL,PHANDLE); -HANDLE WINAPI OpenWaitableTimerA(DWORD,BOOL,LPCSTR); +_Ret_maybenull_ HANDLE WINAPI OpenWaitableTimerA(_In_ DWORD, _In_ BOOL, _In_ LPCSTR); HANDLE WINAPI OpenWaitableTimerW(DWORD,BOOL,LPCWSTR); WINBASEAPI void WINAPI OutputDebugStringA(LPCSTR); WINBASEAPI void WINAPI OutputDebugStringW(LPCWSTR); BOOL WINAPI PeekNamedPipe(HANDLE,PVOID,DWORD,PDWORD,PDWORD,PDWORD); BOOL WINAPI PostQueuedCompletionStatus(HANDLE,DWORD,ULONG_PTR,LPOVERLAPPED); -DWORD WINAPI PrepareTape(HANDLE,DWORD,BOOL); +DWORD WINAPI PrepareTape(_In_ HANDLE, _In_ DWORD, _In_ BOOL); BOOL WINAPI PrivilegeCheck (HANDLE,PPRIVILEGE_SET,PBOOL); -BOOL WINAPI PrivilegedServiceAuditAlarmA(LPCSTR,LPCSTR,HANDLE,PPRIVILEGE_SET,BOOL); +BOOL WINAPI PrivilegedServiceAuditAlarmA(_In_ LPCSTR, _In_ LPCSTR, _In_ HANDLE, _In_ PPRIVILEGE_SET, _In_ BOOL); BOOL WINAPI PrivilegedServiceAuditAlarmW(LPCWSTR,LPCWSTR,HANDLE,PPRIVILEGE_SET,BOOL); #if (_WIN32_WINNT >= 0x0500) BOOL WINAPI ProcessIdToSessionId(DWORD,DWORD*); #endif BOOL WINAPI PulseEvent(HANDLE); -BOOL WINAPI PurgeComm(HANDLE,DWORD); -#if (_WIN32_WINNT >= 0x0501) -BOOL WINAPI QueryActCtxW(DWORD,HANDLE,PVOID,ULONG,PVOID,SIZE_T,SIZE_T*); -#endif -DWORD WINAPI QueryDosDeviceA(LPCSTR,LPSTR,DWORD); +BOOL WINAPI PurgeComm(_In_ HANDLE, _In_ DWORD); + +#if (_WIN32_WINNT >= 0x0501) +BOOL +WINAPI +QueryActCtxW( + _In_ DWORD dwFlags, + _In_ HANDLE hActCtx, + _In_opt_ PVOID pvSubInstance, + _In_ ULONG ulInfoClass, + _Out_writes_bytes_to_opt_(cbBuffer, *pcbWrittenOrRequired) PVOID pvBuffer, + _In_ SIZE_T cbBuffer, + _Out_opt_ SIZE_T *pcbWrittenOrRequired); +#endif + +DWORD +WINAPI +QueryDosDeviceA( + _In_opt_ LPCSTR lpDeviceName, + _Out_writes_to_opt_(ucchMax, return) LPSTR lpTargetPath, + _In_ DWORD ucchMax); + DWORD WINAPI QueryDosDeviceW(LPCWSTR,LPWSTR,DWORD); #if (_WIN32_WINNT >= 0x0501) BOOL WINAPI QueryMemoryResourceNotification(HANDLE,PBOOL); @@ -2104,9 +2735,41 @@ BOOL WINAPI QueueUserWorkItem(LPTHREAD_START_ROUTINE,PVOID,ULONG); #endif void WINAPI RaiseException(DWORD,DWORD,DWORD,const ULONG_PTR*); -BOOL WINAPI ReadDirectoryChangesW(HANDLE,PVOID,DWORD,BOOL,DWORD,PDWORD,LPOVERLAPPED,LPOVERLAPPED_COMPLETION_ROUTINE); -BOOL WINAPI ReadEventLogA(HANDLE,DWORD,DWORD,PVOID,DWORD,DWORD *,DWORD *); -BOOL WINAPI ReadEventLogW(HANDLE,DWORD,DWORD,PVOID,DWORD,DWORD *,DWORD *); + +BOOL +WINAPI +ReadDirectoryChangesW( + _In_ HANDLE hDirectory, + _Out_writes_bytes_to_(nBufferLength, *lpBytesReturned) LPVOID lpBuffer, + _In_ DWORD nBufferLength, + _In_ BOOL bWatchSubtree, + _In_ DWORD dwNotifyFilter, + _Out_opt_ LPDWORD lpBytesReturned, + _Inout_opt_ LPOVERLAPPED lpOverlapped, + _In_opt_ LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine); + +BOOL +WINAPI +ReadEventLogA( + _In_ HANDLE hEventLog, + _In_ DWORD dwReadFlags, + _In_ DWORD dwRecordOffset, + _Out_writes_bytes_to_(nNumberOfBytesToRead, *pnBytesRead) LPVOID lpBuffer, + _In_ DWORD nNumberOfBytesToRead, + _Out_ DWORD *pnBytesRead, + _Out_ DWORD *pnMinNumberOfBytesNeeded); + +BOOL +WINAPI +ReadEventLogW( + _In_ HANDLE hEventLog, + _In_ DWORD dwReadFlags, + _In_ DWORD dwRecordOffset, + _Out_writes_bytes_to_(nNumberOfBytesToRead, *pnBytesRead) LPVOID lpBuffer, + _In_ DWORD nNumberOfBytesToRead, + _Out_ DWORD *pnBytesRead, + _Out_ DWORD *pnMinNumberOfBytesNeeded); + BOOL WINAPI ReadFile(HANDLE,PVOID,DWORD,PDWORD,LPOVERLAPPED); BOOL WINAPI ReadFileEx(HANDLE,PVOID,DWORD,LPOVERLAPPED,LPOVERLAPPED_COMPLETION_ROUTINE); BOOL WINAPI ReadFileScatter(HANDLE,FILE_SEGMENT_ELEMENT*,DWORD,LPDWORD,LPOVERLAPPED); @@ -2114,17 +2777,17 @@ #if (_WIN32_WINNT >= 0x0600) VOID WINAPI RecoveryFinished(BOOL); HRESULT WINAPI RecoveryInProgress(OUT PBOOL); -HRESULT WINAPI RegisterApplicationRecoveryCallback(APPLICATION_RECOVERY_CALLBACK,PVOID, DWORD, DWORD); -HRESULT WINAPI RegisterApplicationRestart(PCWSTR,DWORD); -#endif -HANDLE WINAPI RegisterEventSourceA (LPCSTR,LPCSTR); -HANDLE WINAPI RegisterEventSourceW(LPCWSTR,LPCWSTR); -#if (_WIN32_WINNT >= 0x0500) -BOOL WINAPI RegisterWaitForSingleObject(PHANDLE,HANDLE,WAITORTIMERCALLBACK,PVOID,ULONG,ULONG); +HRESULT WINAPI RegisterApplicationRecoveryCallback(_In_ APPLICATION_RECOVERY_CALLBACK, _In_opt_ PVOID, _In_ DWORD, _In_ DWORD); +HRESULT WINAPI RegisterApplicationRestart(_In_opt_ PCWSTR, _In_ DWORD); +#endif +HANDLE WINAPI RegisterEventSourceA(_In_opt_ LPCSTR, _In_ LPCSTR); +HANDLE WINAPI RegisterEventSourceW(_In_opt_ LPCWSTR, _In_ LPCWSTR); +#if (_WIN32_WINNT >= 0x0500) +BOOL WINAPI RegisterWaitForSingleObject(_Outptr_ PHANDLE, _In_ HANDLE, _In_ WAITORTIMERCALLBACK, _In_opt_ PVOID, _In_ ULONG, _In_ ULONG); HANDLE WINAPI RegisterWaitForSingleObjectEx(HANDLE,WAITORTIMERCALLBACK,PVOID,ULONG,ULONG); #endif #if (_WIN32_WINNT >= 0x0501) -void WINAPI ReleaseActCtx(HANDLE); +void WINAPI ReleaseActCtx(_Inout_ HANDLE); #endif BOOL WINAPI ReleaseMutex(HANDLE); BOOL WINAPI ReleaseSemaphore(HANDLE,LONG,LPLONG); @@ -2135,42 +2798,98 @@ BOOL WINAPI RemoveDirectoryA(LPCSTR); BOOL WINAPI RemoveDirectoryW(LPCWSTR); #if (_WIN32_WINNT >= 0x0500) -ULONG WINAPI RemoveVectoredExceptionHandler(PVOID); -#endif -#if (_WIN32_WINNT >= 0x0500) -BOOL WINAPI ReplaceFileA(LPCSTR,LPCSTR,LPCSTR,DWORD,LPVOID,LPVOID); -BOOL WINAPI ReplaceFileW(LPCWSTR,LPCWSTR,LPCWSTR,DWORD,LPVOID,LPVOID); -#endif -BOOL WINAPI ReportEventA(HANDLE,WORD,WORD,DWORD,PSID,WORD,DWORD,LPCSTR*,PVOID); -BOOL WINAPI ReportEventW(HANDLE,WORD,WORD,DWORD,PSID,WORD,DWORD,LPCWSTR*,PVOID); +ULONG WINAPI RemoveVectoredExceptionHandler(_In_ PVOID); +#endif +#if (_WIN32_WINNT >= 0x0500) +BOOL WINAPI ReplaceFileA(_In_ LPCSTR, _In_ LPCSTR, _In_opt_ LPCSTR, _In_ DWORD, _Reserved_ LPVOID, _Reserved_ LPVOID); +BOOL WINAPI ReplaceFileW(_In_ LPCWSTR, _In_ LPCWSTR, _In_opt_ LPCWSTR, _In_ DWORD, _Reserved_ LPVOID, _Reserved_ LPVOID); +#endif + +BOOL +WINAPI +ReportEventA( + _In_ HANDLE hEventLog, + _In_ WORD wType, + _In_ WORD wCategory, + _In_ DWORD dwEventID, + _In_opt_ PSID lpUserSid, + _In_ WORD wNumStrings, + _In_ DWORD dwDataSize, + _In_reads_opt_(wNumStrings) LPCSTR *lpStrings, + _In_reads_bytes_opt_(dwDataSize) LPVOID lpRawData); + +BOOL +WINAPI +ReportEventW( + _In_ HANDLE hEventLog, + _In_ WORD wType, + _In_ WORD wCategory, + _In_ DWORD dwEventID, + _In_opt_ PSID lpUserSid, + _In_ WORD wNumStrings, + _In_ DWORD dwDataSize, + _In_reads_opt_(wNumStrings) LPCWSTR *lpStrings, + _In_reads_bytes_opt_(dwDataSize) LPVOID lpRawData); + BOOL WINAPI ResetEvent(HANDLE); UINT WINAPI ResetWriteWatch(LPVOID,SIZE_T); #if (_WIN32_WINNT >= 0x0510) -VOID WINAPI RestoreLastError(DWORD); +VOID WINAPI RestoreLastError(_In_ DWORD); #endif DWORD WINAPI ResumeThread(HANDLE); BOOL WINAPI RevertToSelf(void); -DWORD WINAPI SearchPathA(LPCSTR,LPCSTR,LPCSTR,DWORD,LPSTR,LPSTR*); + +_Success_(return != 0 && return < nBufferLength) +DWORD +WINAPI +SearchPathA( + _In_opt_ LPCSTR lpPath, + _In_ LPCSTR lpFileName, + _In_opt_ LPCSTR lpExtension, + _In_ DWORD nBufferLength, + _Out_writes_to_opt_(nBufferLength, return + 1) LPSTR lpBuffer, + _Out_opt_ LPSTR *lpFilePart); + DWORD WINAPI SearchPathW(LPCWSTR,LPCWSTR,LPCWSTR,DWORD,LPWSTR,LPWSTR*); BOOL WINAPI SetAclInformation(PACL,PVOID,DWORD,ACL_INFORMATION_CLASS); -BOOL WINAPI SetCommBreak(HANDLE); -BOOL WINAPI SetCommConfig(HANDLE,LPCOMMCONFIG,DWORD); -BOOL WINAPI SetCommMask(HANDLE,DWORD); -BOOL WINAPI SetCommState(HANDLE,LPDCB); -BOOL WINAPI SetCommTimeouts(HANDLE,LPCOMMTIMEOUTS); -BOOL WINAPI SetComputerNameA(LPCSTR); -BOOL WINAPI SetComputerNameW(LPCWSTR); -#if (_WIN32_WINNT >= 0x0500) -BOOL WINAPI SetComputerNameExA(COMPUTER_NAME_FORMAT,LPCSTR); +BOOL WINAPI SetCommBreak(_In_ HANDLE); + +BOOL +WINAPI +SetCommConfig( + _In_ HANDLE hCommDev, + _In_reads_bytes_(dwSize) LPCOMMCONFIG lpCC, + _In_ DWORD dwSize); + +BOOL WINAPI SetCommMask(_In_ HANDLE, _In_ DWORD); +BOOL WINAPI SetCommState(_In_ HANDLE, _In_ LPDCB); +BOOL WINAPI SetCommTimeouts(_In_ HANDLE, _In_ LPCOMMTIMEOUTS); +BOOL WINAPI SetComputerNameA(_In_ LPCSTR); +BOOL WINAPI SetComputerNameW(_In_ LPCWSTR); +#if (_WIN32_WINNT >= 0x0500) +BOOL WINAPI SetComputerNameExA(_In_ COMPUTER_NAME_FORMAT, _In_ LPCSTR); BOOL WINAPI SetComputerNameExW(COMPUTER_NAME_FORMAT,LPCWSTR); #endif BOOL WINAPI SetCurrentDirectoryA(LPCSTR); BOOL WINAPI SetCurrentDirectoryW(LPCWSTR); -BOOL WINAPI SetDefaultCommConfigA(LPCSTR,LPCOMMCONFIG,DWORD); -BOOL WINAPI SetDefaultCommConfigW(LPCWSTR,LPCOMMCONFIG,DWORD); + +BOOL +WINAPI +SetDefaultCommConfigA( + _In_ LPCSTR lpszName, + _In_reads_bytes_(dwSize) LPCOMMCONFIG lpCC, + _In_ DWORD dwSize); + +BOOL +WINAPI +SetDefaultCommConfigW( + _In_ LPCWSTR lpszName, + _In_reads_bytes_(dwSize) LPCOMMCONFIG lpCC, + _In_ DWORD dwSize); + #if (_WIN32_WINNT >= 0x0502) -BOOL WINAPI SetDllDirectoryA(LPCSTR); -BOOL WINAPI SetDllDirectoryW(LPCWSTR); +BOOL WINAPI SetDllDirectoryA(_In_opt_ LPCSTR); +BOOL WINAPI SetDllDirectoryW(_In_opt_ LPCWSTR); #endif BOOL WINAPI SetEndOfFile(HANDLE); BOOL WINAPI SetEnvironmentVariableA(LPCSTR,LPCSTR); @@ -2185,39 +2904,56 @@ #endif BOOL WINAPI SetFileAttributesW(LPCWSTR,DWORD); #if (_WIN32_WINNT >= 0x0600) -BOOL WINAPI SetFileBandwidthReservation(HANDLE,DWORD,DWORD,BOOL,LPDWORD,LPDWORD); -BOOL WINAPI SetFileCompletionNotificationModes(HANDLE,UCHAR); +BOOL WINAPI SetFileBandwidthReservation(_In_ HANDLE, _In_ DWORD, _In_ DWORD, _In_ BOOL, _Out_ LPDWORD, _Out_ LPDWORD); +BOOL WINAPI SetFileCompletionNotificationModes(_In_ HANDLE, _In_ UCHAR); #endif DWORD WINAPI SetFilePointer(HANDLE,LONG,PLONG,DWORD); BOOL WINAPI SetFilePointerEx(HANDLE,LARGE_INTEGER,PLARGE_INTEGER,DWORD); -BOOL WINAPI SetFileSecurityA(LPCSTR,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR); +BOOL WINAPI SetFileSecurityA(_In_ LPCSTR, _In_ SECURITY_INFORMATION, _In_ PSECURITY_DESCRIPTOR); BOOL WINAPI SetFileSecurityW(LPCWSTR,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR); #if (_WIN32_WINNT >= 0x0501) -BOOL WINAPI SetFileShortNameA(HANDLE,LPCSTR); -BOOL WINAPI SetFileShortNameW(HANDLE,LPCWSTR); +BOOL WINAPI SetFileShortNameA(_In_ HANDLE, _In_ LPCSTR); +BOOL WINAPI SetFileShortNameW(_In_ HANDLE, _In_ LPCWSTR); #endif BOOL WINAPI SetFileTime(HANDLE,const FILETIME*,const FILETIME*,const FILETIME*); #if (_WIN32_WINNT >= 0x0501) BOOL WINAPI SetFileValidData(HANDLE,LONGLONG); #endif + #if (_WIN32_WINNT >= 0x0502) -BOOL WINAPI SetFirmwareEnvironmentVariableA(LPCSTR,LPCSTR,PVOID,DWORD); -BOOL WINAPI SetFirmwareEnvironmentVariableW(LPCWSTR,LPCWSTR,PVOID,DWORD); -#endif + +BOOL +WINAPI +SetFirmwareEnvironmentVariableA( + _In_ LPCSTR lpName, + _In_ LPCSTR lpGuid, + _In_reads_bytes_opt_(nSize) PVOID pValue, + _In_ DWORD nSize); + +BOOL +WINAPI +SetFirmwareEnvironmentVariableW( + _In_ LPCWSTR lpName, + _In_ LPCWSTR lpGuid, + _In_reads_bytes_opt_(nSize) PVOID pValue, + _In_ DWORD nSize); + +#endif + UINT WINAPI SetHandleCount(UINT); BOOL WINAPI SetHandleInformation(HANDLE,DWORD,DWORD); BOOL WINAPI SetKernelObjectSecurity(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR); void WINAPI SetLastError(DWORD); void WINAPI SetLastErrorEx(DWORD,DWORD); BOOL WINAPI SetLocalTime(const SYSTEMTIME*); -BOOL WINAPI SetMailslotInfo(HANDLE,DWORD); +BOOL WINAPI SetMailslotInfo(_In_ HANDLE, _In_ DWORD); BOOL WINAPI SetNamedPipeHandleState(HANDLE,PDWORD,PDWORD,PDWORD); BOOL WINAPI SetPriorityClass(HANDLE,DWORD); BOOL WINAPI SetPrivateObjectSecurity(SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR *,PGENERIC_MAPPING,HANDLE); -BOOL WINAPI SetProcessAffinityMask(HANDLE,DWORD_PTR); -BOOL WINAPI SetProcessPriorityBoost(HANDLE,BOOL); +BOOL WINAPI SetProcessAffinityMask(_In_ HANDLE, _In_ DWORD_PTR); +BOOL WINAPI SetProcessPriorityBoost(_In_ HANDLE, _In_ BOOL); BOOL WINAPI SetProcessShutdownParameters(DWORD,DWORD); -BOOL WINAPI SetProcessWorkingSetSize(HANDLE,SIZE_T,SIZE_T); +BOOL WINAPI SetProcessWorkingSetSize(_In_ HANDLE, _In_ SIZE_T, _In_ SIZE_T); #if (_WIN32_WINNT >= 0x0600) VOID WINAPI SetSecurityAccessMask(SECURITY_INFORMATION,LPDWORD); #endif @@ -2229,29 +2965,29 @@ BOOL WINAPI SetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR,BOOL,PACL,BOOL); BOOL WINAPI SetStdHandle(DWORD,HANDLE); #define SetSwapAreaSize(w) (w) -BOOL WINAPI SetSystemPowerState(BOOL,BOOL); +BOOL WINAPI SetSystemPowerState(_In_ BOOL, _In_ BOOL); BOOL WINAPI SetSystemTime(const SYSTEMTIME*); -BOOL WINAPI SetSystemTimeAdjustment(DWORD,BOOL); -DWORD WINAPI SetTapeParameters(HANDLE,DWORD,PVOID); -DWORD WINAPI SetTapePosition(HANDLE,DWORD,DWORD,DWORD,DWORD,BOOL); -DWORD_PTR WINAPI SetThreadAffinityMask(HANDLE,DWORD_PTR); +BOOL WINAPI SetSystemTimeAdjustment(_In_ DWORD, _In_ BOOL); +DWORD WINAPI SetTapeParameters(_In_ HANDLE, _In_ DWORD, _In_ PVOID); +DWORD WINAPI SetTapePosition(_In_ HANDLE, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ BOOL); +DWORD_PTR WINAPI SetThreadAffinityMask(_In_ HANDLE, _In_ DWORD_PTR); BOOL WINAPI SetThreadContext(HANDLE,const CONTEXT*); -DWORD WINAPI SetThreadIdealProcessor(HANDLE,DWORD); +DWORD WINAPI SetThreadIdealProcessor(_In_ HANDLE, _In_ DWORD); BOOL WINAPI SetThreadPriority(HANDLE,int); BOOL WINAPI SetThreadPriorityBoost(HANDLE,BOOL); BOOL WINAPI SetThreadToken (PHANDLE,HANDLE); BOOL WINAPI SetTimeZoneInformation(const TIME_ZONE_INFORMATION *); BOOL WINAPI SetTokenInformation(HANDLE,TOKEN_INFORMATION_CLASS,PVOID,DWORD); LPTOP_LEVEL_EXCEPTION_FILTER WINAPI SetUnhandledExceptionFilter(LPTOP_LEVEL_EXCEPTION_FILTER); -BOOL WINAPI SetupComm(HANDLE,DWORD,DWORD); -BOOL WINAPI SetVolumeLabelA(LPCSTR,LPCSTR); -BOOL WINAPI SetVolumeLabelW(LPCWSTR,LPCWSTR); -#if (_WIN32_WINNT >= 0x0500) -BOOL WINAPI SetVolumeMountPointA(LPCSTR,LPCSTR); -BOOL WINAPI SetVolumeMountPointW(LPCWSTR,LPCWSTR); +BOOL WINAPI SetupComm(_In_ HANDLE, _In_ DWORD, _In_ DWORD); +BOOL WINAPI SetVolumeLabelA(_In_opt_ LPCSTR, _In_opt_ LPCSTR); +BOOL WINAPI SetVolumeLabelW(_In_opt_ LPCWSTR, _In_opt_ LPCWSTR); +#if (_WIN32_WINNT >= 0x0500) +BOOL WINAPI SetVolumeMountPointA(_In_ LPCSTR, _In_ LPCSTR); +BOOL WINAPI SetVolumeMountPointW(_In_ LPCWSTR, _In_ LPCWSTR); #endif BOOL WINAPI SetWaitableTimer(HANDLE,const LARGE_INTEGER*,LONG,PTIMERAPCROUTINE,PVOID,BOOL); -DWORD WINAPI SignalObjectAndWait(HANDLE,HANDLE,DWORD,BOOL); +DWORD WINAPI SignalObjectAndWait(_In_ HANDLE, _In_ HANDLE, _In_ DWORD, _In_ BOOL); DWORD WINAPI SizeofResource(HINSTANCE,HRSRC); WINBASEAPI void WINAPI Sleep(DWORD); #if (_WIN32_WINNT >= 0x0600) @@ -2260,7 +2996,7 @@ #endif DWORD WINAPI SleepEx(DWORD,BOOL); DWORD WINAPI SuspendThread(HANDLE); -void WINAPI SwitchToFiber(PVOID); +void WINAPI SwitchToFiber(_In_ PVOID); BOOL WINAPI SwitchToThread(void); BOOL WINAPI SystemTimeToFileTime(const SYSTEMTIME*,LPFILETIME); BOOL WINAPI SystemTimeToTzSpecificLocalTime(CONST TIME_ZONE_INFORMATION*,CONST SYSTEMTIME*,LPSYSTEMTIME); @@ -2271,7 +3007,7 @@ PVOID WINAPI TlsGetValue(DWORD); BOOL WINAPI TlsSetValue(DWORD,PVOID); BOOL WINAPI TransactNamedPipe(HANDLE,PVOID,DWORD,PVOID,DWORD,PDWORD,LPOVERLAPPED); -BOOL WINAPI TransmitCommChar(HANDLE,char); +BOOL WINAPI TransmitCommChar(_In_ HANDLE, _In_ char); BOOL WINAPI TryEnterCriticalSection(LPCRITICAL_SECTION); BOOL WINAPI TzSpecificLocalTimeToSystemTime(LPTIME_ZONE_INFORMATION,LPSYSTEMTIME,LPSYSTEMTIME); LONG WINAPI UnhandledExceptionFilter(LPEXCEPTION_POINTERS); @@ -2281,13 +3017,32 @@ #define UnlockSegment(w) GlobalUnfix((HANDLE)(w)) /* Obsolete: Has no effect. */ BOOL WINAPI UnmapViewOfFile(LPCVOID); #if (_WIN32_WINNT >= 0x0500) -BOOL WINAPI UnregisterWait(HANDLE); +_Must_inspect_result_ BOOL WINAPI UnregisterWait(_In_ HANDLE); BOOL WINAPI UnregisterWaitEx(HANDLE,HANDLE); #endif -BOOL WINAPI UpdateResourceA(HANDLE,LPCSTR,LPCSTR,WORD,PVOID,DWORD); -BOOL WINAPI UpdateResourceW(HANDLE,LPCWSTR,LPCWSTR,WORD,PVOID,DWORD); -BOOL WINAPI VerifyVersionInfoA(LPOSVERSIONINFOEXA,DWORD,DWORDLONG); -BOOL WINAPI VerifyVersionInfoW(LPOSVERSIONINFOEXW,DWORD,DWORDLONG); + +BOOL +WINAPI +UpdateResourceA( + _In_ HANDLE hUpdate, + _In_ LPCSTR lpType, + _In_ LPCSTR lpName, + _In_ WORD wLanguage, + _In_reads_bytes_opt_(cb) LPVOID lpData, + _In_ DWORD cb); + +BOOL +WINAPI +UpdateResourceW( + _In_ HANDLE hUpdate, + _In_ LPCWSTR lpType, + _In_ LPCWSTR lpName, + _In_ WORD wLanguage, + _In_reads_bytes_opt_(cb) LPVOID lpData, + _In_ DWORD cb); + +BOOL WINAPI VerifyVersionInfoA(_Inout_ LPOSVERSIONINFOEXA, _In_ DWORD, _In_ DWORDLONG); +BOOL WINAPI VerifyVersionInfoW(_Inout_ LPOSVERSIONINFOEXW, _In_ DWORD, _In_ DWORDLONG); PVOID WINAPI VirtualAlloc(PVOID,SIZE_T,DWORD,DWORD); PVOID WINAPI VirtualAllocEx(HANDLE,PVOID,SIZE_T,DWORD,DWORD); BOOL WINAPI VirtualFree(PVOID,SIZE_T,DWORD); @@ -2298,46 +3053,97 @@ SIZE_T WINAPI VirtualQuery(LPCVOID,PMEMORY_BASIC_INFORMATION,SIZE_T); SIZE_T WINAPI VirtualQueryEx(HANDLE,LPCVOID,PMEMORY_BASIC_INFORMATION,SIZE_T); BOOL WINAPI VirtualUnlock(PVOID,SIZE_T); -BOOL WINAPI WaitCommEvent(HANDLE,PDWORD,LPOVERLAPPED); +BOOL WINAPI WaitCommEvent(_In_ HANDLE, _Inout_ PDWORD, _Inout_opt_ LPOVERLAPPED); BOOL WINAPI WaitForDebugEvent(LPDEBUG_EVENT,DWORD); -DWORD WINAPI WaitForMultipleObjects(DWORD,const HANDLE*,BOOL,DWORD); + +DWORD +WINAPI +WaitForMultipleObjects( + _In_ DWORD nCount, + _In_reads_(nCount) CONST HANDLE *lpHandles, + _In_ BOOL bWaitAll, + _In_ DWORD dwMilliseconds); + DWORD WINAPI WaitForMultipleObjectsEx(DWORD,const HANDLE*,BOOL,DWORD,BOOL); DWORD WINAPI WaitForSingleObject(HANDLE,DWORD); DWORD WINAPI WaitForSingleObjectEx(HANDLE,DWORD,BOOL); -BOOL WINAPI WaitNamedPipeA(LPCSTR,DWORD); -BOOL WINAPI WaitNamedPipeW(LPCWSTR,DWORD); +BOOL WINAPI WaitNamedPipeA(_In_ LPCSTR, _In_ DWORD); +BOOL WINAPI WaitNamedPipeW(_In_ LPCWSTR, _In_ DWORD); #if (_WIN32_WINNT >= 0x0600) VOID WINAPI WakeConditionVariable(PCONDITION_VARIABLE); VOID WINAPI WakeAllConditionVariable(PCONDITION_VARIABLE); #endif BOOL WINAPI WinLoadTrustProvider(GUID*); BOOL WINAPI Wow64DisableWow64FsRedirection(PVOID*); -BOOLEAN WINAPI Wow64EnableWow64FsRedirection(BOOLEAN); +BOOLEAN WINAPI Wow64EnableWow64FsRedirection(_In_ BOOLEAN); BOOL WINAPI Wow64RevertWow64FsRedirection(PVOID); BOOL WINAPI WriteFile(HANDLE,LPCVOID,DWORD,LPDWORD,LPOVERLAPPED); BOOL WINAPI WriteFileEx(HANDLE,LPCVOID,DWORD,LPOVERLAPPED,LPOVERLAPPED_COMPLETION_ROUTINE); BOOL WINAPI WriteFileGather(HANDLE,FILE_SEGMENT_ELEMENT*,DWORD,LPDWORD,LPOVERLAPPED); -BOOL WINAPI WritePrivateProfileSectionA(LPCSTR,LPCSTR,LPCSTR); -BOOL WINAPI WritePrivateProfileSectionW(LPCWSTR,LPCWSTR,LPCWSTR); -BOOL WINAPI WritePrivateProfileStringA(LPCSTR,LPCSTR,LPCSTR,LPCSTR); -BOOL WINAPI WritePrivateProfileStringW(LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR); -BOOL WINAPI WritePrivateProfileStructA(LPCSTR,LPCSTR,LPVOID,UINT,LPCSTR); -BOOL WINAPI WritePrivateProfileStructW(LPCWSTR,LPCWSTR,LPVOID,UINT,LPCWSTR); +BOOL WINAPI WritePrivateProfileSectionA(_In_opt_ LPCSTR, _In_opt_ LPCSTR, _In_opt_ LPCSTR); +BOOL WINAPI WritePrivateProfileSectionW(_In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR); +BOOL WINAPI WritePrivateProfileStringA(_In_opt_ LPCSTR, _In_opt_ LPCSTR, _In_opt_ LPCSTR, _In_opt_ LPCSTR); +BOOL WINAPI WritePrivateProfileStringW(_In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR); + +BOOL +WINAPI +WritePrivateProfileStructA( + _In_ LPCSTR lpszSection, + _In_ LPCSTR lpszKey, + _In_reads_bytes_opt_(uSizeStruct) LPVOID lpStruct, + _In_ UINT uSizeStruct, + _In_opt_ LPCSTR szFile); + +BOOL +WINAPI +WritePrivateProfileStructW( + _In_ LPCWSTR lpszSection, + _In_ LPCWSTR lpszKey, + _In_reads_bytes_opt_(uSizeStruct) LPVOID lpStruct, + _In_ UINT uSizeStruct, + _In_opt_ LPCWSTR szFile); + BOOL WINAPI WriteProcessMemory(HANDLE,LPVOID,LPCVOID,SIZE_T,SIZE_T*); -BOOL WINAPI WriteProfileSectionA(LPCSTR,LPCSTR); -BOOL WINAPI WriteProfileSectionW(LPCWSTR,LPCWSTR); -BOOL WINAPI WriteProfileStringA(LPCSTR,LPCSTR,LPCSTR); -BOOL WINAPI WriteProfileStringW(LPCWSTR,LPCWSTR,LPCWSTR); -DWORD WINAPI WriteTapemark(HANDLE,DWORD,DWORD,BOOL); +BOOL WINAPI WriteProfileSectionA(_In_ LPCSTR, _In_ LPCSTR); +BOOL WINAPI WriteProfileSectionW(_In_ LPCWSTR, _In_ LPCWSTR); +BOOL WINAPI WriteProfileStringA(_In_opt_ LPCSTR, _In_opt_ LPCSTR, _In_opt_ LPCSTR); +BOOL WINAPI WriteProfileStringW(_In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR); +DWORD WINAPI WriteTapemark(_In_ HANDLE, _In_ DWORD, _In_ DWORD, _In_ BOOL); #define Yield() #if (_WIN32_WINNT >= 0x0501) -BOOL WINAPI ZombifyActCtx(HANDLE); -#endif -#if (_WIN32_WINNT >= 0x0500) -BOOL WINAPI AllocateUserPhysicalPages(HANDLE,PULONG_PTR,PULONG_PTR); -BOOL WINAPI FreeUserPhysicalPages(HANDLE,PULONG_PTR,PULONG_PTR); -BOOL WINAPI MapUserPhysicalPages(PVOID,ULONG_PTR,PULONG_PTR); -BOOL WINAPI MapUserPhysicalPagesScatter(PVOID*,ULONG_PTR,PULONG_PTR); +BOOL WINAPI ZombifyActCtx(_Inout_ HANDLE); +#endif + +#if (_WIN32_WINNT >= 0x0500) + +BOOL +WINAPI +AllocateUserPhysicalPages( + _In_ HANDLE hProcess, + _Inout_ PULONG_PTR NumberOfPages, + _Out_writes_to_(*NumberOfPages, *NumberOfPages) PULONG_PTR PageArray); + +BOOL +WINAPI +FreeUserPhysicalPages( + _In_ HANDLE hProcess, + _Inout_ PULONG_PTR NumberOfPages, + _In_reads_(*NumberOfPages) PULONG_PTR PageArray); + +BOOL +WINAPI +MapUserPhysicalPages( + _In_ PVOID VirtualAddress, + _In_ ULONG_PTR NumberOfPages, + _In_reads_opt_(NumberOfPages) PULONG_PTR PageArray); + +BOOL +WINAPI +MapUserPhysicalPagesScatter( + _In_reads_(NumberOfPages) PVOID *VirtualAddresses, + _In_ ULONG_PTR NumberOfPages, + _In_reads_opt_(NumberOfPages) PULONG_PTR PageArray); + #endif #ifdef UNICODE
12 years, 8 months
1
0
0
0
← Newer
1
...
17
18
19
20
21
22
23
...
56
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Results per page:
10
25
50
100
200