Windows product policy contains a lot of useful settings.
By modifying the Kernel-NativeVHDBoot native VHD boot can be enabled on all unsupported versions of Windows 7.
Native VHD Boot on unsupported versions of Windows 7
By modifying Kernel-WindowsMaxMemAllowedx86 and Kernel-MaxPhysicalPage to 16384 (from a lower value), 32-bit versions of Windows 7 can potentially access more than 4GB of RAM.
http://reboot.pro/to...iewer/?p=201389
http://reboot.pro/to...e-4#entry201388
Erwan built an excellent tool called ProductPolicy Viewer to view and Edit the Product Policy Settings. The discussion was first started here - http://reboot.pro/to...4dos/?p=193727
A few facts about the Windows Product and License Policy
- The settings are stored in the registry at SYSTEM\CurrentControlSet\Control\ProductOptions\ProductPolicy
- The structure of these settings is not straightforward and is described at http://reboot.pro/to...dows-licensing/
- The product policy registry key cannot be modified on an online registry hive. The kernel protects it from modification.
- Erwan's tool - modifies the product policy on an offline registry hive. The modified values have effect only on the first boot after the modification. On subsequent reboots, the modified settings are lost as the software protection policy restores them from Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\ SoftwareProtectionPlatform\tokens.dat .
One option to overcome this problem is to disable the Software Protection Service(sppsvc). However, this causes problems with Windows Activation, installation/uninstallation of Windows Updates etc
Other options include running Windows 7 in RAM, so the changes are not persisted. However not everybody runs Windows from RAM, so it's not feasible - http://reboot.pro/to...e-4#entry201388
Since Grub4dos can edit files using cat, I started investigating and did hex diff between an unmodified system hive and a system hive modified with ProductPolicy Viewer. I found the corresponding hex entries for Kernel-WindowsMaxMemAllowedx86, Kernel-MaxPhysicalPage and Kernel-NativeVHDBoot.
Using my rudimentary grub4dos skills I came up with the below working Grub4Dos entries
PAE Patch for Windows 7 Starter - Alternative to patching the kernel
title Windows 7 32 Bit Starter with PAE Patch find --set-root --ignore-floppies --ignore-cd /Windows/System32/config/system cat --locate=\x77\x00\x65\x00\x64\x00\x78\x00\x38\x00\x36\x00\x00\x08 --number=1 --replace=\x77\x00\x65\x00\x64\x00\x78\x00\x38\x00\x36\x00\x00\x40 /Windows/System32/config/system echo Patched Kernel-WindowsMaxMemAllowedx86 cat --locate=\x61\x00\x6C\x00\x50\x00\x61\x00\x67\x00\x65\x00\x00\x10 --number=1 --replace=\x61\x00\x6C\x00\x50\x00\x61\x00\x67\x00\x65\x00\x00\x40 /Windows/System32/config/system echo Patched Kernel-MaxPhysicalPage find --set-root --ignore-floppies --ignore-cd /bootmgr chainloader /bootmgr pause Press any key....
Find string will be different for other versions of Windows, the last hex value will change from \x08 to \x10.
\x08 corresponds to 2GB (0x0800 -> 16*16*8 ) while \x10 corresponds to 4GB (0x1000-> 16*16*16)
Native VHD Patch for WIndows 7 Starter in a VHD
title Windows 7 Starter with NativeVHD Patch find --set-root --ignore-floppies /Win7Starter.vhd map /Win7Starter.vhd (hd0) map --hook cat --locate=\x56\x00\x48\x00\x44\x00\x42\x00\x6F\x00\x6F\x00\x74\x00\x00 --number=1 --replace=\x56\x00\x48\x00\x44\x00\x42\x00\x6F\x00\x6F\x00\x74\x00\x01 (hd0,0)/Windows/System32/config/system echo Patched Kernel-NativeVHDBoot map --unhook map --unmap=0:0xff find --set-root --ignore-floppies --ignore-cd /bootmgr chainloader /bootmgr
Native VHD and PAE patch Windows 7 Starter 32 bit in a VHD
title Windows 7 Starter 32-bit with NativeVHD and PAEPatch find --set-root --ignore-floppies /Win7Starter.vhd map /Win7Starter.vhd (hd0) map --hook cat --locate=\x56\x00\x48\x00\x44\x00\x42\x00\x6F\x00\x6F\x00\x74\x00\x00 --number=1 --replace=\x56\x00\x48\x00\x44\x00\x42\x00\x6F\x00\x6F\x00\x74\x00\x01 (hd0,0)/Windows/System32/config/system echo Patched Kernel-NativeVHDBoot cat --locate=\x77\x00\x65\x00\x64\x00\x78\x00\x38\x00\x36\x00\x00\x08 --number=1 --replace=\x77\x00\x65\x00\x64\x00\x78\x00\x38\x00\x36\x00\x00\x40 (hd0,0)/Windows/System32/config/system echo Patched Kernel-WindowsMaxMemAllowedx86 cat --locate=\x61\x00\x6C\x00\x50\x00\x61\x00\x67\x00\x65\x00\x00\x10 --number=1 --replace=\x61\x00\x6C\x00\x50\x00\x61\x00\x67\x00\x65\x00\x00\x40 (hd0,0)/Windows/System32/config/system echo Patched Kernel-MaxPhysicalPage map --unhook map --unmap=0:0xff find --set-root --ignore-floppies --ignore-cd /bootmgr chainloader /bootmgr
The menu entries are not entirely bug-free. Since the cat command is restricted to 16 chars, I cannot be very specific about the entries I am finding and replacing.
The entries patching the files inside VHD are very slow and don't work if the files are already patched - the menu just gets stuck. I am not sure why this is happening.
Let me know your thoughts, feedbacks, suggestions etc.