--- trunk/reactos/subsys/system/vmwinst/vmware.inf 2005-08-14 20:22:37 UTC (rev 17388)
+++ trunk/reactos/subsys/system/vmwinst/vmware.inf 2005-08-14 21:44:58 UTC (rev 17389)
@@ -0,0 +1,32 @@
+[version]
+signature="$CHICAGO$"
+
+[DefaultInstall]
+AddReg=VMXReg
+
+[VMXReg]
+HKLM,"SYSTEM\CurrentControlSet\Services\vmx_svga","ErrorControl",0x00010001,0x00000000
+HKLM,"SYSTEM\CurrentControlSet\Services\vmx_svga","Group",0x00000000,"Video"
+HKLM,"SYSTEM\CurrentControlSet\Services\vmx_svga","ImagePath",0x00020000,"system32\drivers\vmx_svga.sys"
+HKLM,"SYSTEM\CurrentControlSet\Services\vmx_svga","Start",0x00010001,0x00000004
+HKLM,"SYSTEM\CurrentControlSet\Services\vmx_svga","Type",0x00010001,0x00000001
+HKLM,"SYSTEM\CurrentControlSet\Services\vmx_svga\Device0","InstalledDisplayDrivers",0x00010000,"vmx_fb"
+HKLM,"SYSTEM\CurrentControlSet\Services\vmx_svga\Device0","Resolution.0",0x00000001,36,34,30,78,34,38,30,00
+HKLM,"SYSTEM\CurrentControlSet\Services\vmx_svga\Device0","Resolution.1",0x00000001,38,30,30,78,36,30,30,00
+HKLM,"SYSTEM\CurrentControlSet\Services\vmx_svga\Device0","Resolution.2",0x00000001,31,30,32,34,78,37,36,38,00
+HKLM,"SYSTEM\CurrentControlSet\Services\vmx_svga\Device0","Resolution.3",0x00000001,31,31,35,32,78,38,36,34,00
+HKLM,"SYSTEM\CurrentControlSet\Services\vmx_svga\Device0","Resolution.4",0x00000001,31,32,38,30,78,39,36,30,00
+HKLM,"SYSTEM\CurrentControlSet\Services\vmx_svga\Device0","Resolution.5",0x00000001,31,32,38,30,78,31,30,32,34,00
+HKLM,"SYSTEM\CurrentControlSet\Services\vmx_svga\Device0","Resolution.6",0x00000001,31,34,30,30,78,31,30,35,30,00
+HKLM,"SYSTEM\CurrentControlSet\Services\vmx_svga\Device0","Resolution.7",0x00000001,31,36,30,30,78,31,32,30,30,00
+HKLM,"SYSTEM\CurrentControlSet\Services\vmx_svga\Device0","Resolution.8",0x00000001,31,37,39,32,78,31,33,34,34,00
+HKLM,"SYSTEM\CurrentControlSet\Services\vmx_svga\Device0","Resolution.9",0x00000001,31,38,35,36,78,31,33,39,32,00
+HKLM,"SYSTEM\CurrentControlSet\Services\vmx_svga\Device0","Resolution.10",0x00000001,31,39,32,30,78,31,34,34,30,00
+HKLM,"SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Services\vmx_svga\Device0","DefaultSettings.Flags",0x00010001,0
+HKLM,"SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Services\vmx_svga\Device0","DefaultSettings.VRefresh",0x00010001,85
+HKLM,"SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Services\vmx_svga\Device0","DefaultSettings.XPanning",0x00010001,0
+HKLM,"SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Services\vmx_svga\Device0","DefaultSettings.YPanning",0x00010001,0
+HKLM,"SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Services\vmx_svga\Device0","DefaultSettings.BitsPerPel",0x00010001,16
+HKLM,"SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Services\vmx_svga\Device0","DefaultSettings.XResolution",0x00010001,800
+HKLM,"SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Services\vmx_svga\Device0","DefaultSettings.YResolution",0x00010001,600
+HKLM,"SYSTEM\CurrentControlSet\Enum\PCI\VEN_15AD&DEV_0405&SUBSYS_040515AD&REV_00\0000","Service",0x00000000,"vmx_svga"
Property changes on: trunk/reactos/subsys/system/vmwinst/vmware.inf
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:eol-style
+ CRLF
--- trunk/reactos/subsys/system/vmwinst/vmwinst.c 2005-08-14 20:22:37 UTC (rev 17388)
+++ trunk/reactos/subsys/system/vmwinst/vmwinst.c 2005-08-14 21:44:58 UTC (rev 17389)
@@ -32,6 +32,10 @@
#include <string.h>
#include "vmwinst.h"
+extern VOID CALLBACK InstallHinfSectionW(HWND hwnd, HINSTANCE ModuleHandle,
+ PCWSTR CmdLineBuffer, INT nCmdShow);
+
+
HINSTANCE hAppInstance;
BOOL StartVMwConfigWizard, DriverFilesFound, ActivateVBE = FALSE, UninstallDriver = FALSE;
@@ -382,6 +386,79 @@
return TRUE;
}
+/* Make sure the required registry entries are present */
+BOOL
+AddVmwareRegistryEntries()
+{
+ HRSRC VmwareInfResource;
+ HGLOBAL VmwareInfMem;
+ PVOID VmwareInfLocked;
+ DWORD Size;
+ WCHAR TempPath[MAX_PATH];
+ WCHAR BufferSize;
+ WCHAR TempFileName[MAX_PATH];
+ HANDLE TempFile;
+ DWORD Written;
+ WCHAR CmdLine[19 + MAX_PATH];
+
+ VmwareInfResource = FindResourceW(hAppInstance,
+ MAKEINTRESOURCE(IDR_VMWARE_INF),
+ L"RT_INF");
+ if (NULL == VmwareInfResource)
+ {
+ return FALSE;
+ }
+ Size = SizeofResource(hAppInstance, VmwareInfResource);
+ if (0 == Size)
+ {
+ return FALSE;
+ }
+ VmwareInfMem = LoadResource(hAppInstance, VmwareInfResource);
+ if (NULL == VmwareInfMem)
+ {
+ return FALSE;
+ }
+ VmwareInfLocked = LockResource(VmwareInfMem);
+ if (NULL == VmwareInfLocked)
+ {
+ return FALSE;
+ }
+
+ BufferSize = GetTempPathW(sizeof(TempPath) / sizeof(TempPath[0]), TempPath);
+ if (0 == BufferSize || sizeof(TempPath) / sizeof(TempPath[0]) < BufferSize)
+ {
+ return FALSE;
+ }
+ if (0 == GetTempFileNameW(TempPath, L"vmx", 0, TempFileName))
+ {
+ return FALSE;
+ }
+
+ TempFile = CreateFileW(TempFileName, GENERIC_WRITE, 0, NULL, OPEN_EXISTING,
+ FILE_ATTRIBUTE_NORMAL, NULL);
+ if (INVALID_HANDLE_VALUE == TempFile)
+ {
+ DeleteFile(TempFileName);
+ return FALSE;
+ }
+ if (! WriteFile(TempFile, VmwareInfLocked, Size, &Written, NULL) ||
+ Written != Size)
+ {
+ CloseHandle(TempFile);
+ DeleteFile(TempFileName);
+ return FALSE;
+ }
+ CloseHandle(TempFile);
+
+ wcscpy(CmdLine, L"DefaultInstall 128 ");
+ wcscat(CmdLine, TempFileName);
+ InstallHinfSectionW(NULL, NULL, CmdLine, 0);
+
+ DeleteFile(TempFileName);
+
+ return TRUE;
+}
+
/* GUI */
void
@@ -426,8 +503,16 @@
{
if(DriverFilesFound)
{
- if(!EnableVmwareDriver(FALSE, FALSE, TRUE))
+ if(!AddVmwareRegistryEntries())
{
+ WCHAR Msg[1024];
+ LoadString(hAppInstance, IDS_FAILEDTOADDREGENTRIES, Msg, sizeof(Msg) / sizeof(WCHAR));
+ MessageBox(GetParent(hwndDlg), Msg, NULL, MB_ICONWARNING);
+ SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_WELCOMEPAGE);
+ return TRUE;
+ }
+ if(!EnableVmwareDriver(TRUE, TRUE, TRUE))
+ {
WCHAR Msg[1024];
LoadString(hAppInstance, IDS_FAILEDTOACTIVATEDRIVER, Msg, sizeof(Msg) / sizeof(WCHAR));
@@ -548,7 +633,7 @@
if(AbortInstall != 0) goto done;
PostMessage(hInstallationNotifyWnd, WM_INSTSTATUSUPDATE, IDS_ENABLINGDRIVER, 0);
- if(!EnableVmwareDriver(FALSE, FALSE, TRUE))
+ if(!EnableVmwareDriver(TRUE, TRUE, TRUE))
{
PostMessage(hInstallationNotifyWnd, WM_INSTABORT, IDS_FAILEDTOACTIVATEDRIVER, 0);
goto cleanup;
@@ -935,7 +1020,7 @@
}
ActivateVBE = (SendDlgItemMessage(hwndDlg, IDC_VBE, BM_GETCHECK, 0, 0) == BST_CHECKED);
if(!EnableVmwareDriver(ActivateVBE,
- !ActivateVBE,
+ TRUE,
FALSE))
{
WCHAR Msg[1024];
@@ -984,7 +1069,7 @@
if(UninstallDriver)
{
if(!EnableVmwareDriver(ActivateVBE,
- !ActivateVBE,
+ TRUE,
FALSE))
{
WCHAR Msg[1024];