forked from 1b-agent/opencadstudio-upstream
fix(thumbnailer-win): make the COM DLL compile on the MSVC target
First real Windows build surfaced errors that a Linux host couldn't catch: * Enable the missing `windows` feature gates (Win32_System_LibraryLoader, Win32_System_SystemServices, Win32_Security — the last brings in the `Ex` registry APIs) so the imports resolve. * Depend on `windows-core`: the `#[implement]` macro expands to `windows_core::` paths, which need the crate nameable in the root. * `IClassFactory::LockServer` takes `Win32::Foundation::BOOL`, not a `core` BOOL. * Name the returned image type via a new `dwg_thumbnailer::RgbaImage` re-export instead of a direct `image` dependency. Verified with `cargo check --target x86_64-pc-windows-gnu -p dwg-thumbnailer-win` (and the native check still passes). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
a5c6c3f116
commit
3c57260ddb
4 files changed
+13
-3
No files matched your search
@@ -99,7 +99,7 @@ impl IThumbnailProvider_Impl for DwgThumbProvider_Impl {
|
||||
}
|
||||
|
||||
/// Build a 32-bit top-down BGRA `HBITMAP` from an RGBA image.
|
||||
unsafe fn rgba_to_hbitmap(img: &image::RgbaImage) -> windows::core::Result<HBITMAP> {
|
||||
unsafe fn rgba_to_hbitmap(img: &dwg_thumbnailer::RgbaImage) -> windows::core::Result<HBITMAP> {
|
||||
let (w, h) = (img.width() as i32, img.height() as i32);
|
||||
let bi = BITMAPINFO {
|
||||
bmiHeader: BITMAPINFOHEADER {
|
||||
@@ -148,7 +148,7 @@ impl IClassFactory_Impl for Factory_Impl {
|
||||
unsafe { provider.query(&*riid, ppvobject).ok() }
|
||||
}
|
||||
|
||||
fn LockServer(&self, _flock: windows::core::BOOL) -> windows::core::Result<()> {
|
||||
fn LockServer(&self, _flock: windows::Win32::Foundation::BOOL) -> windows::core::Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user