-set_cpp(WITH_RTTI WITH_RUNTIME)
+include_directories(${REACTOS_SOURCE_DIR}/include/reactos/dll/devmgr)
-include_directories(${REACTOS_SOURCE_DIR}/include/reactos/dll)
-
-list(APPEND SOURCE devmgmt.cpp)
-
-add_executable(devmgmt ${SOURCE} devmgmt.rc)
+add_executable(devmgmt devmgmt.c devmgmt.rc)
set_module_type(devmgmt win32gui UNICODE)
-add_importlibs(devmgmt setupapi gdi32 user32 comctl32 advapi32 devmgr msvcrt kernel32)
+add_importlibs(devmgmt devmgr msvcrt kernel32)
add_cd_file(TARGET devmgmt DESTINATION reactos/system32 FOR all)
* PROJECT: ReactOS Device Managment
* LICENSE: GPL - See COPYING in the top level directory
* FILE: base/applications/mscutils/devmgmt/devmgmt.c
- * PURPOSE: Program HQ
+ * PURPOSE: Bootstrap for the device manager
* COPYRIGHT: Copyright 2006 Ged Murphy <gedmurphy@gmail.com>
- *
*/
-#include "precomp.h"
+#define WIN32_NO_STATUS
+#include <windef.h>
+#include <winbase.h>
+#include <winreg.h>
-#include <winnls.h>
-
-HINSTANCE hInstance;
-HANDLE ProcessHeap;
-HANDLE hMutex;
+#include <cfgmgr32.h>
+#include <devmgr.h>
int WINAPI
-_tWinMain(HINSTANCE hThisInstance,
- HINSTANCE hPrevInstance,
- LPTSTR lpCmdLine,
- int nCmdShow)
+wWinMain(HINSTANCE hThisInstance,
+ HINSTANCE hPrevInstance,
+ LPWSTR lpCmdLine,
+ int nCmdShow)
{
- LPTSTR lpAppName;
- HWND hMainWnd;
- MSG Msg;
- int Ret = 1;
- INITCOMMONCONTROLSEX icex;
-
- hMutex = CreateMutex(NULL, TRUE, _T("devmgmt_mutex"));
- if (hMutex == NULL || GetLastError() == ERROR_ALREADY_EXISTS)
- {
- if (hMutex)
- {
- CloseHandle(hMutex);
- }
- return 0;
- }
-
- switch (GetUserDefaultUILanguage())
- {
- case MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT):
- SetProcessDefaultLayout(LAYOUT_RTL);
- break;
-
- default:
- break;
- }
-
- hInstance = hThisInstance;
- ProcessHeap = GetProcessHeap();
-
- icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
- icex.dwICC = ICC_BAR_CLASSES | ICC_COOL_CLASSES;
- InitCommonControlsEx(&icex);
-
- if (!AllocAndLoadString(&lpAppName,
- hInstance,
- IDS_APPNAME))
- {
- return 1;
- }
-
- if (InitMainWindowImpl())
+ if (!DeviceManager_ExecuteW(NULL,
+ hThisInstance,
+ NULL,
+ nCmdShow))
{
- hMainWnd = CreateMainWindow(lpAppName,
- nCmdShow);
- if (hMainWnd != NULL)
- {
- /* pump the message queue */
- while( GetMessage( &Msg, NULL, 0, 0 ) )
- {
- TranslateMessage(&Msg);
- DispatchMessage(&Msg);
-
- }
-
- Ret = 0;
- }
-
- UninitMainWindowImpl();
+ return GetLastError();
}
- LocalFree((HLOCAL)lpAppName);
- CloseHandle(hMutex);
- return Ret;
+ return 0;
}
-
-
-
+++ /dev/null
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <cfgmgr32.h>
-#include <devmgr/devmgr.h>
-
-int WINAPI
-wWinMain(HINSTANCE hThisInstance,
- HINSTANCE hPrevInstance,
- LPWSTR lpCmdLine,
- int nCmdShow)
-{
- if (!DeviceManager_ExecuteW(NULL,
- hThisInstance,
- NULL,
- nCmdShow))
- {
- return GetLastError();
- }
- return 0;
-}