We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
// Copyright (c) FIRST and other WPILib contributors. // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. #include "camerasupport.h" #ifdef _WIN32 #include "Windows.h" #include "delayimp.h" #endif #ifdef _WIN32 static int CheckDelayException(int exception_value) { if (exception_value == VcppException(ERROR_SEVERITY_ERROR, ERROR_MOD_NOT_FOUND) || exception_value == VcppException(ERROR_SEVERITY_ERROR, ERROR_PROC_NOT_FOUND)) { // This example just executes the handler. return EXCEPTION_EXECUTE_HANDLER; } // Don't attempt to handle other errors return EXCEPTION_CONTINUE_SEARCH; } static bool TryDelayLoadAllImports(LPCSTR szDll) { __try { HRESULT hr = __HrLoadAllImportsForDll(szDll); if (FAILED(hr)) { return false; } } __except (CheckDelayException(GetExceptionCode())) { return false; } return true; } namespace glass { bool HasCameraSupport() { bool hasCameraSupport = false; hasCameraSupport = TryDelayLoadAllImports("MF.dll"); if (hasCameraSupport) { hasCameraSupport = TryDelayLoadAllImports("MFPlat.dll"); } if (hasCameraSupport) { hasCameraSupport = TryDelayLoadAllImports("MFReadWrite.dll"); } return hasCameraSupport; } } // namespace glass #else namespace glass { bool HasCameraSupport() { return true; } } // namespace glass #endif
The format it attemts on this file is 100% incorrect, and breaks semantically.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The format it attemts on this file is 100% incorrect, and breaks semantically.
The text was updated successfully, but these errors were encountered: