Page 77 - Advantech WP-5530
P. 77
FILE_SHARE_WRITE, NULL,OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
if (m_hFile == INVALID_HANDLE_VALUE)
{
AfxMessageBox("Unable to open Watch Dog Driver!");
return;
}
// Close Watch Dog
bRet = DeviceIoControl(hFile, ADV_COLSE_CTL_CODE CTL_CODE, &uTime, sizeof(uTime), NULL, 0,
&ulBytesReturned, NULL);
if (bRet == FALSE || ulBytesReturned != 1)
{
AfxMessageBox("Failed to write to Watch Dog driver");
CloseHandle(hFile);
return;
}
CloseHandle(hFile);
}
70