mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 01:48:00 +00:00
7339e00f4a
These handy wrappers on the verbose underlying Win32 registry API have to lose some expressiveness, and one thing they lost was the ability to open a registry key without asking for both read and write access. This meant they couldn't be used for accessing keys not owned by the calling user. So far, I've only used them for accessing PuTTY's own saved data, which means that hasn't been a problem. But I want to use them elsewhere in an upcoming commit, so I need to fix that. The obvious thing would be to change the meaning of the existing 'create' boolean flag so that if it's false, we also don't request write access. The rationale would be that you're either reading or writing, and if you're writing you want both RW access and to create keys that don't already exist. But in fact that's not true: you do want to set create==false and have write access in the case where you're _deleting_ things from the key (or the whole key). So we really do need three ways to call the wrapper function. Rather than add another boolean field to every call site or mess about with an 'access type' enum, I've taken an in-between route: the underlying open_regkey_fn *function* takes a 'create' and a 'write' flag, but at call sites, it's wrapped with a macro anyway (to append NULL to the variadic argument list), so I've just made three macros whose names request different access. That makes call sites marginally _less_ verbose, while still |
||
---|---|---|
.. | ||
agent_mutex_name.c | ||
agent_named_pipe_name.c | ||
arm_arch_queries.c | ||
aux_match_opt.c | ||
centre_window.c | ||
cryptoapi.c | ||
defaults.c | ||
dll_hijacking_protection.c | ||
dputs.c | ||
escape_registry_key.c | ||
filename.c | ||
fontspec.c | ||
get_system_dir.c | ||
get_username.c | ||
getdlgitemtext_alloc.c | ||
gui-timing.c | ||
interprocess_mutex.c | ||
is_console_handle.c | ||
load_system32_dll.c | ||
ltime.c | ||
make_spr_sw_abort_winerror.c | ||
makedlgitemborderless.c | ||
message_box.c | ||
minefield.c | ||
open_for_write_would_lose_data.c | ||
pgp_fingerprints_msgbox.c | ||
platform_get_x_display.c | ||
registry.c | ||
request_file.c | ||
screenshot.c | ||
security.c | ||
shinydialogbox.c | ||
split_into_argv.c | ||
strtoumax.c | ||
version.c | ||
win_strerror.c |