Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/third_party/rust/windows-result/src/   (Firefox Browser Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  com.rs

  Sprache: Rust
 

use super::*;

#[doc(hidden)]
#[macro_export]
macro_rules! com_call {
    ($vtbl:ty, $this:ident.$method:ident($($args:tt)*)) => {
        ((&**($this.as_raw() as *mut *mut $vtbl)).$method)($this.as_raw(), $($args)*)
    }
}

#[repr(transparent)]
pub struct ComPtr(core::ptr::NonNull<core::ffi::c_void>);

impl ComPtr {
    pub fn as_raw(&self) -> *mut core::ffi::c_void {
        unsafe { core::mem::transmute_copy(self) }
    }

    pub fn cast(&self, iid: &GUID) -> Option<Self> {
        let mut result = None;
        unsafe {
            com_call!(
                IUnknown_Vtbl,
                self.QueryInterface(iid, &mut result as *mut _ as _)
            );
        }
        result
    }
}

impl PartialEq for ComPtr {
    fn eq(&self, other: &Self) -> bool {
        self.cast(&IID_IUnknown).unwrap().0 == other.cast(&IID_IUnknown).unwrap().0
    }
}

impl Eq for ComPtr {}

impl Clone for ComPtr {
    fn clone(&self) -> Self {
        unsafe {
            com_call!(IUnknown_Vtbl, self.AddRef());
        }
        Self(self.0)
    }
}

impl Drop for ComPtr {
    fn drop(&mut self) {
        unsafe {
            com_call!(IUnknown_Vtbl, self.Release());
        }
    }
}

Messung V0.5 in Prozent
C=72 H=89 G=80

¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet am  2026-06-19) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.