Skip to content

Compatibility issues with SetupFindFirstLineW in the Setup API on the Windows ARM64 platform. #3840

@FirTech

Description

@FirTech

Summary

I'm writing a driver installation tool and using the SetupFindFirstLineW API. This API works perfectly on the x86 platform, but when I compile the program for the Windows ARM64 platform and run it in the Windows ARM64 environment, SetupFindFirstLineW throws an error: 0xE0000102. Is it because this API itself doesn't support the ARM64 environment? Or is it a Rust binding issue?

Crate manifest

# Dependency Summary
anyhow = "1.0.100"
windows = { version = "0.62.2", features = ["Win32_Devices_DeviceAndDriverInstallation"]

Crate code

pub fn find_first_line(
	inf_handle: *mut c_void,
	section: &str,
	key: Option<&str>,
) -> anyhow::Result<INFCONTEXT> {
	let section_wide = HSTRING::from(section);

	let key_wide = match key {
		Some(key) => {
			let key_hstring = HSTRING::from(key);
			PCWSTR(key_hstring.as_ptr())
		}
		None => PCWSTR::null(),
	};

	let mut context = INFCONTEXT::default();
	unsafe {
		SetupFindFirstLineW(
			inf_handle,
			PCWSTR(section_wide.as_ptr()),
			key_wide,
			&mut context,
		)?;
	}
	Ok(context)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions