测试程序:
  代码:
void CTestMyFirstDriverDlg::OnBnClickedButton1()
{
// TODO: Add your control notification handler code here
HANDLE hFile = CreateFile(L"\??\FirstDevice",
FILE_ALL_ACCESS,
FILE_SHARE_READ,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,NULL);
if (hFile == INVALID_HANDLE_VALUE)
{
int err = GetLastError();
MessageBox(L"Create File error!");
}
CloseHandle(hFile);
return;
}