Skip to content

Commit a57ce2a

Browse files
committed
implement exports
1 parent 40f0e52 commit a57ce2a

20 files changed

Lines changed: 364 additions & 135 deletions

package-lock.json

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "windows-multitool",
33
"private": true,
4-
"version": "0.4.0",
4+
"version": "0.4.1",
55
"type": "module",
66
"repo": "BoringBoredom/Windows-MultiTool",
77
"scripts": {

py/COMPATIBILITY_OPTIONS/__init__.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
CompatibilityOptions = list[str | None]
1414
HiveData = dict[str, CompatibilityOptions]
1515

16-
HKLM_PATH: Final = r"SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"
17-
HKCU_PATH: Final = r"SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"
16+
COMPAT_PATH: Final = (
17+
r"SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"
18+
)
1819

1920
options_map: list[set[str]] = [
2021
{"~"},
@@ -40,10 +41,10 @@
4041
]
4142

4243

43-
def read_hive(hive: int, path: str):
44+
def read_hive(hive: int):
4445
entries: HiveData = {}
4546

46-
with OpenKeyEx(hive, path, 0, KEY_READ | KEY_WOW64_64KEY) as key:
47+
with OpenKeyEx(hive, COMPAT_PATH, 0, KEY_READ | KEY_WOW64_64KEY) as key:
4748
for i in range(QueryInfoKey(key)[1]):
4849
name, value, type = EnumValue(key, i)
4950

@@ -64,6 +65,6 @@ def read_hive(hive: int, path: str):
6465

6566
def get_compatibility_options():
6667
return {
67-
"HKLM": read_hive(HKEY_LOCAL_MACHINE, HKLM_PATH),
68-
"HKCU": read_hive(HKEY_CURRENT_USER, HKCU_PATH),
68+
"HKLM": read_hive(HKEY_LOCAL_MACHINE),
69+
"HKCU": read_hive(HKEY_CURRENT_USER),
6970
}

py/DISPLAY_INFO/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,6 @@ def get_display_info():
457457
byref(num_path_array_elements),
458458
byref(num_mode_info_array_elements),
459459
)
460-
461460
if result != 0:
462461
raise WinError(result)
463462

src/COMPATIBILITY_OPTIONS/AddPath.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
type CompatibilityOptions,
77
type CompatibilityOptionsData,
88
} from ".";
9-
import { REGISTRY_DATA_TYPES } from "../constants";
9+
import { REGISTRY_DATA_TYPES } from "../shared";
1010
import s from "./index.module.css";
1111

1212
export default function AddPath({

src/COMPATIBILITY_OPTIONS/Options.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Checkbox, Select, Table } from "@mantine/core";
22
import { useState } from "react";
33
import { COMPAT_PATH, type CompatibilityOptions } from ".";
4-
import { REGISTRY_DATA_TYPES } from "../constants";
4+
import { REGISTRY_DATA_TYPES } from "../shared";
55

66
export default function Options({
77
name,

src/IFEO/CpuPriority.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Select } from "@mantine/core";
22
import { useState } from "react";
33
import type { IfeoDataValue } from ".";
4-
import { REGISTRY_DATA_TYPES } from "../constants";
4+
import { REGISTRY_DATA_TYPES } from "../shared";
55

66
export default function CpuPriorityField({ data }: { data: IfeoDataValue }) {
77
const [value, setValue] = useState<string | null>(

src/IFEO/IoPriority.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Select } from "@mantine/core";
22
import { useState } from "react";
33
import type { IfeoDataValue } from ".";
4-
import { REGISTRY_DATA_TYPES } from "../constants";
4+
import { REGISTRY_DATA_TYPES } from "../shared";
55

66
export default function IoPriorityField({ data }: { data: IfeoDataValue }) {
77
const [value, setValue] = useState<string | null>(

src/IFEO/PagePriority.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Select } from "@mantine/core";
22
import { useState } from "react";
33
import type { IfeoDataValue } from ".";
4-
import { REGISTRY_DATA_TYPES } from "../constants";
4+
import { REGISTRY_DATA_TYPES } from "../shared";
55

66
export default function PagePriorityField({ data }: { data: IfeoDataValue }) {
77
const [value, setValue] = useState<string | null>(

src/IFEO/index.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { ActionIcon, Group, Menu, Table } from "@mantine/core";
22
import { IconChevronDown, IconMinus } from "@tabler/icons-react";
33
import { useEffect, useState } from "react";
44
import s from "../App.module.css";
5+
import { formatRegValue } from "../shared";
56
import AddNewProcess from "./AddProcess";
67
import CpuPriorityField from "./CpuPriority";
78
import IoPriorityField from "./IoPriority";
@@ -19,14 +20,6 @@ export type IfeoData = Map<string, IfeoDataValue>;
1920
export const IFEO_PATH =
2021
"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options";
2122

22-
function formatRegValue(name: string, value: number | null): string {
23-
if (value !== null) {
24-
return `"${name}"=dword:${value.toString(16).padStart(8, "0")}\n`;
25-
} else {
26-
return `"${name}"=-\n`;
27-
}
28-
}
29-
3023
function getExportData(ifeoData: IfeoData, isReg: boolean) {
3124
let content = "";
3225

0 commit comments

Comments
 (0)