-
-
Notifications
You must be signed in to change notification settings - Fork 393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Link error with CompareObjectHandles #781
Comments
A potential fix has been identified. According to Microsoft, the CompareObjectHandles () api is included in the WindowsApp.lib library. See: https://docs.microsoft.com/en-us/uwp/win32-and-com/win32-apis Based on this, I modified winapi-rs version 3's mod.rs file. I searched for handleapi feature and found that the library being used was kernel32. I changed it to WindowsApp" and my unresolved issue went away.
Note, there are many references to other APS using kernel32. These other APIs should be checked to see if the same change in their respective feature is required. |
|
Can we somehow conditionally compile the definition at https://docs.rs/winapi/0.3.7/src/winapi/um/handleapi.rs.html#23-26? Is there some mechanism already in the crate here to conditionally compile the newer parts of some previously-available interface? |
@Xanewok Extern functions are not linked to unless used, so there is no need to have conditional compilation in |
Don’t know if my reply will help on the background of CompareOjectHandles()…
During running of the cargo tests an error was seen due to this API. CompareObjectHandls() is a Windows 10 specific API used to determine if the 2 passed in handles point to the same object. If it does, then the file handles are just clone of each other and the test passes.
Unfortunately, this API is needed to accomplish this test.
From: Peter Atashian <notifications@github.com>
Sent: Wednesday, July 17, 2019 3:58 AM
To: retep998/winapi-rs <winapi-rs@noreply.github.com>
Cc: Angel Ortiz <aoble248@gmail.com>; Comment <comment@noreply.github.com>
Subject: Re: [retep998/winapi-rs] Link error with CompareObjectHandles (#781)
@Xanewok <https://github.com/Xanewok> Extern functions are not linked to unless used, so there is no need to have conditional compilation in winapi based on the targeted Windows version. If you don't use CompareObjectHandles then no linker errors can occur involving it.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#781?email_source=notifications&email_token=AMJITWHTP5PFY37NFR2KANLP73NIXA5CNFSM4H5GEKCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2DQXGQ#issuecomment-512166810> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AMJITWHZXDZNIIB2S2J5NGLP73NIXANCNFSM4H5GEKCA> . <https://github.com/notifications/beacon/AMJITWFPXPL5ZEKOY25CHI3P73NIXA5CNFSM4H5GEKCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2DQXGQ.gif>
|
Using winapi::um::handleapi::CompareObjectHandles causes a link error to appear:
I suspect this is because it's provided from kernelbase.lib instead of kernel32.lib, per https://docs.microsoft.com/en-us/windows/win32/api/handleapi/nf-handleapi-compareobjecthandles.
The text was updated successfully, but these errors were encountered: