29.05.2014 Views

TPMC821-SW-65 - powerBridge Computer Vertriebs GmbH

TPMC821-SW-65 - powerBridge Computer Vertriebs GmbH

TPMC821-SW-65 - powerBridge Computer Vertriebs GmbH

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

DWORD dwCreationDistribution<br />

Specifies which action to take on files that exist, and which action to take when files do not<br />

exist. <strong>TPMC821</strong> devices must be always opened OPEN_EXISTING.<br />

DWORD dwFlagsAndAttributes<br />

Specifies the file attributes and flags for the file. This value must be set to 0 (no overlapped I/O).<br />

HANDLE hTemplateFile<br />

This value must be NULL for <strong>TPMC821</strong> devices.<br />

Return Value<br />

If the function succeeds, the return value is an open handle to the specified <strong>TPMC821</strong> device. If the<br />

function fails, the return value is INVALID_HANDLE_VALUE. To get extended error information, call<br />

GetLastError.<br />

Example<br />

HANDLE<br />

hDevice;<br />

hDevice = CreateFile(<br />

“\\\\.\\<strong>TPMC821</strong>_1”,<br />

GENERIC_READ | GENERIC_WRITE,<br />

0,<br />

NULL,<br />

// no security attrs<br />

OPEN_EXISTING, // <strong>TPMC821</strong> device always open existing<br />

0, // no overlapped I/O<br />

NULL<br />

);<br />

if (hDevice == INVALID_HANDLE_VALUE) {<br />

ErrorHandler( "Could not open device" ); // process error<br />

}<br />

See Also<br />

CloseHandle(), Win32 documentation CreateFile()<br />

<strong>TPMC821</strong>-<strong>SW</strong>-<strong>65</strong> – Windows WDM Device Driver Page 8 of 27

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!