| 407 | |
| 408 | #[pyfunction] |
| 409 | fn DeleteKeyEx(args: DeleteKeyExArgs, vm: &VirtualMachine) -> PyResult<()> { |
| 410 | let wide_sub_key = args.sub_key.to_wide_with_nul(); |
| 411 | let res = unsafe { |
| 412 | Registry::RegDeleteKeyExW( |
| 413 | args.key.hkey.load(), |
| 414 | wide_sub_key.as_ptr(), |
| 415 | args.access, |
| 416 | args.reserved, |
| 417 | ) |
| 418 | }; |
| 419 | if res == 0 { |
| 420 | Ok(()) |
| 421 | } else { |
| 422 | Err(vm.new_os_error(format!("error code: {res}"))) |
| 423 | } |
| 424 | } |
| 425 | |
| 426 | #[pyfunction] |
| 427 | fn EnumKey(key: PyRef<PyHkey>, index: i32, vm: &VirtualMachine) -> PyResult<String> { |