Skip to content

RegQueryInfoKeyW,RegEnumKeyExW,RegEnumValueW missing from advapi32.def #18918

@remdragon

Description

@remdragon

Describe the feature

I'm getting link failures when trying to call C.RegQueryInfoKey, C.RegEnumKeyEx, and C.RegEnumValue

Use Case

need this to enumerate keys and values of a registry key

Proposed Solution

add RegQueryInfoKeyW, RegEnumKeyExW and RegEnumValueW to thirdparty/tcc/lib/advapi32.def

I manually added these 3 entries to my local copy and was able to write a test utility that successfully enumerates keys and values

Other Information

Here's the definitions that I made for them, but I don't know how to type PFILETIME:

fn C.RegQueryInfoKey(
	hKey voidptr,
	lpClass &u16,
	lpcchClass &u32,
	lpReserved &u32,
	lpcSubKeys &u32,
	lpcbMaxSubKeyLen &u32,
	lpcbMaxClassLen &u32,
	lpcValues &u32,
	lpcbMaxValueNameLen &u32,
	lpcbMaxValueLen &u32,
	lpcbSecurityDescriptor &u32,
	lpftLastWriteTime voidptr, // TODO FIXME: PFILETIME
) int

fn C.RegEnumKeyEx(
	hKey voidptr,
	dwIndex u32,
	lpName &u16,
	lpcchName &u32,
	lpReserved &u32,
	lpClass &u16,
	lpcchClass &u32,
	lpftLastWriteTime voidptr, // TODO FIXME: PFILETIME
) int

fn C.RegEnumValue(
	hKey voidptr,
	dwIndex u32,
	lpValueName &u16,
	lpcchValueName &u32,
	lpReserved &u32,
	lpType &u32,
	lpData &u8,
	lpcbData &u32,
) int

based on the documentation here:

https://learn.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-regqueryinfokeyw
https://learn.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-regenumkeyexa
https://learn.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-regenumvaluea

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Version used

V 0.4.0 6fef2c2

Environment details (OS name and version, etc.)

V full version: V 0.4.0 6fef2c2
OS: windows, Microsoft Windows 10 Pro v19044 64-bit
Processor: 16 cpus, 64bit, little endian,

getwd: D:\Dropbox\cvs\ptconnect_station
vexe: C:\cvs\v\v.exe
vexe mtime: 2023-07-20 05:15:36

vroot: OK, value: C:\cvs\v
VMODULES: OK, value: C:\Users\royce3\.vmodules
VTMP: OK, value: D:\temp\v_0

Git version: git version 2.35.0.windows.1
Git vroot status: weekly.2023.26-154-g6fef2c2a
.git/config present: true

CC version: Error: exec failed (CreateProcess) with code 2: The system cannot find the file specified.
 cmd: cc --version
thirdparty/tcc status: thirdparty-windows-amd64 e90c2620-dirty

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature/Enhancement RequestThis issue is made to request a feature or an enhancement to an existing one.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions