Skip to content

Latest commit

 

History

History
118 lines (89 loc) · 3.02 KB

nf-winbase-opencommport.md

File metadata and controls

118 lines (89 loc) · 3.02 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:winbase.OpenCommPort
OpenCommPort function (winbase.h)
Attempts to open a communication device.
FILE_FLAG_OVERLAPPED
OpenCommPort
OpenCommPort function
base.opencommport
winbase/OpenCommPort
base\opencommport.htm
base
D96D3F6D-2158-4E6A-84A8-DC3BAE9624FA
12/05/2018
FILE_FLAG_OVERLAPPED, OpenCommPort, OpenCommPort function, base.opencommport, winbase/OpenCommPort
winbase.h
Windows.h
Windows
Windows 10, version 1709 [desktop apps \| UWP apps]
Windows Server, version 1709 [desktop apps \| UWP apps]
OneCore.lib
KernelBase.dll
Windows
19H1
OpenCommPort
winbase/OpenCommPort
c++
APIRef
kbSyntax
DllExport
KernelBase.dll
API-MS-Win-Core-comm-l1-1-0.dll
API-MS-Win-DownLevel-Kernel32-l1-1-0.dll
MinKernelBase.dll
OpenCommPort

OpenCommPort function

-description

Attempts to open a communication device.

-parameters

-param uPortNumber [in]

A one-based port number for the communication device to open.

-param dwDesiredAccess [in]

The requested access to the device.

For more information about requested access, see CreateFile and Creating and Opening Files.

-param dwFlagsAndAttributes [in]

The requested flags and attributes to the device.

Note  

For this function, only values of FILE_FLAG_OVERLAPPED or 0x0 are expected for this parameter.

 
Value Meaning
FILE_FLAG_OVERLAPPED
0x40000000
The file or device is being opened or created for asynchronous I/O.

-returns

If the function succeeds, the function returns a valid HANDLE. Use CloseHandle to close that handle.

If an error occurs, the function returns INVALID_HANDLE_VALUE.

-remarks

The uPortNumber parameter accepts one-based values. A value of 1 for uPortNumber causes this function to attempt to open COM1.

To support UWP, link against WindowsApp.lib.

-see-also

CloseHandle

CreateFile

Creating and Opening Files