daily pastebin goal
69%
SHARE
TWEET

Untitled

a guest Jul 12th, 2018 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* automatically generated by rust-bindgen */
  2.  
  3. #[repr(C)]
  4. #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
  5. pub struct __BindgenBitfieldUnit<Storage, Align>
  6. where
  7.     Storage: AsRef<[u8]> + AsMut<[u8]>,
  8. {
  9.     storage: Storage,
  10.     align: [Align; 0],
  11. }
  12.  
  13. impl<Storage, Align> __BindgenBitfieldUnit<Storage, Align>
  14. where
  15.     Storage: AsRef<[u8]> + AsMut<[u8]>,
  16. {
  17.     #[inline]
  18.     pub fn new(storage: Storage) -> Self {
  19.         Self { storage, align: [] }
  20.     }
  21.  
  22.     #[inline]
  23.     pub fn get_bit(&self, index: usize) -> bool {
  24.         debug_assert!(index / 8 < self.storage.as_ref().len());
  25.  
  26.         let byte_index = index / 8;
  27.         let byte = self.storage.as_ref()[byte_index];
  28.  
  29.         let bit_index = if cfg!(target_endian = "big") {
  30.             7 - (index % 8)
  31.         } else {
  32.             index % 8
  33.         };
  34.  
  35.         let mask = 1 << bit_index;
  36.  
  37.         byte & mask == mask
  38.     }
  39.  
  40.     #[inline]
  41.     pub fn set_bit(&mut self, index: usize, val: bool) {
  42.         debug_assert!(index / 8 < self.storage.as_ref().len());
  43.  
  44.         let byte_index = index / 8;
  45.         let byte = &mut self.storage.as_mut()[byte_index];
  46.  
  47.         let bit_index = if cfg!(target_endian = "big") {
  48.             7 - (index % 8)
  49.         } else {
  50.             index % 8
  51.         };
  52.  
  53.         let mask = 1 << bit_index;
  54.         if val {
  55.             *byte |= mask;
  56.         } else {
  57.             *byte &= !mask;
  58.         }
  59.     }
  60.  
  61.     #[inline]
  62.     pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
  63.         debug_assert!(bit_width <= 64);
  64.         debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
  65.         debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
  66.  
  67.         let mut val = 0;
  68.  
  69.         for i in 0..(bit_width as usize) {
  70.             if self.get_bit(i + bit_offset) {
  71.                 let index = if cfg!(target_endian = "big") {
  72.                     bit_width as usize - 1 - i
  73.                 } else {
  74.                     i
  75.                 };
  76.                 val |= 1 << index;
  77.             }
  78.         }
  79.  
  80.         val
  81.     }
  82.  
  83.     #[inline]
  84.     pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
  85.         debug_assert!(bit_width <= 64);
  86.         debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
  87.         debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
  88.  
  89.         for i in 0..(bit_width as usize) {
  90.             let mask = 1 << i;
  91.             let val_bit_is_set = val & mask == mask;
  92.             let index = if cfg!(target_endian = "big") {
  93.                 bit_width as usize - 1 - i
  94.             } else {
  95.                 i
  96.             };
  97.             self.set_bit(index + bit_offset, val_bit_is_set);
  98.         }
  99.     }
  100. }
  101. pub type BYTE = ::std::os::raw::c_uchar;
  102. pub type UINT8 = ::std::os::raw::c_uchar;
  103. pub type UINT16 = ::std::os::raw::c_ushort;
  104. pub type UINT32 = ::std::os::raw::c_uint;
  105. pub type UINT64 = ::std::os::raw::c_ulonglong;
  106. pub type LONG = ::std::os::raw::c_long;
  107. pub type HRESULT = LONG;
  108. pub type BOOLEAN = BYTE;
  109. pub type WHV_GUEST_PHYSICAL_ADDRESS = UINT64;
  110. pub type WHV_GUEST_VIRTUAL_ADDRESS = UINT64;
  111. pub const WHV_TRANSLATE_GVA_FLAGS_WHvTranslateGvaFlagNone: WHV_TRANSLATE_GVA_FLAGS = 0;
  112. pub const WHV_TRANSLATE_GVA_FLAGS_WHvTranslateGvaFlagValidateRead: WHV_TRANSLATE_GVA_FLAGS = 1;
  113. pub const WHV_TRANSLATE_GVA_FLAGS_WHvTranslateGvaFlagValidateWrite: WHV_TRANSLATE_GVA_FLAGS = 2;
  114. pub const WHV_TRANSLATE_GVA_FLAGS_WHvTranslateGvaFlagValidateExecute: WHV_TRANSLATE_GVA_FLAGS = 4;
  115. pub const WHV_TRANSLATE_GVA_FLAGS_WHvTranslateGvaFlagPrivilegeExempt: WHV_TRANSLATE_GVA_FLAGS = 8;
  116. pub const WHV_TRANSLATE_GVA_FLAGS_WHvTranslateGvaFlagSetPageTableBits: WHV_TRANSLATE_GVA_FLAGS = 16;
  117. pub type WHV_TRANSLATE_GVA_FLAGS = u32;
  118. pub const WHV_TRANSLATE_GVA_RESULT_CODE_WHvTranslateGvaResultSuccess : WHV_TRANSLATE_GVA_RESULT_CODE = 0 ;
  119. pub const WHV_TRANSLATE_GVA_RESULT_CODE_WHvTranslateGvaResultPageNotPresent : WHV_TRANSLATE_GVA_RESULT_CODE = 1 ;
  120. pub const WHV_TRANSLATE_GVA_RESULT_CODE_WHvTranslateGvaResultPrivilegeViolation : WHV_TRANSLATE_GVA_RESULT_CODE = 2 ;
  121. pub const WHV_TRANSLATE_GVA_RESULT_CODE_WHvTranslateGvaResultInvalidPageTableFlags : WHV_TRANSLATE_GVA_RESULT_CODE = 3 ;
  122. pub const WHV_TRANSLATE_GVA_RESULT_CODE_WHvTranslateGvaResultGpaUnmapped : WHV_TRANSLATE_GVA_RESULT_CODE = 4 ;
  123. pub const WHV_TRANSLATE_GVA_RESULT_CODE_WHvTranslateGvaResultGpaNoReadAccess : WHV_TRANSLATE_GVA_RESULT_CODE = 5 ;
  124. pub const WHV_TRANSLATE_GVA_RESULT_CODE_WHvTranslateGvaResultGpaNoWriteAccess : WHV_TRANSLATE_GVA_RESULT_CODE = 6 ;
  125. pub const WHV_TRANSLATE_GVA_RESULT_CODE_WHvTranslateGvaResultGpaIllegalOverlayAccess : WHV_TRANSLATE_GVA_RESULT_CODE = 7 ;
  126. pub const WHV_TRANSLATE_GVA_RESULT_CODE_WHvTranslateGvaResultIntercept : WHV_TRANSLATE_GVA_RESULT_CODE = 8 ;
  127. pub type WHV_TRANSLATE_GVA_RESULT_CODE = u32;
  128. pub const WHV_REGISTER_NAME_WHvX64RegisterRax: WHV_REGISTER_NAME = 0;
  129. pub const WHV_REGISTER_NAME_WHvX64RegisterRcx: WHV_REGISTER_NAME = 1;
  130. pub const WHV_REGISTER_NAME_WHvX64RegisterRdx: WHV_REGISTER_NAME = 2;
  131. pub const WHV_REGISTER_NAME_WHvX64RegisterRbx: WHV_REGISTER_NAME = 3;
  132. pub const WHV_REGISTER_NAME_WHvX64RegisterRsp: WHV_REGISTER_NAME = 4;
  133. pub const WHV_REGISTER_NAME_WHvX64RegisterRbp: WHV_REGISTER_NAME = 5;
  134. pub const WHV_REGISTER_NAME_WHvX64RegisterRsi: WHV_REGISTER_NAME = 6;
  135. pub const WHV_REGISTER_NAME_WHvX64RegisterRdi: WHV_REGISTER_NAME = 7;
  136. pub const WHV_REGISTER_NAME_WHvX64RegisterR8: WHV_REGISTER_NAME = 8;
  137. pub const WHV_REGISTER_NAME_WHvX64RegisterR9: WHV_REGISTER_NAME = 9;
  138. pub const WHV_REGISTER_NAME_WHvX64RegisterR10: WHV_REGISTER_NAME = 10;
  139. pub const WHV_REGISTER_NAME_WHvX64RegisterR11: WHV_REGISTER_NAME = 11;
  140. pub const WHV_REGISTER_NAME_WHvX64RegisterR12: WHV_REGISTER_NAME = 12;
  141. pub const WHV_REGISTER_NAME_WHvX64RegisterR13: WHV_REGISTER_NAME = 13;
  142. pub const WHV_REGISTER_NAME_WHvX64RegisterR14: WHV_REGISTER_NAME = 14;
  143. pub const WHV_REGISTER_NAME_WHvX64RegisterR15: WHV_REGISTER_NAME = 15;
  144. pub const WHV_REGISTER_NAME_WHvX64RegisterRip: WHV_REGISTER_NAME = 16;
  145. pub const WHV_REGISTER_NAME_WHvX64RegisterRflags: WHV_REGISTER_NAME = 17;
  146. pub const WHV_REGISTER_NAME_WHvX64RegisterEs: WHV_REGISTER_NAME = 18;
  147. pub const WHV_REGISTER_NAME_WHvX64RegisterCs: WHV_REGISTER_NAME = 19;
  148. pub const WHV_REGISTER_NAME_WHvX64RegisterSs: WHV_REGISTER_NAME = 20;
  149. pub const WHV_REGISTER_NAME_WHvX64RegisterDs: WHV_REGISTER_NAME = 21;
  150. pub const WHV_REGISTER_NAME_WHvX64RegisterFs: WHV_REGISTER_NAME = 22;
  151. pub const WHV_REGISTER_NAME_WHvX64RegisterGs: WHV_REGISTER_NAME = 23;
  152. pub const WHV_REGISTER_NAME_WHvX64RegisterLdtr: WHV_REGISTER_NAME = 24;
  153. pub const WHV_REGISTER_NAME_WHvX64RegisterTr: WHV_REGISTER_NAME = 25;
  154. pub const WHV_REGISTER_NAME_WHvX64RegisterIdtr: WHV_REGISTER_NAME = 26;
  155. pub const WHV_REGISTER_NAME_WHvX64RegisterGdtr: WHV_REGISTER_NAME = 27;
  156. pub const WHV_REGISTER_NAME_WHvX64RegisterCr0: WHV_REGISTER_NAME = 28;
  157. pub const WHV_REGISTER_NAME_WHvX64RegisterCr2: WHV_REGISTER_NAME = 29;
  158. pub const WHV_REGISTER_NAME_WHvX64RegisterCr3: WHV_REGISTER_NAME = 30;
  159. pub const WHV_REGISTER_NAME_WHvX64RegisterCr4: WHV_REGISTER_NAME = 31;
  160. pub const WHV_REGISTER_NAME_WHvX64RegisterCr8: WHV_REGISTER_NAME = 32;
  161. pub const WHV_REGISTER_NAME_WHvX64RegisterDr0: WHV_REGISTER_NAME = 33;
  162. pub const WHV_REGISTER_NAME_WHvX64RegisterDr1: WHV_REGISTER_NAME = 34;
  163. pub const WHV_REGISTER_NAME_WHvX64RegisterDr2: WHV_REGISTER_NAME = 35;
  164. pub const WHV_REGISTER_NAME_WHvX64RegisterDr3: WHV_REGISTER_NAME = 36;
  165. pub const WHV_REGISTER_NAME_WHvX64RegisterDr6: WHV_REGISTER_NAME = 37;
  166. pub const WHV_REGISTER_NAME_WHvX64RegisterDr7: WHV_REGISTER_NAME = 38;
  167. pub const WHV_REGISTER_NAME_WHvX64RegisterXmm0: WHV_REGISTER_NAME = 4096;
  168. pub const WHV_REGISTER_NAME_WHvX64RegisterXmm1: WHV_REGISTER_NAME = 4097;
  169. pub const WHV_REGISTER_NAME_WHvX64RegisterXmm2: WHV_REGISTER_NAME = 4098;
  170. pub const WHV_REGISTER_NAME_WHvX64RegisterXmm3: WHV_REGISTER_NAME = 4099;
  171. pub const WHV_REGISTER_NAME_WHvX64RegisterXmm4: WHV_REGISTER_NAME = 4100;
  172. pub const WHV_REGISTER_NAME_WHvX64RegisterXmm5: WHV_REGISTER_NAME = 4101;
  173. pub const WHV_REGISTER_NAME_WHvX64RegisterXmm6: WHV_REGISTER_NAME = 4102;
  174. pub const WHV_REGISTER_NAME_WHvX64RegisterXmm7: WHV_REGISTER_NAME = 4103;
  175. pub const WHV_REGISTER_NAME_WHvX64RegisterXmm8: WHV_REGISTER_NAME = 4104;
  176. pub const WHV_REGISTER_NAME_WHvX64RegisterXmm9: WHV_REGISTER_NAME = 4105;
  177. pub const WHV_REGISTER_NAME_WHvX64RegisterXmm10: WHV_REGISTER_NAME = 4106;
  178. pub const WHV_REGISTER_NAME_WHvX64RegisterXmm11: WHV_REGISTER_NAME = 4107;
  179. pub const WHV_REGISTER_NAME_WHvX64RegisterXmm12: WHV_REGISTER_NAME = 4108;
  180. pub const WHV_REGISTER_NAME_WHvX64RegisterXmm13: WHV_REGISTER_NAME = 4109;
  181. pub const WHV_REGISTER_NAME_WHvX64RegisterXmm14: WHV_REGISTER_NAME = 4110;
  182. pub const WHV_REGISTER_NAME_WHvX64RegisterXmm15: WHV_REGISTER_NAME = 4111;
  183. pub const WHV_REGISTER_NAME_WHvX64RegisterFpMmx0: WHV_REGISTER_NAME = 4112;
  184. pub const WHV_REGISTER_NAME_WHvX64RegisterFpMmx1: WHV_REGISTER_NAME = 4113;
  185. pub const WHV_REGISTER_NAME_WHvX64RegisterFpMmx2: WHV_REGISTER_NAME = 4114;
  186. pub const WHV_REGISTER_NAME_WHvX64RegisterFpMmx3: WHV_REGISTER_NAME = 4115;
  187. pub const WHV_REGISTER_NAME_WHvX64RegisterFpMmx4: WHV_REGISTER_NAME = 4116;
  188. pub const WHV_REGISTER_NAME_WHvX64RegisterFpMmx5: WHV_REGISTER_NAME = 4117;
  189. pub const WHV_REGISTER_NAME_WHvX64RegisterFpMmx6: WHV_REGISTER_NAME = 4118;
  190. pub const WHV_REGISTER_NAME_WHvX64RegisterFpMmx7: WHV_REGISTER_NAME = 4119;
  191. pub const WHV_REGISTER_NAME_WHvX64RegisterFpControlStatus: WHV_REGISTER_NAME = 4120;
  192. pub const WHV_REGISTER_NAME_WHvX64RegisterXmmControlStatus: WHV_REGISTER_NAME = 4121;
  193. pub const WHV_REGISTER_NAME_WHvX64RegisterTsc: WHV_REGISTER_NAME = 8192;
  194. pub const WHV_REGISTER_NAME_WHvX64RegisterEfer: WHV_REGISTER_NAME = 8193;
  195. pub const WHV_REGISTER_NAME_WHvX64RegisterKernelGsBase: WHV_REGISTER_NAME = 8194;
  196. pub const WHV_REGISTER_NAME_WHvX64RegisterApicBase: WHV_REGISTER_NAME = 8195;
  197. pub const WHV_REGISTER_NAME_WHvX64RegisterPat: WHV_REGISTER_NAME = 8196;
  198. pub const WHV_REGISTER_NAME_WHvX64RegisterSysenterCs: WHV_REGISTER_NAME = 8197;
  199. pub const WHV_REGISTER_NAME_WHvX64RegisterSysenterEip: WHV_REGISTER_NAME = 8198;
  200. pub const WHV_REGISTER_NAME_WHvX64RegisterSysenterEsp: WHV_REGISTER_NAME = 8199;
  201. pub const WHV_REGISTER_NAME_WHvX64RegisterStar: WHV_REGISTER_NAME = 8200;
  202. pub const WHV_REGISTER_NAME_WHvX64RegisterLstar: WHV_REGISTER_NAME = 8201;
  203. pub const WHV_REGISTER_NAME_WHvX64RegisterCstar: WHV_REGISTER_NAME = 8202;
  204. pub const WHV_REGISTER_NAME_WHvX64RegisterSfmask: WHV_REGISTER_NAME = 8203;
  205. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrCap: WHV_REGISTER_NAME = 8205;
  206. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrDefType: WHV_REGISTER_NAME = 8206;
  207. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrPhysBase0: WHV_REGISTER_NAME = 8208;
  208. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrPhysBase1: WHV_REGISTER_NAME = 8209;
  209. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrPhysBase2: WHV_REGISTER_NAME = 8210;
  210. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrPhysBase3: WHV_REGISTER_NAME = 8211;
  211. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrPhysBase4: WHV_REGISTER_NAME = 8212;
  212. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrPhysBase5: WHV_REGISTER_NAME = 8213;
  213. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrPhysBase6: WHV_REGISTER_NAME = 8214;
  214. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrPhysBase7: WHV_REGISTER_NAME = 8215;
  215. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrPhysBase8: WHV_REGISTER_NAME = 8216;
  216. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrPhysBase9: WHV_REGISTER_NAME = 8217;
  217. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrPhysBaseA: WHV_REGISTER_NAME = 8218;
  218. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrPhysBaseB: WHV_REGISTER_NAME = 8219;
  219. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrPhysBaseC: WHV_REGISTER_NAME = 8220;
  220. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrPhysBaseD: WHV_REGISTER_NAME = 8221;
  221. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrPhysBaseE: WHV_REGISTER_NAME = 8222;
  222. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrPhysBaseF: WHV_REGISTER_NAME = 8223;
  223. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrPhysMask0: WHV_REGISTER_NAME = 8256;
  224. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrPhysMask1: WHV_REGISTER_NAME = 8257;
  225. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrPhysMask2: WHV_REGISTER_NAME = 8258;
  226. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrPhysMask3: WHV_REGISTER_NAME = 8259;
  227. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrPhysMask4: WHV_REGISTER_NAME = 8260;
  228. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrPhysMask5: WHV_REGISTER_NAME = 8261;
  229. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrPhysMask6: WHV_REGISTER_NAME = 8262;
  230. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrPhysMask7: WHV_REGISTER_NAME = 8263;
  231. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrPhysMask8: WHV_REGISTER_NAME = 8264;
  232. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrPhysMask9: WHV_REGISTER_NAME = 8265;
  233. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrPhysMaskA: WHV_REGISTER_NAME = 8266;
  234. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrPhysMaskB: WHV_REGISTER_NAME = 8267;
  235. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrPhysMaskC: WHV_REGISTER_NAME = 8268;
  236. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrPhysMaskD: WHV_REGISTER_NAME = 8269;
  237. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrPhysMaskE: WHV_REGISTER_NAME = 8270;
  238. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrPhysMaskF: WHV_REGISTER_NAME = 8271;
  239. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrFix64k00000: WHV_REGISTER_NAME = 8304;
  240. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrFix16k80000: WHV_REGISTER_NAME = 8305;
  241. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrFix16kA0000: WHV_REGISTER_NAME = 8306;
  242. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrFix4kC0000: WHV_REGISTER_NAME = 8307;
  243. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrFix4kC8000: WHV_REGISTER_NAME = 8308;
  244. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrFix4kD0000: WHV_REGISTER_NAME = 8309;
  245. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrFix4kD8000: WHV_REGISTER_NAME = 8310;
  246. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrFix4kE0000: WHV_REGISTER_NAME = 8311;
  247. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrFix4kE8000: WHV_REGISTER_NAME = 8312;
  248. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrFix4kF0000: WHV_REGISTER_NAME = 8313;
  249. pub const WHV_REGISTER_NAME_WHvX64RegisterMsrMtrrFix4kF8000: WHV_REGISTER_NAME = 8314;
  250. pub const WHV_REGISTER_NAME_WHvX64RegisterTscAux: WHV_REGISTER_NAME = 8315;
  251. pub const WHV_REGISTER_NAME_WHvRegisterPendingInterruption: WHV_REGISTER_NAME = 2147483648;
  252. pub const WHV_REGISTER_NAME_WHvRegisterInterruptState: WHV_REGISTER_NAME = 2147483649;
  253. pub const WHV_REGISTER_NAME_WHvRegisterPendingEvent0: WHV_REGISTER_NAME = 2147483650;
  254. pub const WHV_REGISTER_NAME_WHvRegisterPendingEvent1: WHV_REGISTER_NAME = 2147483651;
  255. pub const WHV_REGISTER_NAME_WHvX64RegisterDeliverabilityNotifications: WHV_REGISTER_NAME =
  256.     2147483652;
  257. pub type WHV_REGISTER_NAME = u32;
  258. #[repr(C)]
  259. #[derive(Copy, Clone)]; 16usize ] , }#[repr(C)]
  260. #[derive(Debug, Copy, Clone)]
  261. pub struct WHV_UINT128__bindgen_ty_1 {
  262.     pub Low64: UINT64,
  263.     pub High64: UINT64,
  264. }
  265. #[repr(C)]
  266. #[derive(Copy, Clone)]; 16usize ] , }#[repr(C)]
  267. #[derive(Debug, Copy, Clone)]
  268. pub struct WHV_X64_FP_REGISTER__bindgen_ty_1 {
  269.     pub Mantissa: UINT64,
  270.     pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize], u64>,
  271. }
  272. impl WHV_X64_FP_REGISTER__bindgen_ty_1 {
  273.     #[inline]
  274.     pub fn BiasedExponent(&self) -> UINT64 {
  275.         unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 15u8) as u64) }
  276.     }
  277.     #[inline]
  278.     pub fn set_BiasedExponent(&mut self, val: UINT64) {
  279.         unsafe {
  280.             let val: u64 = ::std::mem::transmute(val);
  281.             self._bitfield_1.set(0usize, 15u8, val as u64)
  282.         }
  283.     }
  284.     #[inline]
  285.     pub fn Sign(&self) -> UINT64 {
  286.         unsafe { ::std::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u64) }
  287.     }
  288.     #[inline]
  289.     pub fn set_Sign(&mut self, val: UINT64) {
  290.         unsafe {
  291.             let val: u64 = ::std::mem::transmute(val);
  292.             self._bitfield_1.set(15usize, 1u8, val as u64)
  293.         }
  294.     }
  295.     #[inline]
  296.     pub fn Reserved(&self) -> UINT64 {
  297.         unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 48u8) as u64) }
  298.     }
  299.     #[inline]
  300.     pub fn set_Reserved(&mut self, val: UINT64) {
  301.         unsafe {
  302.             let val: u64 = ::std::mem::transmute(val);
  303.             self._bitfield_1.set(16usize, 48u8, val as u64)
  304.         }
  305.     }
  306.     #[inline]
  307.     pub fn new_bitfield_1(
  308.         BiasedExponent: UINT64,
  309.         Sign: UINT64,
  310.         Reserved: UINT64,
  311.     ) -> __BindgenBitfieldUnit<[u8; 8usize], u64> {
  312.         let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize], u64> =
  313.             Default::default();
  314.         __bindgen_bitfield_unit.set(0usize, 15u8, {
  315.             let BiasedExponent: u64 = unsafe { ::std::mem::transmute(BiasedExponent) };
  316.             BiasedExponent as u64
  317.         });
  318.         __bindgen_bitfield_unit.set(15usize, 1u8, {
  319.             let Sign: u64 = unsafe { ::std::mem::transmute(Sign) };
  320.             Sign as u64
  321.         });
  322.         __bindgen_bitfield_unit.set(16usize, 48u8, {
  323.             let Reserved: u64 = unsafe { ::std::mem::transmute(Reserved) };
  324.             Reserved as u64
  325.         });
  326.         __bindgen_bitfield_unit
  327.     }
  328. }
  329. #[repr(C)]
  330. #[derive(Copy, Clone)]; 16usize ] , }#[repr(C)]
  331. #[derive(Copy, Clone)]
  332. pub struct WHV_X64_FP_CONTROL_STATUS_REGISTER__bindgen_ty_1 {
  333.     pub FpControl: UINT16,
  334.     pub FpStatus: UINT16,
  335.     pub FpTag: UINT8,
  336.     pub Reserved: UINT8,
  337.     pub LastFpOp: UINT16,
  338.     pub __bindgen_anon_1: WHV_X64_FP_CONTROL_STATUS_REGISTER__bindgen_ty_1__bindgen_ty_1,
  339. }
  340. #[repr(C)]
  341. #[derive(Copy, Clone)]pub union WHV_X64_FP_CONTROL_STATUS_REGISTER__bindgen_ty_1__bindgen_ty_1 { pub LastFpRip : UINT64 , pub __bindgen_anon_1 : WHV_X64_FP_CONTROL_STATUS_REGISTER__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 , _bindgen_union_align : u64 , }#[repr(C)]
  342. #[derive(Debug, Copy, Clone)]
  343. pub struct WHV_X64_FP_CONTROL_STATUS_REGISTER__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 {
  344.     pub LastFpEip: UINT32,
  345.     pub LastFpCs: UINT16,
  346.     pub Reserved2: UINT16,
  347. }
  348. #[repr(C)]
  349. #[derive(Copy, Clone)]; 16usize ] , }#[repr(C)]
  350. #[derive(Copy, Clone)]
  351. pub struct WHV_X64_XMM_CONTROL_STATUS_REGISTER__bindgen_ty_1 {
  352.     pub __bindgen_anon_1: WHV_X64_XMM_CONTROL_STATUS_REGISTER__bindgen_ty_1__bindgen_ty_1,
  353.     pub XmmStatusControl: UINT32,
  354.     pub XmmStatusControlMask: UINT32,
  355. }
  356. #[repr(C)]
  357. #[derive(Copy, Clone)]pub union WHV_X64_XMM_CONTROL_STATUS_REGISTER__bindgen_ty_1__bindgen_ty_1 { pub LastFpRdp : UINT64 , pub __bindgen_anon_1 : WHV_X64_XMM_CONTROL_STATUS_REGISTER__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 , _bindgen_union_align : u64 , }#[repr(C)]
  358. #[derive(Debug, Copy, Clone)]
  359. pub struct WHV_X64_XMM_CONTROL_STATUS_REGISTER__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 {
  360.     pub LastFpDp: UINT32,
  361.     pub LastFpDs: UINT16,
  362.     pub Reserved: UINT16,
  363. }
  364. #[repr(C)]
  365. #[derive(Copy, Clone)]
  366. pub struct WHV_X64_SEGMENT_REGISTER {
  367.     pub Base: UINT64,
  368.     pub Limit: UINT32,
  369.     pub Selector: UINT16,
  370.     pub __bindgen_anon_1: WHV_X64_SEGMENT_REGISTER__bindgen_ty_1,
  371. }
  372. #[repr(C)]
  373. #[derive(Copy, Clone)]pub union WHV_X64_SEGMENT_REGISTER__bindgen_ty_1 { pub __bindgen_anon_1 : WHV_X64_SEGMENT_REGISTER__bindgen_ty_1__bindgen_ty_1 , pub Attributes : UINT16 , _bindgen_union_align : u16 , }#[repr(C)]
  374. #[derive(Debug, Copy, Clone)]
  375. pub struct WHV_X64_SEGMENT_REGISTER__bindgen_ty_1__bindgen_ty_1 {
  376.     pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize], u8>,
  377.     pub __bindgen_align: [u16; 0usize],
  378. }
  379. impl WHV_X64_SEGMENT_REGISTER__bindgen_ty_1__bindgen_ty_1 {
  380.     #[inline]
  381.     pub fn SegmentType(&self) -> UINT16 {
  382.         unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
  383.     }
  384.     #[inline]
  385.     pub fn set_SegmentType(&mut self, val: UINT16) {
  386.         unsafe {
  387.             let val: u16 = ::std::mem::transmute(val);
  388.             self._bitfield_1.set(0usize, 4u8, val as u64)
  389.         }
  390.     }
  391.     #[inline]
  392.     pub fn NonSystemSegment(&self) -> UINT16 {
  393.         unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u16) }
  394.     }
  395.     #[inline]
  396.     pub fn set_NonSystemSegment(&mut self, val: UINT16) {
  397.         unsafe {
  398.             let val: u16 = ::std::mem::transmute(val);
  399.             self._bitfield_1.set(4usize, 1u8, val as u64)
  400.         }
  401.     }
  402.     #[inline]
  403.     pub fn DescriptorPrivilegeLevel(&self) -> UINT16 {
  404.         unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 2u8) as u16) }
  405.     }
  406.     #[inline]
  407.     pub fn set_DescriptorPrivilegeLevel(&mut self, val: UINT16) {
  408.         unsafe {
  409.             let val: u16 = ::std::mem::transmute(val);
  410.             self._bitfield_1.set(5usize, 2u8, val as u64)
  411.         }
  412.     }
  413.     #[inline]
  414.     pub fn Present(&self) -> UINT16 {
  415.         unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u16) }
  416.     }
  417.     #[inline]
  418.     pub fn set_Present(&mut self, val: UINT16) {
  419.         unsafe {
  420.             let val: u16 = ::std::mem::transmute(val);
  421.             self._bitfield_1.set(7usize, 1u8, val as u64)
  422.         }
  423.     }
  424.     #[inline]
  425.     pub fn Reserved(&self) -> UINT16 {
  426.         unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 4u8) as u16) }
  427.     }
  428.     #[inline]
  429.     pub fn set_Reserved(&mut self, val: UINT16) {
  430.         unsafe {
  431.             let val: u16 = ::std::mem::transmute(val);
  432.             self._bitfield_1.set(8usize, 4u8, val as u64)
  433.         }
  434.     }
  435.     #[inline]
  436.     pub fn Available(&self) -> UINT16 {
  437.         unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) }
  438.     }
  439.     #[inline]
  440.     pub fn set_Available(&mut self, val: UINT16) {
  441.         unsafe {
  442.             let val: u16 = ::std::mem::transmute(val);
  443.             self._bitfield_1.set(12usize, 1u8, val as u64)
  444.         }
  445.     }
  446.     #[inline]
  447.     pub fn Long(&self) -> UINT16 {
  448.         unsafe { ::std::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) }
  449.     }
  450.     #[inline]
  451.     pub fn set_Long(&mut self, val: UINT16) {
  452.         unsafe {
  453.             let val: u16 = ::std::mem::transmute(val);
  454.             self._bitfield_1.set(13usize, 1u8, val as u64)
  455.         }
  456.     }
  457.     #[inline]
  458.     pub fn Default(&self) -> UINT16 {
  459.         unsafe { ::std::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) }
  460.     }
  461.     #[inline]
  462.     pub fn set_Default(&mut self, val: UINT16) {
  463.         unsafe {
  464.             let val: u16 = ::std::mem::transmute(val);
  465.             self._bitfield_1.set(14usize, 1u8, val as u64)
  466.         }
  467.     }
  468.     #[inline]
  469.     pub fn Granularity(&self) -> UINT16 {
  470.         unsafe { ::std::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
  471.     }
  472.     #[inline]
  473.     pub fn set_Granularity(&mut self, val: UINT16) {
  474.         unsafe {
  475.             let val: u16 = ::std::mem::transmute(val);
  476.             self._bitfield_1.set(15usize, 1u8, val as u64)
  477.         }
  478.     }
  479.     #[inline]
  480.     pub fn new_bitfield_1(
  481.         SegmentType: UINT16,
  482.         NonSystemSegment: UINT16,
  483.         DescriptorPrivilegeLevel: UINT16,
  484.         Present: UINT16,
  485.         Reserved: UINT16,
  486.         Available: UINT16,
  487.         Long: UINT16,
  488.         Default: UINT16,
  489.         Granularity: UINT16,
  490.     ) -> __BindgenBitfieldUnit<[u8; 2usize], u8> {
  491.         let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize], u8> =
  492.             Default::default();
  493.         __bindgen_bitfield_unit.set(0usize, 4u8, {
  494.             let SegmentType: u16 = unsafe { ::std::mem::transmute(SegmentType) };
  495.             SegmentType as u64
  496.         });
  497.         __bindgen_bitfield_unit.set(4usize, 1u8, {
  498.             let NonSystemSegment: u16 = unsafe { ::std::mem::transmute(NonSystemSegment) };
  499.             NonSystemSegment as u64
  500.         });
  501.         __bindgen_bitfield_unit.set(5usize, 2u8, {
  502.             let DescriptorPrivilegeLevel: u16 =
  503.                 unsafe { ::std::mem::transmute(DescriptorPrivilegeLevel) };
  504.             DescriptorPrivilegeLevel as u64
  505.         });
  506.         __bindgen_bitfield_unit.set(7usize, 1u8, {
  507.             let Present: u16 = unsafe { ::std::mem::transmute(Present) };
  508.             Present as u64
  509.         });
  510.         __bindgen_bitfield_unit.set(8usize, 4u8, {
  511.             let Reserved: u16 = unsafe { ::std::mem::transmute(Reserved) };
  512.             Reserved as u64
  513.         });
  514.         __bindgen_bitfield_unit.set(12usize, 1u8, {
  515.             let Available: u16 = unsafe { ::std::mem::transmute(Available) };
  516.             Available as u64
  517.         });
  518.         __bindgen_bitfield_unit.set(13usize, 1u8, {
  519.             let Long: u16 = unsafe { ::std::mem::transmute(Long) };
  520.             Long as u64
  521.         });
  522.         __bindgen_bitfield_unit.set(14usize, 1u8, {
  523.             let Default: u16 = unsafe { ::std::mem::transmute(Default) };
  524.             Default as u64
  525.         });
  526.         __bindgen_bitfield_unit.set(15usize, 1u8, {
  527.             let Granularity: u16 = unsafe { ::std::mem::transmute(Granularity) };
  528.             Granularity as u64
  529.         });
  530.         __bindgen_bitfield_unit
  531.     }
  532. }
  533. #[repr(C)]
  534. #[derive(Debug, Copy, Clone)]
  535. pub struct WHV_X64_TABLE_REGISTER {
  536.     pub Pad: [UINT16; 3usize],
  537.     pub Limit: UINT16,
  538.     pub Base: UINT64,
  539. }
  540. #[repr(C)]
  541. #[derive(Copy, Clone)]pub union WHV_X64_INTERRUPT_STATE_REGISTER { pub __bindgen_anon_1 : WHV_X64_INTERRUPT_STATE_REGISTER__bindgen_ty_1 , pub AsUINT64 : UINT64 , _bindgen_union_align : u64 , }#[repr(C)]
  542. #[derive(Debug, Copy, Clone)]
  543. pub struct WHV_X64_INTERRUPT_STATE_REGISTER__bindgen_ty_1 {
  544.     pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize], u64>,
  545.     pub __bindgen_align: [u64; 0usize],
  546. }
  547. impl WHV_X64_INTERRUPT_STATE_REGISTER__bindgen_ty_1 {
  548.     #[inline]
  549.     pub fn InterruptShadow(&self) -> UINT64 {
  550.         unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) }
  551.     }
  552.     #[inline]
  553.     pub fn set_InterruptShadow(&mut self, val: UINT64) {
  554.         unsafe {
  555.             let val: u64 = ::std::mem::transmute(val);
  556.             self._bitfield_1.set(0usize, 1u8, val as u64)
  557.         }
  558.     }
  559.     #[inline]
  560.     pub fn NmiMasked(&self) -> UINT64 {
  561.         unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u64) }
  562.     }
  563.     #[inline]
  564.     pub fn set_NmiMasked(&mut self, val: UINT64) {
  565.         unsafe {
  566.             let val: u64 = ::std::mem::transmute(val);
  567.             self._bitfield_1.set(1usize, 1u8, val as u64)
  568.         }
  569.     }
  570.     #[inline]
  571.     pub fn Reserved(&self) -> UINT64 {
  572.         unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 62u8) as u64) }
  573.     }
  574.     #[inline]
  575.     pub fn set_Reserved(&mut self, val: UINT64) {
  576.         unsafe {
  577.             let val: u64 = ::std::mem::transmute(val);
  578.             self._bitfield_1.set(2usize, 62u8, val as u64)
  579.         }
  580.     }
  581.     #[inline]
  582.     pub fn new_bitfield_1(
  583.         InterruptShadow: UINT64,
  584.         NmiMasked: UINT64,
  585.         Reserved: UINT64,
  586.     ) -> __BindgenBitfieldUnit<[u8; 8usize], u64> {
  587.         let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize], u64> =
  588.             Default::default();
  589.         __bindgen_bitfield_unit.set(0usize, 1u8, {
  590.             let InterruptShadow: u64 = unsafe { ::std::mem::transmute(InterruptShadow) };
  591.             InterruptShadow as u64
  592.         });
  593.         __bindgen_bitfield_unit.set(1usize, 1u8, {
  594.             let NmiMasked: u64 = unsafe { ::std::mem::transmute(NmiMasked) };
  595.             NmiMasked as u64
  596.         });
  597.         __bindgen_bitfield_unit.set(2usize, 62u8, {
  598.             let Reserved: u64 = unsafe { ::std::mem::transmute(Reserved) };
  599.             Reserved as u64
  600.         });
  601.         __bindgen_bitfield_unit
  602.     }
  603. }
  604. #[repr(C)]
  605. #[derive(Copy, Clone)]pub union WHV_X64_PENDING_INTERRUPTION_REGISTER { pub __bindgen_anon_1 : WHV_X64_PENDING_INTERRUPTION_REGISTER__bindgen_ty_1 , pub AsUINT64 : UINT64 , _bindgen_union_align : u64 , }#[repr(C)]
  606. #[derive(Debug, Copy, Clone)]
  607. pub struct WHV_X64_PENDING_INTERRUPTION_REGISTER__bindgen_ty_1 {
  608.     pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u16>,
  609.     pub ErrorCode: UINT32,
  610. }
  611. impl WHV_X64_PENDING_INTERRUPTION_REGISTER__bindgen_ty_1 {
  612.     #[inline]
  613.     pub fn InterruptionPending(&self) -> UINT32 {
  614.         unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) }
  615.     }
  616.     #[inline]
  617.     pub fn set_InterruptionPending(&mut self, val: UINT32) {
  618.         unsafe {
  619.             let val: u32 = ::std::mem::transmute(val);
  620.             self._bitfield_1.set(0usize, 1u8, val as u64)
  621.         }
  622.     }
  623.     #[inline]
  624.     pub fn InterruptionType(&self) -> UINT32 {
  625.         unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 3u8) as u32) }
  626.     }
  627.     #[inline]
  628.     pub fn set_InterruptionType(&mut self, val: UINT32) {
  629.         unsafe {
  630.             let val: u32 = ::std::mem::transmute(val);
  631.             self._bitfield_1.set(1usize, 3u8, val as u64)
  632.         }
  633.     }
  634.     #[inline]
  635.     pub fn DeliverErrorCode(&self) -> UINT32 {
  636.         unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) }
  637.     }
  638.     #[inline]
  639.     pub fn set_DeliverErrorCode(&mut self, val: UINT32) {
  640.         unsafe {
  641.             let val: u32 = ::std::mem::transmute(val);
  642.             self._bitfield_1.set(4usize, 1u8, val as u64)
  643.         }
  644.     }
  645.     #[inline]
  646.     pub fn InstructionLength(&self) -> UINT32 {
  647.         unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 4u8) as u32) }
  648.     }
  649.     #[inline]
  650.     pub fn set_InstructionLength(&mut self, val: UINT32) {
  651.         unsafe {
  652.             let val: u32 = ::std::mem::transmute(val);
  653.             self._bitfield_1.set(5usize, 4u8, val as u64)
  654.         }
  655.     }
  656.     #[inline]
  657.     pub fn NestedEvent(&self) -> UINT32 {
  658.         unsafe { ::std::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u32) }
  659.     }
  660.     #[inline]
  661.     pub fn set_NestedEvent(&mut self, val: UINT32) {
  662.         unsafe {
  663.             let val: u32 = ::std::mem::transmute(val);
  664.             self._bitfield_1.set(9usize, 1u8, val as u64)
  665.         }
  666.     }
  667.     #[inline]
  668.     pub fn Reserved(&self) -> UINT32 {
  669.         unsafe { ::std::mem::transmute(self._bitfield_1.get(10usize, 6u8) as u32) }
  670.     }
  671.     #[inline]
  672.     pub fn set_Reserved(&mut self, val: UINT32) {
  673.         unsafe {
  674.             let val: u32 = ::std::mem::transmute(val);
  675.             self._bitfield_1.set(10usize, 6u8, val as u64)
  676.         }
  677.     }
  678.     #[inline]
  679.     pub fn InterruptionVector(&self) -> UINT32 {
  680.         unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 16u8) as u32) }
  681.     }
  682.     #[inline]
  683.     pub fn set_InterruptionVector(&mut self, val: UINT32) {
  684.         unsafe {
  685.             let val: u32 = ::std::mem::transmute(val);
  686.             self._bitfield_1.set(16usize, 16u8, val as u64)
  687.         }
  688.     }
  689.     #[inline]
  690.     pub fn new_bitfield_1(
  691.         InterruptionPending: UINT32,
  692.         InterruptionType: UINT32,
  693.         DeliverErrorCode: UINT32,
  694.         InstructionLength: UINT32,
  695.         NestedEvent: UINT32,
  696.         Reserved: UINT32,
  697.         InterruptionVector: UINT32,
  698.     ) -> __BindgenBitfieldUnit<[u8; 4usize], u16> {
  699.         let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u16> =
  700.             Default::default();
  701.         __bindgen_bitfield_unit.set(0usize, 1u8, {
  702.             let InterruptionPending: u32 = unsafe { ::std::mem::transmute(InterruptionPending) };
  703.             InterruptionPending as u64
  704.         });
  705.         __bindgen_bitfield_unit.set(1usize, 3u8, {
  706.             let InterruptionType: u32 = unsafe { ::std::mem::transmute(InterruptionType) };
  707.             InterruptionType as u64
  708.         });
  709.         __bindgen_bitfield_unit.set(4usize, 1u8, {
  710.             let DeliverErrorCode: u32 = unsafe { ::std::mem::transmute(DeliverErrorCode) };
  711.             DeliverErrorCode as u64
  712.         });
  713.         __bindgen_bitfield_unit.set(5usize, 4u8, {
  714.             let InstructionLength: u32 = unsafe { ::std::mem::transmute(InstructionLength) };
  715.             InstructionLength as u64
  716.         });
  717.         __bindgen_bitfield_unit.set(9usize, 1u8, {
  718.             let NestedEvent: u32 = unsafe { ::std::mem::transmute(NestedEvent) };
  719.             NestedEvent as u64
  720.         });
  721.         __bindgen_bitfield_unit.set(10usize, 6u8, {
  722.             let Reserved: u32 = unsafe { ::std::mem::transmute(Reserved) };
  723.             Reserved as u64
  724.         });
  725.         __bindgen_bitfield_unit.set(16usize, 16u8, {
  726.             let InterruptionVector: u32 = unsafe { ::std::mem::transmute(InterruptionVector) };
  727.             InterruptionVector as u64
  728.         });
  729.         __bindgen_bitfield_unit
  730.     }
  731. }
  732. #[repr(C)]
  733. #[derive(Copy, Clone)]pub union WHV_X64_DELIVERABILITY_NOTIFICATIONS_REGISTER { pub __bindgen_anon_1 : WHV_X64_DELIVERABILITY_NOTIFICATIONS_REGISTER__bindgen_ty_1 , pub AsUINT64 : UINT64 , _bindgen_union_align : u64 , }#[repr(C)]
  734. #[derive(Debug, Copy, Clone)]
  735. pub struct WHV_X64_DELIVERABILITY_NOTIFICATIONS_REGISTER__bindgen_ty_1 {
  736.     pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize], u64>,
  737.     pub __bindgen_align: [u64; 0usize],
  738. }
  739. impl WHV_X64_DELIVERABILITY_NOTIFICATIONS_REGISTER__bindgen_ty_1 {
  740.     #[inline]
  741.     pub fn NmiNotification(&self) -> UINT64 {
  742.         unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) }
  743.     }
  744.     #[inline]
  745.     pub fn set_NmiNotification(&mut self, val: UINT64) {
  746.         unsafe {
  747.             let val: u64 = ::std::mem::transmute(val);
  748.             self._bitfield_1.set(0usize, 1u8, val as u64)
  749.         }
  750.     }
  751.     #[inline]
  752.     pub fn InterruptNotification(&self) -> UINT64 {
  753.         unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u64) }
  754.     }
  755.     #[inline]
  756.     pub fn set_InterruptNotification(&mut self, val: UINT64) {
  757.         unsafe {
  758.             let val: u64 = ::std::mem::transmute(val);
  759.             self._bitfield_1.set(1usize, 1u8, val as u64)
  760.         }
  761.     }
  762.     #[inline]
  763.     pub fn InterruptPriority(&self) -> UINT64 {
  764.         unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 4u8) as u64) }
  765.     }
  766.     #[inline]
  767.     pub fn set_InterruptPriority(&mut self, val: UINT64) {
  768.         unsafe {
  769.             let val: u64 = ::std::mem::transmute(val);
  770.             self._bitfield_1.set(2usize, 4u8, val as u64)
  771.         }
  772.     }
  773.     #[inline]
  774.     pub fn Reserved(&self) -> UINT64 {
  775.         unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 58u8) as u64) }
  776.     }
  777.     #[inline]
  778.     pub fn set_Reserved(&mut self, val: UINT64) {
  779.         unsafe {
  780.             let val: u64 = ::std::mem::transmute(val);
  781.             self._bitfield_1.set(6usize, 58u8, val as u64)
  782.         }
  783.     }
  784.     #[inline]
  785.     pub fn new_bitfield_1(
  786.         NmiNotification: UINT64,
  787.         InterruptNotification: UINT64,
  788.         InterruptPriority: UINT64,
  789.         Reserved: UINT64,
  790.     ) -> __BindgenBitfieldUnit<[u8; 8usize], u64> {
  791.         let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize], u64> =
  792.             Default::default();
  793.         __bindgen_bitfield_unit.set(0usize, 1u8, {
  794.             let NmiNotification: u64 = unsafe { ::std::mem::transmute(NmiNotification) };
  795.             NmiNotification as u64
  796.         });
  797.         __bindgen_bitfield_unit.set(1usize, 1u8, {
  798.             let InterruptNotification: u64 =
  799.                 unsafe { ::std::mem::transmute(InterruptNotification) };
  800.             InterruptNotification as u64
  801.         });
  802.         __bindgen_bitfield_unit.set(2usize, 4u8, {
  803.             let InterruptPriority: u64 = unsafe { ::std::mem::transmute(InterruptPriority) };
  804.             InterruptPriority as u64
  805.         });
  806.         __bindgen_bitfield_unit.set(6usize, 58u8, {
  807.             let Reserved: u64 = unsafe { ::std::mem::transmute(Reserved) };
  808.             Reserved as u64
  809.         });
  810.         __bindgen_bitfield_unit
  811.     }
  812. }
  813. #[repr(C)]
  814. #[derive(Copy, Clone)]; 16usize ] , }#[repr(C)]
  815. #[derive(Copy, Clone)]pub union WHV_X64_VP_EXECUTION_STATE { pub __bindgen_anon_1 : WHV_X64_VP_EXECUTION_STATE__bindgen_ty_1 , pub AsUINT16 : UINT16 , _bindgen_union_align : u16 , }#[repr(C)]
  816. #[derive(Debug, Copy, Clone)]
  817. pub struct WHV_X64_VP_EXECUTION_STATE__bindgen_ty_1 {
  818.     pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize], u8>,
  819.     pub __bindgen_align: [u16; 0usize],
  820. }
  821. impl WHV_X64_VP_EXECUTION_STATE__bindgen_ty_1 {
  822.     #[inline]
  823.     pub fn Cpl(&self) -> UINT16 {
  824.         unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 2u8) as u16) }
  825.     }
  826.     #[inline]
  827.     pub fn set_Cpl(&mut self, val: UINT16) {
  828.         unsafe {
  829.             let val: u16 = ::std::mem::transmute(val);
  830.             self._bitfield_1.set(0usize, 2u8, val as u64)
  831.         }
  832.     }
  833.     #[inline]
  834.     pub fn Cr0Pe(&self) -> UINT16 {
  835.         unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u16) }
  836.     }
  837.     #[inline]
  838.     pub fn set_Cr0Pe(&mut self, val: UINT16) {
  839.         unsafe {
  840.             let val: u16 = ::std::mem::transmute(val);
  841.             self._bitfield_1.set(2usize, 1u8, val as u64)
  842.         }
  843.     }
  844.     #[inline]
  845.     pub fn Cr0Am(&self) -> UINT16 {
  846.         unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u16) }
  847.     }
  848.     #[inline]
  849.     pub fn set_Cr0Am(&mut self, val: UINT16) {
  850.         unsafe {
  851.             let val: u16 = ::std::mem::transmute(val);
  852.             self._bitfield_1.set(3usize, 1u8, val as u64)
  853.         }
  854.     }
  855.     #[inline]
  856.     pub fn EferLma(&self) -> UINT16 {
  857.         unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u16) }
  858.     }
  859.     #[inline]
  860.     pub fn set_EferLma(&mut self, val: UINT16) {
  861.         unsafe {
  862.             let val: u16 = ::std::mem::transmute(val);
  863.             self._bitfield_1.set(4usize, 1u8, val as u64)
  864.         }
  865.     }
  866.     #[inline]
  867.     pub fn DebugActive(&self) -> UINT16 {
  868.         unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u16) }
  869.     }
  870.     #[inline]
  871.     pub fn set_DebugActive(&mut self, val: UINT16) {
  872.         unsafe {
  873.             let val: u16 = ::std::mem::transmute(val);
  874.             self._bitfield_1.set(5usize, 1u8, val as u64)
  875.         }
  876.     }
  877.     #[inline]
  878.     pub fn InterruptionPending(&self) -> UINT16 {
  879.         unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u16) }
  880.     }
  881.     #[inline]
  882.     pub fn set_InterruptionPending(&mut self, val: UINT16) {
  883.         unsafe {
  884.             let val: u16 = ::std::mem::transmute(val);
  885.             self._bitfield_1.set(6usize, 1u8, val as u64)
  886.         }
  887.     }
  888.     #[inline]
  889.     pub fn Reserved0(&self) -> UINT16 {
  890.         unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 5u8) as u16) }
  891.     }
  892.     #[inline]
  893.     pub fn set_Reserved0(&mut self, val: UINT16) {
  894.         unsafe {
  895.             let val: u16 = ::std::mem::transmute(val);
  896.             self._bitfield_1.set(7usize, 5u8, val as u64)
  897.         }
  898.     }
  899.     #[inline]
  900.     pub fn InterruptShadow(&self) -> UINT16 {
  901.         unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) }
  902.     }
  903.     #[inline]
  904.     pub fn set_InterruptShadow(&mut self, val: UINT16) {
  905.         unsafe {
  906.             let val: u16 = ::std::mem::transmute(val);
  907.             self._bitfield_1.set(12usize, 1u8, val as u64)
  908.         }
  909.     }
  910.     #[inline]
  911.     pub fn Reserved1(&self) -> UINT16 {
  912.         unsafe { ::std::mem::transmute(self._bitfield_1.get(13usize, 3u8) as u16) }
  913.     }
  914.     #[inline]
  915.     pub fn set_Reserved1(&mut self, val: UINT16) {
  916.         unsafe {
  917.             let val: u16 = ::std::mem::transmute(val);
  918.             self._bitfield_1.set(13usize, 3u8, val as u64)
  919.         }
  920.     }
  921.     #[inline]
  922.     pub fn new_bitfield_1(
  923.         Cpl: UINT16,
  924.         Cr0Pe: UINT16,
  925.         Cr0Am: UINT16,
  926.         EferLma: UINT16,
  927.         DebugActive: UINT16,
  928.         InterruptionPending: UINT16,
  929.         Reserved0: UINT16,
  930.         InterruptShadow: UINT16,
  931.         Reserved1: UINT16,
  932.     ) -> __BindgenBitfieldUnit<[u8; 2usize], u8> {
  933.         let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize], u8> =
  934.             Default::default();
  935.         __bindgen_bitfield_unit.set(0usize, 2u8, {
  936.             let Cpl: u16 = unsafe { ::std::mem::transmute(Cpl) };
  937.             Cpl as u64
  938.         });
  939.         __bindgen_bitfield_unit.set(2usize, 1u8, {
  940.             let Cr0Pe: u16 = unsafe { ::std::mem::transmute(Cr0Pe) };
  941.             Cr0Pe as u64
  942.         });
  943.         __bindgen_bitfield_unit.set(3usize, 1u8, {
  944.             let Cr0Am: u16 = unsafe { ::std::mem::transmute(Cr0Am) };
  945.             Cr0Am as u64
  946.         });
  947.         __bindgen_bitfield_unit.set(4usize, 1u8, {
  948.             let EferLma: u16 = unsafe { ::std::mem::transmute(EferLma) };
  949.             EferLma as u64
  950.         });
  951.         __bindgen_bitfield_unit.set(5usize, 1u8, {
  952.             let DebugActive: u16 = unsafe { ::std::mem::transmute(DebugActive) };
  953.             DebugActive as u64
  954.         });
  955.         __bindgen_bitfield_unit.set(6usize, 1u8, {
  956.             let InterruptionPending: u16 = unsafe { ::std::mem::transmute(InterruptionPending) };
  957.             InterruptionPending as u64
  958.         });
  959.         __bindgen_bitfield_unit.set(7usize, 5u8, {
  960.             let Reserved0: u16 = unsafe { ::std::mem::transmute(Reserved0) };
  961.             Reserved0 as u64
  962.         });
  963.         __bindgen_bitfield_unit.set(12usize, 1u8, {
  964.             let InterruptShadow: u16 = unsafe { ::std::mem::transmute(InterruptShadow) };
  965.             InterruptShadow as u64
  966.         });
  967.         __bindgen_bitfield_unit.set(13usize, 3u8, {
  968.             let Reserved1: u16 = unsafe { ::std::mem::transmute(Reserved1) };
  969.             Reserved1 as u64
  970.         });
  971.         __bindgen_bitfield_unit
  972.     }
  973. }
  974. #[repr(C)]
  975. #[derive(Copy, Clone)]
  976. pub struct WHV_VP_EXIT_CONTEXT {
  977.     pub ExecutionState: WHV_X64_VP_EXECUTION_STATE,
  978.     pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
  979.     pub Reserved: UINT8,
  980.     pub Reserved2: UINT32,
  981.     pub Cs: WHV_X64_SEGMENT_REGISTER,
  982.     pub Rip: UINT64,
  983.     pub Rflags: UINT64,
  984. }
  985. impl WHV_VP_EXIT_CONTEXT {
  986.     #[inline]
  987.     pub fn InstructionLength(&self) -> UINT8 {
  988.         unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
  989.     }
  990.     #[inline]
  991.     pub fn set_InstructionLength(&mut self, val: UINT8) {
  992.         unsafe {
  993.             let val: u8 = ::std::mem::transmute(val);
  994.             self._bitfield_1.set(0usize, 4u8, val as u64)
  995.         }
  996.     }
  997.     #[inline]
  998.     pub fn Cr8(&self) -> UINT8 {
  999.         unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
  1000.     }
  1001.     #[inline]
  1002.     pub fn set_Cr8(&mut self, val: UINT8) {
  1003.         unsafe {
  1004.             let val: u8 = ::std::mem::transmute(val);
  1005.             self._bitfield_1.set(4usize, 4u8, val as u64)
  1006.         }
  1007.     }
  1008.     #[inline]
  1009.     pub fn new_bitfield_1(
  1010.         InstructionLength: UINT8,
  1011.         Cr8: UINT8,
  1012.     ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
  1013.         let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> =
  1014.             Default::default();
  1015.         __bindgen_bitfield_unit.set(0usize, 4u8, {
  1016.             let InstructionLength: u8 = unsafe { ::std::mem::transmute(InstructionLength) };
  1017.             InstructionLength as u64
  1018.         });
  1019.         __bindgen_bitfield_unit.set(4usize, 4u8, {
  1020.             let Cr8: u8 = unsafe { ::std::mem::transmute(Cr8) };
  1021.             Cr8 as u64
  1022.         });
  1023.         __bindgen_bitfield_unit
  1024.     }
  1025. }
  1026. #[repr(C)]
  1027. #[derive(Copy, Clone)]pub union WHV_MEMORY_ACCESS_INFO { pub __bindgen_anon_1 : WHV_MEMORY_ACCESS_INFO__bindgen_ty_1 , pub AsUINT32 : UINT32 , _bindgen_union_align : u32 , }#[repr(C)]
  1028. #[derive(Debug, Copy, Clone)]
  1029. pub struct WHV_MEMORY_ACCESS_INFO__bindgen_ty_1 {
  1030.     pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>,
  1031.     pub __bindgen_align: [u32; 0usize],
  1032. }
  1033. impl WHV_MEMORY_ACCESS_INFO__bindgen_ty_1 {
  1034.     #[inline]
  1035.     pub fn AccessType(&self) -> UINT32 {
  1036.         unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 2u8) as u32) }
  1037.     }
  1038.     #[inline]
  1039.     pub fn set_AccessType(&mut self, val: UINT32) {
  1040.         unsafe {
  1041.             let val: u32 = ::std::mem::transmute(val);
  1042.             self._bitfield_1.set(0usize, 2u8, val as u64)
  1043.         }
  1044.     }
  1045.     #[inline]
  1046.     pub fn GpaUnmapped(&self) -> UINT32 {
  1047.         unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) }
  1048.     }
  1049.     #[inline]
  1050.     pub fn set_GpaUnmapped(&mut self, val: UINT32) {
  1051.         unsafe {
  1052.             let val: u32 = ::std::mem::transmute(val);
  1053.             self._bitfield_1.set(2usize, 1u8, val as u64)
  1054.         }
  1055.     }
  1056.     #[inline]
  1057.     pub fn GvaValid(&self) -> UINT32 {
  1058.         unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) }
  1059.     }
  1060.     #[inline]
  1061.     pub fn set_GvaValid(&mut self, val: UINT32) {
  1062.         unsafe {
  1063.             let val: u32 = ::std::mem::transmute(val);
  1064.             self._bitfield_1.set(3usize, 1u8, val as u64)
  1065.         }
  1066.     }
  1067.     #[inline]
  1068.     pub fn Reserved(&self) -> UINT32 {
  1069.         unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 28u8) as u32) }
  1070.     }
  1071.     #[inline]
  1072.     pub fn set_Reserved(&mut self, val: UINT32) {
  1073.         unsafe {
  1074.             let val: u32 = ::std::mem::transmute(val);
  1075.             self._bitfield_1.set(4usize, 28u8, val as u64)
  1076.         }
  1077.     }
  1078.     #[inline]
  1079.     pub fn new_bitfield_1(
  1080.         AccessType: UINT32,
  1081.         GpaUnmapped: UINT32,
  1082.         GvaValid: UINT32,
  1083.         Reserved: UINT32,
  1084.     ) -> __BindgenBitfieldUnit<[u8; 4usize], u32> {
  1085.         let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u32> =
  1086.             Default::default();
  1087.         __bindgen_bitfield_unit.set(0usize, 2u8, {
  1088.             let AccessType: u32 = unsafe { ::std::mem::transmute(AccessType) };
  1089.             AccessType as u64
  1090.         });
  1091.         __bindgen_bitfield_unit.set(2usize, 1u8, {
  1092.             let GpaUnmapped: u32 = unsafe { ::std::mem::transmute(GpaUnmapped) };
  1093.             GpaUnmapped as u64
  1094.         });
  1095.         __bindgen_bitfield_unit.set(3usize, 1u8, {
  1096.             let GvaValid: u32 = unsafe { ::std::mem::transmute(GvaValid) };
  1097.             GvaValid as u64
  1098.         });
  1099.         __bindgen_bitfield_unit.set(4usize, 28u8, {
  1100.             let Reserved: u32 = unsafe { ::std::mem::transmute(Reserved) };
  1101.             Reserved as u64
  1102.         });
  1103.         __bindgen_bitfield_unit
  1104.     }
  1105. }
  1106. #[repr(C)]
  1107. #[derive(Copy, Clone)]
  1108. pub struct WHV_MEMORY_ACCESS_CONTEXT {
  1109.     pub InstructionByteCount: UINT8,
  1110.     pub Reserved: [UINT8; 3usize],
  1111.     pub InstructionBytes: [UINT8; 16usize],
  1112.     pub AccessInfo: WHV_MEMORY_ACCESS_INFO,
  1113.     pub Gpa: WHV_GUEST_PHYSICAL_ADDRESS,
  1114.     pub Gva: WHV_GUEST_VIRTUAL_ADDRESS,
  1115. }
  1116. #[repr(C)]
  1117. #[derive(Copy, Clone)]pub union WHV_X64_IO_PORT_ACCESS_INFO { pub __bindgen_anon_1 : WHV_X64_IO_PORT_ACCESS_INFO__bindgen_ty_1 , pub AsUINT32 : UINT32 , _bindgen_union_align : u32 , }#[repr(C)]
  1118. #[derive(Debug, Copy, Clone)]
  1119. pub struct WHV_X64_IO_PORT_ACCESS_INFO__bindgen_ty_1 {
  1120.     pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>,
  1121.     pub __bindgen_align: [u32; 0usize],
  1122. }
  1123. impl WHV_X64_IO_PORT_ACCESS_INFO__bindgen_ty_1 {
  1124.     #[inline]
  1125.     pub fn IsWrite(&self) -> UINT32 {
  1126.         unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) }
  1127.     }
  1128.     #[inline]
  1129.     pub fn set_IsWrite(&mut self, val: UINT32) {
  1130.         unsafe {
  1131.             let val: u32 = ::std::mem::transmute(val);
  1132.             self._bitfield_1.set(0usize, 1u8, val as u64)
  1133.         }
  1134.     }
  1135.     #[inline]
  1136.     pub fn AccessSize(&self) -> UINT32 {
  1137.         unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 3u8) as u32) }
  1138.     }
  1139.     #[inline]
  1140.     pub fn set_AccessSize(&mut self, val: UINT32) {
  1141.         unsafe {
  1142.             let val: u32 = ::std::mem::transmute(val);
  1143.             self._bitfield_1.set(1usize, 3u8, val as u64)
  1144.         }
  1145.     }
  1146.     #[inline]
  1147.     pub fn StringOp(&self) -> UINT32 {
  1148.         unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) }
  1149.     }
  1150.     #[inline]
  1151.     pub fn set_StringOp(&mut self, val: UINT32) {
  1152.         unsafe {
  1153.             let val: u32 = ::std::mem::transmute(val);
  1154.             self._bitfield_1.set(4usize, 1u8, val as u64)
  1155.         }
  1156.     }
  1157.     #[inline]
  1158.     pub fn RepPrefix(&self) -> UINT32 {
  1159.         unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u32) }
  1160.     }
  1161.     #[inline]
  1162.     pub fn set_RepPrefix(&mut self, val: UINT32) {
  1163.         unsafe {
  1164.             let val: u32 = ::std::mem::transmute(val);
  1165.             self._bitfield_1.set(5usize, 1u8, val as u64)
  1166.         }
  1167.     }
  1168.     #[inline]
  1169.     pub fn Reserved(&self) -> UINT32 {
  1170.         unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 26u8) as u32) }
  1171.     }
  1172.     #[inline]
  1173.     pub fn set_Reserved(&mut self, val: UINT32) {
  1174.         unsafe {
  1175.             let val: u32 = ::std::mem::transmute(val);
  1176.             self._bitfield_1.set(6usize, 26u8, val as u64)
  1177.         }
  1178.     }
  1179.     #[inline]
  1180.     pub fn new_bitfield_1(
  1181.         IsWrite: UINT32,
  1182.         AccessSize: UINT32,
  1183.         StringOp: UINT32,
  1184.         RepPrefix: UINT32,
  1185.         Reserved: UINT32,
  1186.     ) -> __BindgenBitfieldUnit<[u8; 4usize], u32> {
  1187.         let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u32> =
  1188.             Default::default();
  1189.         __bindgen_bitfield_unit.set(0usize, 1u8, {
  1190.             let IsWrite: u32 = unsafe { ::std::mem::transmute(IsWrite) };
  1191.             IsWrite as u64
  1192.         });
  1193.         __bindgen_bitfield_unit.set(1usize, 3u8, {
  1194.             let AccessSize: u32 = unsafe { ::std::mem::transmute(AccessSize) };
  1195.             AccessSize as u64
  1196.         });
  1197.         __bindgen_bitfield_unit.set(4usize, 1u8, {
  1198.             let StringOp: u32 = unsafe { ::std::mem::transmute(StringOp) };
  1199.             StringOp as u64
  1200.         });
  1201.         __bindgen_bitfield_unit.set(5usize, 1u8, {
  1202.             let RepPrefix: u32 = unsafe { ::std::mem::transmute(RepPrefix) };
  1203.             RepPrefix as u64
  1204.         });
  1205.         __bindgen_bitfield_unit.set(6usize, 26u8, {
  1206.             let Reserved: u32 = unsafe { ::std::mem::transmute(Reserved) };
  1207.             Reserved as u64
  1208.         });
  1209.         __bindgen_bitfield_unit
  1210.     }
  1211. }
  1212. #[repr(C)]
  1213. #[derive(Copy, Clone)]
  1214. pub struct WHV_X64_IO_PORT_ACCESS_CONTEXT {
  1215.     pub InstructionByteCount: UINT8,
  1216.     pub Reserved: [UINT8; 3usize],
  1217.     pub InstructionBytes: [UINT8; 16usize],
  1218.     pub AccessInfo: WHV_X64_IO_PORT_ACCESS_INFO,
  1219.     pub PortNumber: UINT16,
  1220.     pub Reserved2: [UINT16; 3usize],
  1221.     pub Rax: UINT64,
  1222.     pub Rcx: UINT64,
  1223.     pub Rsi: UINT64,
  1224.     pub Rdi: UINT64,
  1225.     pub Ds: WHV_X64_SEGMENT_REGISTER,
  1226.     pub Es: WHV_X64_SEGMENT_REGISTER,
  1227. }
  1228. #[repr(C)]
  1229. #[derive(Copy, Clone)]pub union WHV_EMULATOR_STATUS { pub __bindgen_anon_1 : WHV_EMULATOR_STATUS__bindgen_ty_1 , pub AsUINT32 : UINT32 , _bindgen_union_align : u32 , }#[repr(C)]
  1230. #[derive(Debug, Copy, Clone)]
  1231. pub struct WHV_EMULATOR_STATUS__bindgen_ty_1 {
  1232.     pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>,
  1233.     pub __bindgen_align: [u32; 0usize],
  1234. }
  1235. impl WHV_EMULATOR_STATUS__bindgen_ty_1 {
  1236.     #[inline]
  1237.     pub fn EmulationSuccessful(&self) -> UINT32 {
  1238.         unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) }
  1239.     }
  1240.     #[inline]
  1241.     pub fn set_EmulationSuccessful(&mut self, val: UINT32) {
  1242.         unsafe {
  1243.             let val: u32 = ::std::mem::transmute(val);
  1244.             self._bitfield_1.set(0usize, 1u8, val as u64)
  1245.         }
  1246.     }
  1247.     #[inline]
  1248.     pub fn InternalEmulationFailure(&self) -> UINT32 {
  1249.         unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) }
  1250.     }
  1251.     #[inline]
  1252.     pub fn set_InternalEmulationFailure(&mut self, val: UINT32) {
  1253.         unsafe {
  1254.             let val: u32 = ::std::mem::transmute(val);
  1255.             self._bitfield_1.set(1usize, 1u8, val as u64)
  1256.         }
  1257.     }
  1258.     #[inline]
  1259.     pub fn IoPortCallbackFailed(&self) -> UINT32 {
  1260.         unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) }
  1261.     }
  1262.     #[inline]
  1263.     pub fn set_IoPortCallbackFailed(&mut self, val: UINT32) {
  1264.         unsafe {
  1265.             let val: u32 = ::std::mem::transmute(val);
  1266.             self._bitfield_1.set(2usize, 1u8, val as u64)
  1267.         }
  1268.     }
  1269.     #[inline]
  1270.     pub fn MemoryCallbackFailed(&self) -> UINT32 {
  1271.         unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) }
  1272.     }
  1273.     #[inline]
  1274.     pub fn set_MemoryCallbackFailed(&mut self, val: UINT32) {
  1275.         unsafe {
  1276.             let val: u32 = ::std::mem::transmute(val);
  1277.             self._bitfield_1.set(3usize, 1u8, val as u64)
  1278.         }
  1279.     }
  1280.     #[inline]
  1281.     pub fn TranslateGvaPageCallbackFailed(&self) -> UINT32 {
  1282.         unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) }
  1283.     }
  1284.     #[inline]
  1285.     pub fn set_TranslateGvaPageCallbackFailed(&mut self, val: UINT32) {
  1286.         unsafe {
  1287.             let val: u32 = ::std::mem::transmute(val);
  1288.             self._bitfield_1.set(4usize, 1u8, val as u64)
  1289.         }
  1290.     }
  1291.     #[inline]
  1292.     pub fn TranslateGvaPageCallbackGpaIsNotAligned(&self) -> UINT32 {
  1293.         unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u32) }
  1294.     }
  1295.     #[inline]
  1296.     pub fn set_TranslateGvaPageCallbackGpaIsNotAligned(&mut self, val: UINT32) {
  1297.         unsafe {
  1298.             let val: u32 = ::std::mem::transmute(val);
  1299.             self._bitfield_1.set(5usize, 1u8, val as u64)
  1300.         }
  1301.     }
  1302.     #[inline]
  1303.     pub fn GetVirtualProcessorRegistersCallbackFailed(&self) -> UINT32 {
  1304.         unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u32) }
  1305.     }
  1306.     #[inline]
  1307.     pub fn set_GetVirtualProcessorRegistersCallbackFailed(&mut self, val: UINT32) {
  1308.         unsafe {
  1309.             let val: u32 = ::std::mem::transmute(val);
  1310.             self._bitfield_1.set(6usize, 1u8, val as u64)
  1311.         }
  1312.     }
  1313.     #[inline]
  1314.     pub fn SetVirtualProcessorRegistersCallbackFailed(&self) -> UINT32 {
  1315.         unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u32) }
  1316.     }
  1317.     #[inline]
  1318.     pub fn set_SetVirtualProcessorRegistersCallbackFailed(&mut self, val: UINT32) {
  1319.         unsafe {
  1320.             let val: u32 = ::std::mem::transmute(val);
  1321.             self._bitfield_1.set(7usize, 1u8, val as u64)
  1322.         }
  1323.     }
  1324.     #[inline]
  1325.     pub fn InterruptCausedIntercept(&self) -> UINT32 {
  1326.         unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u32) }
  1327.     }
  1328.     #[inline]
  1329.     pub fn set_InterruptCausedIntercept(&mut self, val: UINT32) {
  1330.         unsafe {
  1331.             let val: u32 = ::std::mem::transmute(val);
  1332.             self._bitfield_1.set(8usize, 1u8, val as u64)
  1333.         }
  1334.     }
  1335.     #[inline]
  1336.     pub fn GuestCannotBeFaulted(&self) -> UINT32 {
  1337.         unsafe { ::std::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u32) }
  1338.     }
  1339.     #[inline]
  1340.     pub fn set_GuestCannotBeFaulted(&mut self, val: UINT32) {
  1341.         unsafe {
  1342.             let val: u32 = ::std::mem::transmute(val);
  1343.             self._bitfield_1.set(9usize, 1u8, val as u64)
  1344.         }
  1345.     }
  1346.     #[inline]
  1347.     pub fn Reserved(&self) -> UINT32 {
  1348.         unsafe { ::std::mem::transmute(self._bitfield_1.get(10usize, 22u8) as u32) }
  1349.     }
  1350.     #[inline]
  1351.     pub fn set_Reserved(&mut self, val: UINT32) {
  1352.         unsafe {
  1353.             let val: u32 = ::std::mem::transmute(val);
  1354.             self._bitfield_1.set(10usize, 22u8, val as u64)
  1355.         }
  1356.     }
  1357.     #[inline]
  1358.     pub fn new_bitfield_1(
  1359.         EmulationSuccessful: UINT32,
  1360.         InternalEmulationFailure: UINT32,
  1361.         IoPortCallbackFailed: UINT32,
  1362.         MemoryCallbackFailed: UINT32,
  1363.         TranslateGvaPageCallbackFailed: UINT32,
  1364.         TranslateGvaPageCallbackGpaIsNotAligned: UINT32,
  1365.         GetVirtualProcessorRegistersCallbackFailed: UINT32,
  1366.         SetVirtualProcessorRegistersCallbackFailed: UINT32,
  1367.         InterruptCausedIntercept: UINT32,
  1368.         GuestCannotBeFaulted: UINT32,
  1369.         Reserved: UINT32,
  1370.     ) -> __BindgenBitfieldUnit<[u8; 4usize], u32> {
  1371.         let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u32> =
  1372.             Default::default();
  1373.         __bindgen_bitfield_unit.set(0usize, 1u8, {
  1374.             let EmulationSuccessful: u32 = unsafe { ::std::mem::transmute(EmulationSuccessful) };
  1375.             EmulationSuccessful as u64
  1376.         });
  1377.         __bindgen_bitfield_unit.set(1usize, 1u8, {
  1378.             let InternalEmulationFailure: u32 =
  1379.                 unsafe { ::std::mem::transmute(InternalEmulationFailure) };
  1380.             InternalEmulationFailure as u64
  1381.         });
  1382.         __bindgen_bitfield_unit.set(2usize, 1u8, {
  1383.             let IoPortCallbackFailed: u32 = unsafe { ::std::mem::transmute(IoPortCallbackFailed) };
  1384.             IoPortCallbackFailed as u64
  1385.         });
  1386.         __bindgen_bitfield_unit.set(3usize, 1u8, {
  1387.             let MemoryCallbackFailed: u32 = unsafe { ::std::mem::transmute(MemoryCallbackFailed) };
  1388.             MemoryCallbackFailed as u64
  1389.         });
  1390.         __bindgen_bitfield_unit.set(4usize, 1u8, {
  1391.             let TranslateGvaPageCallbackFailed: u32 =
  1392.                 unsafe { ::std::mem::transmute(TranslateGvaPageCallbackFailed) };
  1393.             TranslateGvaPageCallbackFailed as u64
  1394.         });
  1395.         __bindgen_bitfield_unit.set(5usize, 1u8, {
  1396.             let TranslateGvaPageCallbackGpaIsNotAligned: u32 =
  1397.                 unsafe { ::std::mem::transmute(TranslateGvaPageCallbackGpaIsNotAligned) };
  1398.             TranslateGvaPageCallbackGpaIsNotAligned as u64
  1399.         });
  1400.         __bindgen_bitfield_unit.set(6usize, 1u8, {
  1401.             let GetVirtualProcessorRegistersCallbackFailed: u32 =
  1402.                 unsafe { ::std::mem::transmute(GetVirtualProcessorRegistersCallbackFailed) };
  1403.             GetVirtualProcessorRegistersCallbackFailed as u64
  1404.         });
  1405.         __bindgen_bitfield_unit.set(7usize, 1u8, {
  1406.             let SetVirtualProcessorRegistersCallbackFailed: u32 =
  1407.                 unsafe { ::std::mem::transmute(SetVirtualProcessorRegistersCallbackFailed) };
  1408.             SetVirtualProcessorRegistersCallbackFailed as u64
  1409.         });
  1410.         __bindgen_bitfield_unit.set(8usize, 1u8, {
  1411.             let InterruptCausedIntercept: u32 =
  1412.                 unsafe { ::std::mem::transmute(InterruptCausedIntercept) };
  1413.             InterruptCausedIntercept as u64
  1414.         });
  1415.         __bindgen_bitfield_unit.set(9usize, 1u8, {
  1416.             let GuestCannotBeFaulted: u32 = unsafe { ::std::mem::transmute(GuestCannotBeFaulted) };
  1417.             GuestCannotBeFaulted as u64
  1418.         });
  1419.         __bindgen_bitfield_unit.set(10usize, 22u8, {
  1420.             let Reserved: u32 = unsafe { ::std::mem::transmute(Reserved) };
  1421.             Reserved as u64
  1422.         });
  1423.         __bindgen_bitfield_unit
  1424.     }
  1425. }
  1426. #[repr(C)]
  1427. #[derive(Debug, Copy, Clone)]
  1428. pub struct WHV_EMULATOR_MEMORY_ACCESS_INFO {
  1429.     pub GpaAddress: WHV_GUEST_PHYSICAL_ADDRESS,
  1430.     pub Direction: UINT8,
  1431.     pub AccessSize: UINT8,
  1432.     pub Data: [UINT8; 8usize],
  1433. }
  1434. #[repr(C)]
  1435. #[derive(Debug, Copy, Clone)]
  1436. pub struct WHV_EMULATOR_IO_ACCESS_INFO {
  1437.     pub Direction: UINT8,
  1438.     pub Port: UINT16,
  1439.     pub AccessSize: UINT16,
  1440.     pub Data: UINT32,
  1441. }
  1442. pub type WHV_EMULATOR_IO_PORT_CALLBACK =
  1443.     ::std::option::Option<
  1444.         unsafe extern "C" fn(Context: *mut ::std::os::raw::c_void,
  1445.                              IoAccess: *mut WHV_EMULATOR_IO_ACCESS_INFO)
  1446.                              -> HRESULT,
  1447.     >;
  1448. pub type WHV_EMULATOR_MEMORY_CALLBACK =
  1449.     ::std::option::Option<
  1450.         unsafe extern "C" fn(Context: *mut ::std::os::raw::c_void,
  1451.                              MemoryAccess: *mut WHV_EMULATOR_MEMORY_ACCESS_INFO)
  1452.                              -> HRESULT,
  1453.     >;
  1454. pub type WHV_EMULATOR_GET_VIRTUAL_PROCESSOR_REGISTERS_CALLBACK =
  1455.     ::std::option::Option<
  1456.         unsafe extern "C" fn(Context: *mut ::std::os::raw::c_void,
  1457.                              RegisterNames: *const WHV_REGISTER_NAME,
  1458.                              RegisterCount: UINT32,
  1459.                              RegisterValues: *mut WHV_REGISTER_VALUE)
  1460.                              -> HRESULT,
  1461.     >;
  1462. pub type WHV_EMULATOR_SET_VIRTUAL_PROCESSOR_REGISTERS_CALLBACK =
  1463.     ::std::option::Option<
  1464.         unsafe extern "C" fn(Context: *mut ::std::os::raw::c_void,
  1465.                              RegisterNames: *const WHV_REGISTER_NAME,
  1466.                              RegisterCount: UINT32,
  1467.                              RegisterValues: *const WHV_REGISTER_VALUE)
  1468.                              -> HRESULT,
  1469.     >;
  1470. pub type WHV_EMULATOR_TRANSLATE_GVA_PAGE_CALLBACK = :: std :: option :: Option < unsafe extern "C" fn ( Context : * mut :: std :: os :: raw :: c_void , Gva : WHV_GUEST_VIRTUAL_ADDRESS , TranslateFlags : WHV_TRANSLATE_GVA_FLAGS , TranslationResult : * mut WHV_TRANSLATE_GVA_RESULT_CODE , Gpa : * mut WHV_GUEST_PHYSICAL_ADDRESS ) -> HRESULT > ;
  1471. #[repr(C)]
  1472. #[derive(Debug, Copy, Clone)]
  1473. pub struct WHV_EMULATOR_CALLBACKS {
  1474.     pub Size: UINT32,
  1475.     pub Reserved: UINT32,
  1476.     pub WHvEmulatorIoPortCallback: WHV_EMULATOR_IO_PORT_CALLBACK,
  1477.     pub WHvEmulatorMemoryCallback: WHV_EMULATOR_MEMORY_CALLBACK,
  1478.     pub WHvEmulatorGetVirtualProcessorRegisters:
  1479.         WHV_EMULATOR_GET_VIRTUAL_PROCESSOR_REGISTERS_CALLBACK,
  1480.     pub WHvEmulatorSetVirtualProcessorRegisters:
  1481.         WHV_EMULATOR_SET_VIRTUAL_PROCESSOR_REGISTERS_CALLBACK,
  1482.     pub WHvEmulatorTranslateGvaPage: WHV_EMULATOR_TRANSLATE_GVA_PAGE_CALLBACK,
  1483. }
  1484. pub type WHV_EMULATOR_HANDLE = *mut ::std::os::raw::c_void;
  1485. extern "C" {
  1486.     pub fn WHvEmulatorCreateEmulator(
  1487.         Callbacks: *const WHV_EMULATOR_CALLBACKS,
  1488.         Emulator: *mut WHV_EMULATOR_HANDLE,
  1489.     ) -> HRESULT;
  1490. }
  1491. extern "C" {
  1492.     pub fn WHvEmulatorDestroyEmulator(Emulator: WHV_EMULATOR_HANDLE) -> HRESULT;
  1493. }
  1494. extern "C" {
  1495.     pub fn WHvEmulatorTryIoEmulation(
  1496.         Emulator: WHV_EMULATOR_HANDLE,
  1497.         Context: *mut ::std::os::raw::c_void,
  1498.         VpContext: *const WHV_VP_EXIT_CONTEXT,
  1499.         IoInstructionContext: *const WHV_X64_IO_PORT_ACCESS_CONTEXT,
  1500.         EmulatorReturnStatus: *mut WHV_EMULATOR_STATUS,
  1501.     ) -> HRESULT;
  1502. }
  1503. extern "C" {
  1504.     pub fn WHvEmulatorTryMmioEmulation(
  1505.         Emulator: WHV_EMULATOR_HANDLE,
  1506.         Context: *mut ::std::os::raw::c_void,
  1507.         VpContext: *const WHV_VP_EXIT_CONTEXT,
  1508.         MmioInstructionContext: *const WHV_MEMORY_ACCESS_CONTEXT,
  1509.         EmulatorReturnStatus: *mut WHV_EMULATOR_STATUS,
  1510.     ) -> HRESULT;
  1511. }
  1512. extern "C" {
  1513.     pub fn IsWHvEmulatorCreateEmulatorPresent() -> BOOLEAN;
  1514. }
  1515. extern "C" {
  1516.     pub fn IsWHvEmulatorDestroyEmulatorPresent() -> BOOLEAN;
  1517. }
  1518. extern "C" {
  1519.     pub fn IsWHvEmulatorTryIoEmulationPresent() -> BOOLEAN;
  1520. }
  1521. extern "C" {
  1522.     pub fn IsWHvEmulatorTryMmioEmulationPresent() -> BOOLEAN;
  1523. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top