Macro SizedSPropProblemArray

Source
macro_rules! SizedSPropProblemArray {
    ($name:ident [ $count:expr ]) => { ... };
}
Expand description

Declare a variable length struct with the same layout as sys::SPropProblemArray and implement casting functions:

  • fn as_ptr(&self) -> *const sys::SPropProblemArray
  • fn as_mut_ptr(&mut self) -> *mut sys::SPropProblemArray.

ยงSample

SizedSPropProblemArray! { PropProblemArray[2] }

let prop_problem_array = PropProblemArray {
    aProblem: [
        sys::SPropProblem {
            ulIndex: 0,
            ulPropTag: sys::PR_ENTRYID,
            scode: sys::MAPI_E_NOT_FOUND.0
        },
        sys::SPropProblem {
            ulIndex: 1,
            ulPropTag: sys::PR_DISPLAY_NAME_W,
            scode: sys::MAPI_E_NOT_FOUND.0
        },
    ],
    ..Default::default()
};

let prop_problem_array: *const sys::SPropProblemArray = prop_problem_array.as_ptr();