mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 05:32:55 +00:00
[the_other_devmgmt] Convert the bootstrap app back to C.
svn path=/trunk/; revision=69607
This commit is contained in:
parent
2a8b2a3a1b
commit
1cfc6d4fb5
4 changed files with 20 additions and 103 deletions
|
@ -1,11 +1,7 @@
|
||||||
|
|
||||||
set_cpp(WITH_RTTI WITH_RUNTIME)
|
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/dll/devmgr)
|
||||||
|
|
||||||
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/dll)
|
add_executable(devmgmt devmgmt.c devmgmt.rc)
|
||||||
|
|
||||||
list(APPEND SOURCE devmgmt.cpp)
|
|
||||||
|
|
||||||
add_executable(devmgmt ${SOURCE} devmgmt.rc)
|
|
||||||
set_module_type(devmgmt win32gui UNICODE)
|
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)
|
add_cd_file(TARGET devmgmt DESTINATION reactos/system32 FOR all)
|
||||||
|
|
|
@ -2,89 +2,31 @@
|
||||||
* PROJECT: ReactOS Device Managment
|
* PROJECT: ReactOS Device Managment
|
||||||
* LICENSE: GPL - See COPYING in the top level directory
|
* LICENSE: GPL - See COPYING in the top level directory
|
||||||
* FILE: base/applications/mscutils/devmgmt/devmgmt.c
|
* FILE: base/applications/mscutils/devmgmt/devmgmt.c
|
||||||
* PURPOSE: Program HQ
|
* PURPOSE: Bootstrap for the device manager
|
||||||
* COPYRIGHT: Copyright 2006 Ged Murphy <gedmurphy@gmail.com>
|
* 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>
|
#include <cfgmgr32.h>
|
||||||
|
#include <devmgr.h>
|
||||||
HINSTANCE hInstance;
|
|
||||||
HANDLE ProcessHeap;
|
|
||||||
HANDLE hMutex;
|
|
||||||
|
|
||||||
int WINAPI
|
int WINAPI
|
||||||
_tWinMain(HINSTANCE hThisInstance,
|
wWinMain(HINSTANCE hThisInstance,
|
||||||
HINSTANCE hPrevInstance,
|
HINSTANCE hPrevInstance,
|
||||||
LPTSTR lpCmdLine,
|
LPWSTR lpCmdLine,
|
||||||
int nCmdShow)
|
int nCmdShow)
|
||||||
{
|
{
|
||||||
LPTSTR lpAppName;
|
if (!DeviceManager_ExecuteW(NULL,
|
||||||
HWND hMainWnd;
|
hThisInstance,
|
||||||
MSG Msg;
|
NULL,
|
||||||
int Ret = 1;
|
nCmdShow))
|
||||||
INITCOMMONCONTROLSEX icex;
|
|
||||||
|
|
||||||
hMutex = CreateMutex(NULL, TRUE, _T("devmgmt_mutex"));
|
|
||||||
if (hMutex == NULL || GetLastError() == ERROR_ALREADY_EXISTS)
|
|
||||||
{
|
{
|
||||||
if (hMutex)
|
return GetLastError();
|
||||||
{
|
|
||||||
CloseHandle(hMutex);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
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())
|
|
||||||
{
|
|
||||||
hMainWnd = CreateMainWindow(lpAppName,
|
|
||||||
nCmdShow);
|
|
||||||
if (hMainWnd != NULL)
|
|
||||||
{
|
|
||||||
/* pump the message queue */
|
|
||||||
while( GetMessage( &Msg, NULL, 0, 0 ) )
|
|
||||||
{
|
|
||||||
TranslateMessage(&Msg);
|
|
||||||
DispatchMessage(&Msg);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Ret = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
UninitMainWindowImpl();
|
|
||||||
}
|
|
||||||
|
|
||||||
LocalFree((HLOCAL)lpAppName);
|
|
||||||
CloseHandle(hMutex);
|
|
||||||
return Ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
#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;
|
|
||||||
}
|
|
|
@ -1 +0,0 @@
|
||||||
#pragma once
|
|
Loading…
Add table
Add a link
Reference in a new issue