diff options
author | José Fonseca <jfonseca@vmware.com> | 2014-09-25 21:28:59 +0100 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2014-10-02 16:45:40 +0100 |
commit | e5b9a9192d9095f8acf68d7e86c7b1ed5f1b8577 (patch) | |
tree | e2214e09174df75b1a2b06dedb3c75d944332536 /inject | |
parent | 96f2963fb24ff0c73d6e1b2b2a60509facfa9275 (diff) |
inject: Bundle devcon utility code.
Diffstat (limited to 'inject')
-rw-r--r-- | inject/CMakeLists.txt | 7 | ||||
-rw-r--r-- | inject/injector.cpp | 8 |
2 files changed, 8 insertions, 7 deletions
diff --git a/inject/CMakeLists.txt b/inject/CMakeLists.txt index 43749e15..4391513c 100644 --- a/inject/CMakeLists.txt +++ b/inject/CMakeLists.txt @@ -1,5 +1,7 @@ set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) +include_directories (${CMAKE_SOURCE_DIR}/thirdparty/devcon) + add_library (injectee MODULE injectee.cpp ) @@ -15,6 +17,9 @@ add_executable (injector set_target_properties (injector PROPERTIES OUTPUT_NAME inject ) -target_link_libraries (injector psapi) +target_link_libraries (injector + devcon + psapi +) install (TARGETS injector RUNTIME DESTINATION bin) install_pdb (injector DESTINATION bin) diff --git a/inject/injector.cpp b/inject/injector.cpp index 96fbb683..cb925f8d 100644 --- a/inject/injector.cpp +++ b/inject/injector.cpp @@ -54,6 +54,7 @@ #endif #include "os_version.hpp" +#include "devcon.hpp" #include "inject.h" @@ -199,12 +200,7 @@ restartDwmComposition(HANDLE hProcess) // Windows 8 ignores DwmEnableComposition(DWM_EC_DISABLECOMPOSITION). // It is however possible to force DWM to restart by restarting the // display device via the devcon utility - // http://code.msdn.microsoft.com/windowshardware/DevCon-Sample-4e95d71c - // http://support.microsoft.com/kb/311272 - // TODO: - if (system("devcon restart =DISPLAY") == -1) { - fprintf(stderr, "run `devcon restart =DISPLAY` now\n"); - } + devconRestart(DEVCON_CLASS_DISPLAY); } else { BOOL fEnabled = FALSE; |