1 | /* iig(DriverKit-286 Mar 29 2024 10:27:09) generated from IOService.iig */ |
2 | |
3 | #undef IIG_IMPLEMENTATION |
4 | #define IIG_IMPLEMENTATION IOService.iig |
5 | |
6 | #if KERNEL |
7 | #include <libkern/c++/OSString.h> |
8 | #else |
9 | #include <DriverKit/DriverKit.h> |
10 | #endif /* KERNEL */ |
11 | #include <DriverKit/IOReturn.h> |
12 | #include <DriverKit/IOService.h> |
13 | |
14 | /* @iig implementation */ |
15 | #include <DriverKit/IODispatchQueue.h> |
16 | #include <DriverKit/IOUserClient.h> |
17 | #include <DriverKit/IOServiceStateNotificationDispatchSource.h> |
18 | /* @iig end */ |
19 | |
20 | |
21 | #if __has_builtin(__builtin_load_member_function_pointer) |
22 | #define SimpleMemberFunctionCast(cfnty, self, func) (cfnty)__builtin_load_member_function_pointer(self, func) |
23 | #else |
24 | #define SimpleMemberFunctionCast(cfnty, self, func) ({ union { typeof(func) memfun; cfnty cfun; } pair; pair.memfun = func; pair.cfun; }) |
25 | #endif |
26 | |
27 | |
28 | struct IOService_Start_Msg_Content |
29 | { |
30 | IORPCMessage __hdr; |
31 | OSObjectRef __object; |
32 | OSObjectRef provider; |
33 | }; |
34 | #pragma pack(4) |
35 | struct IOService_Start_Msg |
36 | { |
37 | IORPCMessageMach mach; |
38 | mach_msg_port_descriptor_t __object__descriptor; |
39 | mach_msg_port_descriptor_t provider__descriptor; |
40 | IOService_Start_Msg_Content content; |
41 | }; |
42 | #pragma pack() |
43 | #define IOService_Start_Msg_ObjRefs (2) |
44 | |
45 | struct IOService_Start_Rpl_Content |
46 | { |
47 | IORPCMessage __hdr; |
48 | }; |
49 | #pragma pack(4) |
50 | struct IOService_Start_Rpl |
51 | { |
52 | IORPCMessageMach mach; |
53 | IOService_Start_Rpl_Content content; |
54 | }; |
55 | #pragma pack() |
56 | #define IOService_Start_Rpl_ObjRefs (0) |
57 | |
58 | |
59 | typedef union |
60 | { |
61 | const IORPC rpc; |
62 | struct |
63 | { |
64 | const struct IOService_Start_Msg * message; |
65 | struct IOService_Start_Rpl * reply; |
66 | uint32_t sendSize; |
67 | uint32_t replySize; |
68 | }; |
69 | } |
70 | IOService_Start_Invocation; |
71 | struct IOService_Stop_Msg_Content |
72 | { |
73 | IORPCMessage __hdr; |
74 | OSObjectRef __object; |
75 | OSObjectRef provider; |
76 | }; |
77 | #pragma pack(4) |
78 | struct IOService_Stop_Msg |
79 | { |
80 | IORPCMessageMach mach; |
81 | mach_msg_port_descriptor_t __object__descriptor; |
82 | mach_msg_port_descriptor_t provider__descriptor; |
83 | IOService_Stop_Msg_Content content; |
84 | }; |
85 | #pragma pack() |
86 | #define IOService_Stop_Msg_ObjRefs (2) |
87 | |
88 | struct IOService_Stop_Rpl_Content |
89 | { |
90 | IORPCMessage __hdr; |
91 | }; |
92 | #pragma pack(4) |
93 | struct IOService_Stop_Rpl |
94 | { |
95 | IORPCMessageMach mach; |
96 | IOService_Stop_Rpl_Content content; |
97 | }; |
98 | #pragma pack() |
99 | #define IOService_Stop_Rpl_ObjRefs (0) |
100 | |
101 | |
102 | typedef union |
103 | { |
104 | const IORPC rpc; |
105 | struct |
106 | { |
107 | const struct IOService_Stop_Msg * message; |
108 | struct IOService_Stop_Rpl * reply; |
109 | uint32_t sendSize; |
110 | uint32_t replySize; |
111 | }; |
112 | } |
113 | IOService_Stop_Invocation; |
114 | struct IOService_ClientCrashed_Msg_Content |
115 | { |
116 | IORPCMessage __hdr; |
117 | OSObjectRef __object; |
118 | OSObjectRef client; |
119 | uint64_t options; |
120 | }; |
121 | #pragma pack(4) |
122 | struct IOService_ClientCrashed_Msg |
123 | { |
124 | IORPCMessageMach mach; |
125 | mach_msg_port_descriptor_t __object__descriptor; |
126 | mach_msg_port_descriptor_t client__descriptor; |
127 | IOService_ClientCrashed_Msg_Content content; |
128 | }; |
129 | #pragma pack() |
130 | #define IOService_ClientCrashed_Msg_ObjRefs (2) |
131 | |
132 | struct IOService_ClientCrashed_Rpl_Content |
133 | { |
134 | IORPCMessage __hdr; |
135 | }; |
136 | #pragma pack(4) |
137 | struct IOService_ClientCrashed_Rpl |
138 | { |
139 | IORPCMessageMach mach; |
140 | IOService_ClientCrashed_Rpl_Content content; |
141 | }; |
142 | #pragma pack() |
143 | #define IOService_ClientCrashed_Rpl_ObjRefs (0) |
144 | |
145 | |
146 | typedef union |
147 | { |
148 | const IORPC rpc; |
149 | struct |
150 | { |
151 | const struct IOService_ClientCrashed_Msg * message; |
152 | struct IOService_ClientCrashed_Rpl * reply; |
153 | uint32_t sendSize; |
154 | uint32_t replySize; |
155 | }; |
156 | } |
157 | IOService_ClientCrashed_Invocation; |
158 | struct IOService_GetRegistryEntryID_Msg_Content |
159 | { |
160 | IORPCMessage __hdr; |
161 | OSObjectRef __object; |
162 | }; |
163 | #pragma pack(4) |
164 | struct IOService_GetRegistryEntryID_Msg |
165 | { |
166 | IORPCMessageMach mach; |
167 | mach_msg_port_descriptor_t __object__descriptor; |
168 | IOService_GetRegistryEntryID_Msg_Content content; |
169 | }; |
170 | #pragma pack() |
171 | #define IOService_GetRegistryEntryID_Msg_ObjRefs (1) |
172 | |
173 | struct IOService_GetRegistryEntryID_Rpl_Content |
174 | { |
175 | IORPCMessage __hdr; |
176 | unsigned long long registryEntryID; |
177 | }; |
178 | #pragma pack(4) |
179 | struct IOService_GetRegistryEntryID_Rpl |
180 | { |
181 | IORPCMessageMach mach; |
182 | IOService_GetRegistryEntryID_Rpl_Content content; |
183 | }; |
184 | #pragma pack() |
185 | #define IOService_GetRegistryEntryID_Rpl_ObjRefs (0) |
186 | |
187 | |
188 | typedef union |
189 | { |
190 | const IORPC rpc; |
191 | struct |
192 | { |
193 | const struct IOService_GetRegistryEntryID_Msg * message; |
194 | struct IOService_GetRegistryEntryID_Rpl * reply; |
195 | uint32_t sendSize; |
196 | uint32_t replySize; |
197 | }; |
198 | } |
199 | IOService_GetRegistryEntryID_Invocation; |
200 | struct IOService_SetName_Msg_Content |
201 | { |
202 | IORPCMessage __hdr; |
203 | OSObjectRef __object; |
204 | const char * name; |
205 | #if !defined(__LP64__) |
206 | uint32_t __namePad; |
207 | #endif /* !defined(__LP64__) */ |
208 | char __name[128]; |
209 | }; |
210 | #pragma pack(4) |
211 | struct IOService_SetName_Msg |
212 | { |
213 | IORPCMessageMach mach; |
214 | mach_msg_port_descriptor_t __object__descriptor; |
215 | IOService_SetName_Msg_Content content; |
216 | }; |
217 | #pragma pack() |
218 | #define IOService_SetName_Msg_ObjRefs (1) |
219 | |
220 | struct IOService_SetName_Rpl_Content |
221 | { |
222 | IORPCMessage __hdr; |
223 | }; |
224 | #pragma pack(4) |
225 | struct IOService_SetName_Rpl |
226 | { |
227 | IORPCMessageMach mach; |
228 | IOService_SetName_Rpl_Content content; |
229 | }; |
230 | #pragma pack() |
231 | #define IOService_SetName_Rpl_ObjRefs (0) |
232 | |
233 | |
234 | typedef union |
235 | { |
236 | const IORPC rpc; |
237 | struct |
238 | { |
239 | const struct IOService_SetName_Msg * message; |
240 | struct IOService_SetName_Rpl * reply; |
241 | uint32_t sendSize; |
242 | uint32_t replySize; |
243 | }; |
244 | } |
245 | IOService_SetName_Invocation; |
246 | struct IOService_RegisterService_Msg_Content |
247 | { |
248 | IORPCMessage __hdr; |
249 | OSObjectRef __object; |
250 | }; |
251 | #pragma pack(4) |
252 | struct IOService_RegisterService_Msg |
253 | { |
254 | IORPCMessageMach mach; |
255 | mach_msg_port_descriptor_t __object__descriptor; |
256 | IOService_RegisterService_Msg_Content content; |
257 | }; |
258 | #pragma pack() |
259 | #define IOService_RegisterService_Msg_ObjRefs (1) |
260 | |
261 | struct IOService_RegisterService_Rpl_Content |
262 | { |
263 | IORPCMessage __hdr; |
264 | }; |
265 | #pragma pack(4) |
266 | struct IOService_RegisterService_Rpl |
267 | { |
268 | IORPCMessageMach mach; |
269 | IOService_RegisterService_Rpl_Content content; |
270 | }; |
271 | #pragma pack() |
272 | #define IOService_RegisterService_Rpl_ObjRefs (0) |
273 | |
274 | |
275 | typedef union |
276 | { |
277 | const IORPC rpc; |
278 | struct |
279 | { |
280 | const struct IOService_RegisterService_Msg * message; |
281 | struct IOService_RegisterService_Rpl * reply; |
282 | uint32_t sendSize; |
283 | uint32_t replySize; |
284 | }; |
285 | } |
286 | IOService_RegisterService_Invocation; |
287 | struct IOService_CreateDefaultDispatchQueue_Msg_Content |
288 | { |
289 | IORPCMessage __hdr; |
290 | OSObjectRef __object; |
291 | }; |
292 | #pragma pack(4) |
293 | struct IOService_CreateDefaultDispatchQueue_Msg |
294 | { |
295 | IORPCMessageMach mach; |
296 | mach_msg_port_descriptor_t __object__descriptor; |
297 | IOService_CreateDefaultDispatchQueue_Msg_Content content; |
298 | }; |
299 | #pragma pack() |
300 | #define IOService_CreateDefaultDispatchQueue_Msg_ObjRefs (1) |
301 | |
302 | struct IOService_CreateDefaultDispatchQueue_Rpl_Content |
303 | { |
304 | IORPCMessage __hdr; |
305 | OSObjectRef queue; |
306 | }; |
307 | #pragma pack(4) |
308 | struct IOService_CreateDefaultDispatchQueue_Rpl |
309 | { |
310 | IORPCMessageMach mach; |
311 | mach_msg_port_descriptor_t queue__descriptor; |
312 | IOService_CreateDefaultDispatchQueue_Rpl_Content content; |
313 | }; |
314 | #pragma pack() |
315 | #define IOService_CreateDefaultDispatchQueue_Rpl_ObjRefs (1) |
316 | |
317 | |
318 | typedef union |
319 | { |
320 | const IORPC rpc; |
321 | struct |
322 | { |
323 | const struct IOService_CreateDefaultDispatchQueue_Msg * message; |
324 | struct IOService_CreateDefaultDispatchQueue_Rpl * reply; |
325 | uint32_t sendSize; |
326 | uint32_t replySize; |
327 | }; |
328 | } |
329 | IOService_CreateDefaultDispatchQueue_Invocation; |
330 | struct IOService_CopyProperties_Msg_Content |
331 | { |
332 | IORPCMessage __hdr; |
333 | OSObjectRef __object; |
334 | }; |
335 | #pragma pack(4) |
336 | struct IOService_CopyProperties_Msg |
337 | { |
338 | IORPCMessageMach mach; |
339 | mach_msg_port_descriptor_t __object__descriptor; |
340 | IOService_CopyProperties_Msg_Content content; |
341 | }; |
342 | #pragma pack() |
343 | #define IOService_CopyProperties_Msg_ObjRefs (1) |
344 | |
345 | struct IOService_CopyProperties_Rpl_Content |
346 | { |
347 | IORPCMessage __hdr; |
348 | OSDictionary * properties; |
349 | #if !defined(__LP64__) |
350 | uint32_t __propertiesPad; |
351 | #endif /* !defined(__LP64__) */ |
352 | }; |
353 | #pragma pack(4) |
354 | struct IOService_CopyProperties_Rpl |
355 | { |
356 | IORPCMessageMach mach; |
357 | mach_msg_ool_descriptor_t properties__descriptor; |
358 | IOService_CopyProperties_Rpl_Content content; |
359 | }; |
360 | #pragma pack() |
361 | #define IOService_CopyProperties_Rpl_ObjRefs (1) |
362 | |
363 | |
364 | typedef union |
365 | { |
366 | const IORPC rpc; |
367 | struct |
368 | { |
369 | const struct IOService_CopyProperties_Msg * message; |
370 | struct IOService_CopyProperties_Rpl * reply; |
371 | uint32_t sendSize; |
372 | uint32_t replySize; |
373 | }; |
374 | } |
375 | IOService_CopyProperties_Invocation; |
376 | struct IOService_SearchProperty_Msg_Content |
377 | { |
378 | IORPCMessage __hdr; |
379 | OSObjectRef __object; |
380 | const char * name; |
381 | #if !defined(__LP64__) |
382 | uint32_t __namePad; |
383 | #endif /* !defined(__LP64__) */ |
384 | char __name[128]; |
385 | const char * plane; |
386 | #if !defined(__LP64__) |
387 | uint32_t __planePad; |
388 | #endif /* !defined(__LP64__) */ |
389 | char __plane[128]; |
390 | uint64_t options; |
391 | }; |
392 | #pragma pack(4) |
393 | struct IOService_SearchProperty_Msg |
394 | { |
395 | IORPCMessageMach mach; |
396 | mach_msg_port_descriptor_t __object__descriptor; |
397 | IOService_SearchProperty_Msg_Content content; |
398 | }; |
399 | #pragma pack() |
400 | #define IOService_SearchProperty_Msg_ObjRefs (1) |
401 | |
402 | struct IOService_SearchProperty_Rpl_Content |
403 | { |
404 | IORPCMessage __hdr; |
405 | OSContainer * property; |
406 | #if !defined(__LP64__) |
407 | uint32_t __propertyPad; |
408 | #endif /* !defined(__LP64__) */ |
409 | }; |
410 | #pragma pack(4) |
411 | struct IOService_SearchProperty_Rpl |
412 | { |
413 | IORPCMessageMach mach; |
414 | mach_msg_ool_descriptor_t property__descriptor; |
415 | IOService_SearchProperty_Rpl_Content content; |
416 | }; |
417 | #pragma pack() |
418 | #define IOService_SearchProperty_Rpl_ObjRefs (1) |
419 | |
420 | |
421 | typedef union |
422 | { |
423 | const IORPC rpc; |
424 | struct |
425 | { |
426 | const struct IOService_SearchProperty_Msg * message; |
427 | struct IOService_SearchProperty_Rpl * reply; |
428 | uint32_t sendSize; |
429 | uint32_t replySize; |
430 | }; |
431 | } |
432 | IOService_SearchProperty_Invocation; |
433 | struct IOService_SetProperties_Msg_Content |
434 | { |
435 | IORPCMessage __hdr; |
436 | OSObjectRef __object; |
437 | OSDictionary * properties; |
438 | #if !defined(__LP64__) |
439 | uint32_t __propertiesPad; |
440 | #endif /* !defined(__LP64__) */ |
441 | }; |
442 | #pragma pack(4) |
443 | struct IOService_SetProperties_Msg |
444 | { |
445 | IORPCMessageMach mach; |
446 | mach_msg_port_descriptor_t __object__descriptor; |
447 | mach_msg_ool_descriptor_t properties__descriptor; |
448 | IOService_SetProperties_Msg_Content content; |
449 | }; |
450 | #pragma pack() |
451 | #define IOService_SetProperties_Msg_ObjRefs (2) |
452 | |
453 | struct IOService_SetProperties_Rpl_Content |
454 | { |
455 | IORPCMessage __hdr; |
456 | }; |
457 | #pragma pack(4) |
458 | struct IOService_SetProperties_Rpl |
459 | { |
460 | IORPCMessageMach mach; |
461 | IOService_SetProperties_Rpl_Content content; |
462 | }; |
463 | #pragma pack() |
464 | #define IOService_SetProperties_Rpl_ObjRefs (0) |
465 | |
466 | |
467 | typedef union |
468 | { |
469 | const IORPC rpc; |
470 | struct |
471 | { |
472 | const struct IOService_SetProperties_Msg * message; |
473 | struct IOService_SetProperties_Rpl * reply; |
474 | uint32_t sendSize; |
475 | uint32_t replySize; |
476 | }; |
477 | } |
478 | IOService_SetProperties_Invocation; |
479 | struct IOService_JoinPMTree_Msg_Content |
480 | { |
481 | IORPCMessage __hdr; |
482 | OSObjectRef __object; |
483 | }; |
484 | #pragma pack(4) |
485 | struct IOService_JoinPMTree_Msg |
486 | { |
487 | IORPCMessageMach mach; |
488 | mach_msg_port_descriptor_t __object__descriptor; |
489 | IOService_JoinPMTree_Msg_Content content; |
490 | }; |
491 | #pragma pack() |
492 | #define IOService_JoinPMTree_Msg_ObjRefs (1) |
493 | |
494 | struct IOService_JoinPMTree_Rpl_Content |
495 | { |
496 | IORPCMessage __hdr; |
497 | }; |
498 | #pragma pack(4) |
499 | struct IOService_JoinPMTree_Rpl |
500 | { |
501 | IORPCMessageMach mach; |
502 | IOService_JoinPMTree_Rpl_Content content; |
503 | }; |
504 | #pragma pack() |
505 | #define IOService_JoinPMTree_Rpl_ObjRefs (0) |
506 | |
507 | |
508 | typedef union |
509 | { |
510 | const IORPC rpc; |
511 | struct |
512 | { |
513 | const struct IOService_JoinPMTree_Msg * message; |
514 | struct IOService_JoinPMTree_Rpl * reply; |
515 | uint32_t sendSize; |
516 | uint32_t replySize; |
517 | }; |
518 | } |
519 | IOService_JoinPMTree_Invocation; |
520 | struct IOService_SetPowerState_Msg_Content |
521 | { |
522 | IORPCMessage __hdr; |
523 | OSObjectRef __object; |
524 | uint32_t powerFlags; |
525 | }; |
526 | #pragma pack(4) |
527 | struct IOService_SetPowerState_Msg |
528 | { |
529 | IORPCMessageMach mach; |
530 | mach_msg_port_descriptor_t __object__descriptor; |
531 | IOService_SetPowerState_Msg_Content content; |
532 | }; |
533 | #pragma pack() |
534 | #define IOService_SetPowerState_Msg_ObjRefs (1) |
535 | |
536 | struct IOService_SetPowerState_Rpl_Content |
537 | { |
538 | IORPCMessage __hdr; |
539 | }; |
540 | #pragma pack(4) |
541 | struct IOService_SetPowerState_Rpl |
542 | { |
543 | IORPCMessageMach mach; |
544 | IOService_SetPowerState_Rpl_Content content; |
545 | }; |
546 | #pragma pack() |
547 | #define IOService_SetPowerState_Rpl_ObjRefs (0) |
548 | |
549 | |
550 | typedef union |
551 | { |
552 | const IORPC rpc; |
553 | struct |
554 | { |
555 | const struct IOService_SetPowerState_Msg * message; |
556 | struct IOService_SetPowerState_Rpl * reply; |
557 | uint32_t sendSize; |
558 | uint32_t replySize; |
559 | }; |
560 | } |
561 | IOService_SetPowerState_Invocation; |
562 | struct IOService_ChangePowerState_Msg_Content |
563 | { |
564 | IORPCMessage __hdr; |
565 | OSObjectRef __object; |
566 | uint32_t powerFlags; |
567 | }; |
568 | #pragma pack(4) |
569 | struct IOService_ChangePowerState_Msg |
570 | { |
571 | IORPCMessageMach mach; |
572 | mach_msg_port_descriptor_t __object__descriptor; |
573 | IOService_ChangePowerState_Msg_Content content; |
574 | }; |
575 | #pragma pack() |
576 | #define IOService_ChangePowerState_Msg_ObjRefs (1) |
577 | |
578 | struct IOService_ChangePowerState_Rpl_Content |
579 | { |
580 | IORPCMessage __hdr; |
581 | }; |
582 | #pragma pack(4) |
583 | struct IOService_ChangePowerState_Rpl |
584 | { |
585 | IORPCMessageMach mach; |
586 | IOService_ChangePowerState_Rpl_Content content; |
587 | }; |
588 | #pragma pack() |
589 | #define IOService_ChangePowerState_Rpl_ObjRefs (0) |
590 | |
591 | |
592 | typedef union |
593 | { |
594 | const IORPC rpc; |
595 | struct |
596 | { |
597 | const struct IOService_ChangePowerState_Msg * message; |
598 | struct IOService_ChangePowerState_Rpl * reply; |
599 | uint32_t sendSize; |
600 | uint32_t replySize; |
601 | }; |
602 | } |
603 | IOService_ChangePowerState_Invocation; |
604 | struct IOService_NewUserClient_Msg_Content |
605 | { |
606 | IORPCMessage __hdr; |
607 | OSObjectRef __object; |
608 | uint32_t type; |
609 | }; |
610 | #pragma pack(4) |
611 | struct IOService_NewUserClient_Msg |
612 | { |
613 | IORPCMessageMach mach; |
614 | mach_msg_port_descriptor_t __object__descriptor; |
615 | IOService_NewUserClient_Msg_Content content; |
616 | }; |
617 | #pragma pack() |
618 | #define IOService_NewUserClient_Msg_ObjRefs (1) |
619 | |
620 | struct IOService_NewUserClient_Rpl_Content |
621 | { |
622 | IORPCMessage __hdr; |
623 | OSObjectRef userClient; |
624 | }; |
625 | #pragma pack(4) |
626 | struct IOService_NewUserClient_Rpl |
627 | { |
628 | IORPCMessageMach mach; |
629 | mach_msg_port_descriptor_t userClient__descriptor; |
630 | IOService_NewUserClient_Rpl_Content content; |
631 | }; |
632 | #pragma pack() |
633 | #define IOService_NewUserClient_Rpl_ObjRefs (1) |
634 | |
635 | |
636 | typedef union |
637 | { |
638 | const IORPC rpc; |
639 | struct |
640 | { |
641 | const struct IOService_NewUserClient_Msg * message; |
642 | struct IOService_NewUserClient_Rpl * reply; |
643 | uint32_t sendSize; |
644 | uint32_t replySize; |
645 | }; |
646 | } |
647 | IOService_NewUserClient_Invocation; |
648 | struct IOService_Create_Msg_Content |
649 | { |
650 | IORPCMessage __hdr; |
651 | OSObjectRef __object; |
652 | OSObjectRef provider; |
653 | const char * propertiesKey; |
654 | #if !defined(__LP64__) |
655 | uint32_t __propertiesKeyPad; |
656 | #endif /* !defined(__LP64__) */ |
657 | char __propertiesKey[128]; |
658 | }; |
659 | #pragma pack(4) |
660 | struct IOService_Create_Msg |
661 | { |
662 | IORPCMessageMach mach; |
663 | mach_msg_port_descriptor_t __object__descriptor; |
664 | mach_msg_port_descriptor_t provider__descriptor; |
665 | IOService_Create_Msg_Content content; |
666 | }; |
667 | #pragma pack() |
668 | #define IOService_Create_Msg_ObjRefs (2) |
669 | |
670 | struct IOService_Create_Rpl_Content |
671 | { |
672 | IORPCMessage __hdr; |
673 | OSObjectRef result; |
674 | }; |
675 | #pragma pack(4) |
676 | struct IOService_Create_Rpl |
677 | { |
678 | IORPCMessageMach mach; |
679 | mach_msg_port_descriptor_t result__descriptor; |
680 | IOService_Create_Rpl_Content content; |
681 | }; |
682 | #pragma pack() |
683 | #define IOService_Create_Rpl_ObjRefs (1) |
684 | |
685 | |
686 | typedef union |
687 | { |
688 | const IORPC rpc; |
689 | struct |
690 | { |
691 | const struct IOService_Create_Msg * message; |
692 | struct IOService_Create_Rpl * reply; |
693 | uint32_t sendSize; |
694 | uint32_t replySize; |
695 | }; |
696 | } |
697 | IOService_Create_Invocation; |
698 | struct IOService_Terminate_Msg_Content |
699 | { |
700 | IORPCMessage __hdr; |
701 | OSObjectRef __object; |
702 | uint64_t options; |
703 | }; |
704 | #pragma pack(4) |
705 | struct IOService_Terminate_Msg |
706 | { |
707 | IORPCMessageMach mach; |
708 | mach_msg_port_descriptor_t __object__descriptor; |
709 | IOService_Terminate_Msg_Content content; |
710 | }; |
711 | #pragma pack() |
712 | #define IOService_Terminate_Msg_ObjRefs (1) |
713 | |
714 | struct IOService_Terminate_Rpl_Content |
715 | { |
716 | IORPCMessage __hdr; |
717 | }; |
718 | #pragma pack(4) |
719 | struct IOService_Terminate_Rpl |
720 | { |
721 | IORPCMessageMach mach; |
722 | IOService_Terminate_Rpl_Content content; |
723 | }; |
724 | #pragma pack() |
725 | #define IOService_Terminate_Rpl_ObjRefs (0) |
726 | |
727 | |
728 | typedef union |
729 | { |
730 | const IORPC rpc; |
731 | struct |
732 | { |
733 | const struct IOService_Terminate_Msg * message; |
734 | struct IOService_Terminate_Rpl * reply; |
735 | uint32_t sendSize; |
736 | uint32_t replySize; |
737 | }; |
738 | } |
739 | IOService_Terminate_Invocation; |
740 | struct IOService_CopyProviderProperties_Msg_Content |
741 | { |
742 | IORPCMessage __hdr; |
743 | OSObjectRef __object; |
744 | OSArray * propertyKeys; |
745 | #if !defined(__LP64__) |
746 | uint32_t __propertyKeysPad; |
747 | #endif /* !defined(__LP64__) */ |
748 | }; |
749 | #pragma pack(4) |
750 | struct IOService_CopyProviderProperties_Msg |
751 | { |
752 | IORPCMessageMach mach; |
753 | mach_msg_port_descriptor_t __object__descriptor; |
754 | mach_msg_ool_descriptor_t propertyKeys__descriptor; |
755 | IOService_CopyProviderProperties_Msg_Content content; |
756 | }; |
757 | #pragma pack() |
758 | #define IOService_CopyProviderProperties_Msg_ObjRefs (2) |
759 | |
760 | struct IOService_CopyProviderProperties_Rpl_Content |
761 | { |
762 | IORPCMessage __hdr; |
763 | OSArray * properties; |
764 | #if !defined(__LP64__) |
765 | uint32_t __propertiesPad; |
766 | #endif /* !defined(__LP64__) */ |
767 | }; |
768 | #pragma pack(4) |
769 | struct IOService_CopyProviderProperties_Rpl |
770 | { |
771 | IORPCMessageMach mach; |
772 | mach_msg_ool_descriptor_t properties__descriptor; |
773 | IOService_CopyProviderProperties_Rpl_Content content; |
774 | }; |
775 | #pragma pack() |
776 | #define IOService_CopyProviderProperties_Rpl_ObjRefs (1) |
777 | |
778 | |
779 | typedef union |
780 | { |
781 | const IORPC rpc; |
782 | struct |
783 | { |
784 | const struct IOService_CopyProviderProperties_Msg * message; |
785 | struct IOService_CopyProviderProperties_Rpl * reply; |
786 | uint32_t sendSize; |
787 | uint32_t replySize; |
788 | }; |
789 | } |
790 | IOService_CopyProviderProperties_Invocation; |
791 | struct IOService_RequireMaxBusStall_Msg_Content |
792 | { |
793 | IORPCMessage __hdr; |
794 | OSObjectRef __object; |
795 | uint64_t maxBusStall; |
796 | }; |
797 | #pragma pack(4) |
798 | struct IOService_RequireMaxBusStall_Msg |
799 | { |
800 | IORPCMessageMach mach; |
801 | mach_msg_port_descriptor_t __object__descriptor; |
802 | IOService_RequireMaxBusStall_Msg_Content content; |
803 | }; |
804 | #pragma pack() |
805 | #define IOService_RequireMaxBusStall_Msg_ObjRefs (1) |
806 | |
807 | struct IOService_RequireMaxBusStall_Rpl_Content |
808 | { |
809 | IORPCMessage __hdr; |
810 | }; |
811 | #pragma pack(4) |
812 | struct IOService_RequireMaxBusStall_Rpl |
813 | { |
814 | IORPCMessageMach mach; |
815 | IOService_RequireMaxBusStall_Rpl_Content content; |
816 | }; |
817 | #pragma pack() |
818 | #define IOService_RequireMaxBusStall_Rpl_ObjRefs (0) |
819 | |
820 | |
821 | typedef union |
822 | { |
823 | const IORPC rpc; |
824 | struct |
825 | { |
826 | const struct IOService_RequireMaxBusStall_Msg * message; |
827 | struct IOService_RequireMaxBusStall_Rpl * reply; |
828 | uint32_t sendSize; |
829 | uint32_t replySize; |
830 | }; |
831 | } |
832 | IOService_RequireMaxBusStall_Invocation; |
833 | struct IOService_AdjustBusy_Msg_Content |
834 | { |
835 | IORPCMessage __hdr; |
836 | OSObjectRef __object; |
837 | int32_t delta; |
838 | }; |
839 | #pragma pack(4) |
840 | struct IOService_AdjustBusy_Msg |
841 | { |
842 | IORPCMessageMach mach; |
843 | mach_msg_port_descriptor_t __object__descriptor; |
844 | IOService_AdjustBusy_Msg_Content content; |
845 | }; |
846 | #pragma pack() |
847 | #define IOService_AdjustBusy_Msg_ObjRefs (1) |
848 | |
849 | struct IOService_AdjustBusy_Rpl_Content |
850 | { |
851 | IORPCMessage __hdr; |
852 | }; |
853 | #pragma pack(4) |
854 | struct IOService_AdjustBusy_Rpl |
855 | { |
856 | IORPCMessageMach mach; |
857 | IOService_AdjustBusy_Rpl_Content content; |
858 | }; |
859 | #pragma pack() |
860 | #define IOService_AdjustBusy_Rpl_ObjRefs (0) |
861 | |
862 | |
863 | typedef union |
864 | { |
865 | const IORPC rpc; |
866 | struct |
867 | { |
868 | const struct IOService_AdjustBusy_Msg * message; |
869 | struct IOService_AdjustBusy_Rpl * reply; |
870 | uint32_t sendSize; |
871 | uint32_t replySize; |
872 | }; |
873 | } |
874 | IOService_AdjustBusy_Invocation; |
875 | struct IOService_GetBusyState_Msg_Content |
876 | { |
877 | IORPCMessage __hdr; |
878 | OSObjectRef __object; |
879 | }; |
880 | #pragma pack(4) |
881 | struct IOService_GetBusyState_Msg |
882 | { |
883 | IORPCMessageMach mach; |
884 | mach_msg_port_descriptor_t __object__descriptor; |
885 | IOService_GetBusyState_Msg_Content content; |
886 | }; |
887 | #pragma pack() |
888 | #define IOService_GetBusyState_Msg_ObjRefs (1) |
889 | |
890 | struct IOService_GetBusyState_Rpl_Content |
891 | { |
892 | IORPCMessage __hdr; |
893 | unsigned int busyState; |
894 | }; |
895 | #pragma pack(4) |
896 | struct IOService_GetBusyState_Rpl |
897 | { |
898 | IORPCMessageMach mach; |
899 | IOService_GetBusyState_Rpl_Content content; |
900 | }; |
901 | #pragma pack() |
902 | #define IOService_GetBusyState_Rpl_ObjRefs (0) |
903 | |
904 | |
905 | typedef union |
906 | { |
907 | const IORPC rpc; |
908 | struct |
909 | { |
910 | const struct IOService_GetBusyState_Msg * message; |
911 | struct IOService_GetBusyState_Rpl * reply; |
912 | uint32_t sendSize; |
913 | uint32_t replySize; |
914 | }; |
915 | } |
916 | IOService_GetBusyState_Invocation; |
917 | struct IOService_CoreAnalyticsSendEvent_Msg_Content |
918 | { |
919 | IORPCMessage __hdr; |
920 | OSObjectRef __object; |
921 | OSString * eventName; |
922 | #if !defined(__LP64__) |
923 | uint32_t __eventNamePad; |
924 | #endif /* !defined(__LP64__) */ |
925 | OSDictionary * eventPayload; |
926 | #if !defined(__LP64__) |
927 | uint32_t __eventPayloadPad; |
928 | #endif /* !defined(__LP64__) */ |
929 | uint64_t options; |
930 | }; |
931 | #pragma pack(4) |
932 | struct IOService_CoreAnalyticsSendEvent_Msg |
933 | { |
934 | IORPCMessageMach mach; |
935 | mach_msg_port_descriptor_t __object__descriptor; |
936 | mach_msg_ool_descriptor_t eventName__descriptor; |
937 | mach_msg_ool_descriptor_t eventPayload__descriptor; |
938 | IOService_CoreAnalyticsSendEvent_Msg_Content content; |
939 | }; |
940 | #pragma pack() |
941 | #define IOService_CoreAnalyticsSendEvent_Msg_ObjRefs (3) |
942 | |
943 | struct IOService_CoreAnalyticsSendEvent_Rpl_Content |
944 | { |
945 | IORPCMessage __hdr; |
946 | }; |
947 | #pragma pack(4) |
948 | struct IOService_CoreAnalyticsSendEvent_Rpl |
949 | { |
950 | IORPCMessageMach mach; |
951 | IOService_CoreAnalyticsSendEvent_Rpl_Content content; |
952 | }; |
953 | #pragma pack() |
954 | #define IOService_CoreAnalyticsSendEvent_Rpl_ObjRefs (0) |
955 | |
956 | |
957 | typedef union |
958 | { |
959 | const IORPC rpc; |
960 | struct |
961 | { |
962 | const struct IOService_CoreAnalyticsSendEvent_Msg * message; |
963 | struct IOService_CoreAnalyticsSendEvent_Rpl * reply; |
964 | uint32_t sendSize; |
965 | uint32_t replySize; |
966 | }; |
967 | } |
968 | IOService_CoreAnalyticsSendEvent_Invocation; |
969 | struct IOService_UpdateReport_Msg_Content |
970 | { |
971 | IORPCMessage __hdr; |
972 | OSObjectRef __object; |
973 | OSData * channels; |
974 | #if !defined(__LP64__) |
975 | uint32_t __channelsPad; |
976 | #endif /* !defined(__LP64__) */ |
977 | OSObjectRef buffer; |
978 | uint32_t action; |
979 | uint64_t offset; |
980 | uint64_t capacity; |
981 | }; |
982 | #pragma pack(4) |
983 | struct IOService_UpdateReport_Msg |
984 | { |
985 | IORPCMessageMach mach; |
986 | mach_msg_port_descriptor_t __object__descriptor; |
987 | mach_msg_ool_descriptor_t channels__descriptor; |
988 | mach_msg_port_descriptor_t buffer__descriptor; |
989 | IOService_UpdateReport_Msg_Content content; |
990 | }; |
991 | #pragma pack() |
992 | #define IOService_UpdateReport_Msg_ObjRefs (3) |
993 | |
994 | struct IOService_UpdateReport_Rpl_Content |
995 | { |
996 | IORPCMessage __hdr; |
997 | unsigned int outElementCount; |
998 | }; |
999 | #pragma pack(4) |
1000 | struct IOService_UpdateReport_Rpl |
1001 | { |
1002 | IORPCMessageMach mach; |
1003 | IOService_UpdateReport_Rpl_Content content; |
1004 | }; |
1005 | #pragma pack() |
1006 | #define IOService_UpdateReport_Rpl_ObjRefs (0) |
1007 | |
1008 | |
1009 | typedef union |
1010 | { |
1011 | const IORPC rpc; |
1012 | struct |
1013 | { |
1014 | const struct IOService_UpdateReport_Msg * message; |
1015 | struct IOService_UpdateReport_Rpl * reply; |
1016 | uint32_t sendSize; |
1017 | uint32_t replySize; |
1018 | }; |
1019 | } |
1020 | IOService_UpdateReport_Invocation; |
1021 | struct IOService_ConfigureReport_Msg_Content |
1022 | { |
1023 | IORPCMessage __hdr; |
1024 | OSObjectRef __object; |
1025 | OSData * channels; |
1026 | #if !defined(__LP64__) |
1027 | uint32_t __channelsPad; |
1028 | #endif /* !defined(__LP64__) */ |
1029 | uint32_t action; |
1030 | }; |
1031 | #pragma pack(4) |
1032 | struct IOService_ConfigureReport_Msg |
1033 | { |
1034 | IORPCMessageMach mach; |
1035 | mach_msg_port_descriptor_t __object__descriptor; |
1036 | mach_msg_ool_descriptor_t channels__descriptor; |
1037 | IOService_ConfigureReport_Msg_Content content; |
1038 | }; |
1039 | #pragma pack() |
1040 | #define IOService_ConfigureReport_Msg_ObjRefs (2) |
1041 | |
1042 | struct IOService_ConfigureReport_Rpl_Content |
1043 | { |
1044 | IORPCMessage __hdr; |
1045 | unsigned int outCount; |
1046 | }; |
1047 | #pragma pack(4) |
1048 | struct IOService_ConfigureReport_Rpl |
1049 | { |
1050 | IORPCMessageMach mach; |
1051 | IOService_ConfigureReport_Rpl_Content content; |
1052 | }; |
1053 | #pragma pack() |
1054 | #define IOService_ConfigureReport_Rpl_ObjRefs (0) |
1055 | |
1056 | |
1057 | typedef union |
1058 | { |
1059 | const IORPC rpc; |
1060 | struct |
1061 | { |
1062 | const struct IOService_ConfigureReport_Msg * message; |
1063 | struct IOService_ConfigureReport_Rpl * reply; |
1064 | uint32_t sendSize; |
1065 | uint32_t replySize; |
1066 | }; |
1067 | } |
1068 | IOService_ConfigureReport_Invocation; |
1069 | struct IOService_SetLegend_Msg_Content |
1070 | { |
1071 | IORPCMessage __hdr; |
1072 | OSObjectRef __object; |
1073 | OSArray * legend; |
1074 | #if !defined(__LP64__) |
1075 | uint32_t __legendPad; |
1076 | #endif /* !defined(__LP64__) */ |
1077 | bool is_public; |
1078 | }; |
1079 | #pragma pack(4) |
1080 | struct IOService_SetLegend_Msg |
1081 | { |
1082 | IORPCMessageMach mach; |
1083 | mach_msg_port_descriptor_t __object__descriptor; |
1084 | mach_msg_ool_descriptor_t legend__descriptor; |
1085 | IOService_SetLegend_Msg_Content content; |
1086 | }; |
1087 | #pragma pack() |
1088 | #define IOService_SetLegend_Msg_ObjRefs (2) |
1089 | |
1090 | struct IOService_SetLegend_Rpl_Content |
1091 | { |
1092 | IORPCMessage __hdr; |
1093 | }; |
1094 | #pragma pack(4) |
1095 | struct IOService_SetLegend_Rpl |
1096 | { |
1097 | IORPCMessageMach mach; |
1098 | IOService_SetLegend_Rpl_Content content; |
1099 | }; |
1100 | #pragma pack() |
1101 | #define IOService_SetLegend_Rpl_ObjRefs (0) |
1102 | |
1103 | |
1104 | typedef union |
1105 | { |
1106 | const IORPC rpc; |
1107 | struct |
1108 | { |
1109 | const struct IOService_SetLegend_Msg * message; |
1110 | struct IOService_SetLegend_Rpl * reply; |
1111 | uint32_t sendSize; |
1112 | uint32_t replySize; |
1113 | }; |
1114 | } |
1115 | IOService_SetLegend_Invocation; |
1116 | struct IOService_CopyName_Msg_Content |
1117 | { |
1118 | IORPCMessage __hdr; |
1119 | OSObjectRef __object; |
1120 | }; |
1121 | #pragma pack(4) |
1122 | struct IOService_CopyName_Msg |
1123 | { |
1124 | IORPCMessageMach mach; |
1125 | mach_msg_port_descriptor_t __object__descriptor; |
1126 | IOService_CopyName_Msg_Content content; |
1127 | }; |
1128 | #pragma pack() |
1129 | #define IOService_CopyName_Msg_ObjRefs (1) |
1130 | |
1131 | struct IOService_CopyName_Rpl_Content |
1132 | { |
1133 | IORPCMessage __hdr; |
1134 | OSString * name; |
1135 | #if !defined(__LP64__) |
1136 | uint32_t __namePad; |
1137 | #endif /* !defined(__LP64__) */ |
1138 | }; |
1139 | #pragma pack(4) |
1140 | struct IOService_CopyName_Rpl |
1141 | { |
1142 | IORPCMessageMach mach; |
1143 | mach_msg_ool_descriptor_t name__descriptor; |
1144 | IOService_CopyName_Rpl_Content content; |
1145 | }; |
1146 | #pragma pack() |
1147 | #define IOService_CopyName_Rpl_ObjRefs (1) |
1148 | |
1149 | |
1150 | typedef union |
1151 | { |
1152 | const IORPC rpc; |
1153 | struct |
1154 | { |
1155 | const struct IOService_CopyName_Msg * message; |
1156 | struct IOService_CopyName_Rpl * reply; |
1157 | uint32_t sendSize; |
1158 | uint32_t replySize; |
1159 | }; |
1160 | } |
1161 | IOService_CopyName_Invocation; |
1162 | struct IOService_StringFromReturn_Msg_Content |
1163 | { |
1164 | IORPCMessage __hdr; |
1165 | OSObjectRef __object; |
1166 | IOReturn retval; |
1167 | }; |
1168 | #pragma pack(4) |
1169 | struct IOService_StringFromReturn_Msg |
1170 | { |
1171 | IORPCMessageMach mach; |
1172 | mach_msg_port_descriptor_t __object__descriptor; |
1173 | IOService_StringFromReturn_Msg_Content content; |
1174 | }; |
1175 | #pragma pack() |
1176 | #define IOService_StringFromReturn_Msg_ObjRefs (1) |
1177 | |
1178 | struct IOService_StringFromReturn_Rpl_Content |
1179 | { |
1180 | IORPCMessage __hdr; |
1181 | OSString * str; |
1182 | #if !defined(__LP64__) |
1183 | uint32_t __strPad; |
1184 | #endif /* !defined(__LP64__) */ |
1185 | }; |
1186 | #pragma pack(4) |
1187 | struct IOService_StringFromReturn_Rpl |
1188 | { |
1189 | IORPCMessageMach mach; |
1190 | mach_msg_ool_descriptor_t str__descriptor; |
1191 | IOService_StringFromReturn_Rpl_Content content; |
1192 | }; |
1193 | #pragma pack() |
1194 | #define IOService_StringFromReturn_Rpl_ObjRefs (1) |
1195 | |
1196 | |
1197 | typedef union |
1198 | { |
1199 | const IORPC rpc; |
1200 | struct |
1201 | { |
1202 | const struct IOService_StringFromReturn_Msg * message; |
1203 | struct IOService_StringFromReturn_Rpl * reply; |
1204 | uint32_t sendSize; |
1205 | uint32_t replySize; |
1206 | }; |
1207 | } |
1208 | IOService_StringFromReturn_Invocation; |
1209 | struct IOService__ClaimSystemWakeEvent_Msg_Content |
1210 | { |
1211 | IORPCMessage __hdr; |
1212 | OSObjectRef __object; |
1213 | OSObjectRef device; |
1214 | OSContainer * details; |
1215 | #if !defined(__LP64__) |
1216 | uint32_t __detailsPad; |
1217 | #endif /* !defined(__LP64__) */ |
1218 | uint64_t flags; |
1219 | const char * reason; |
1220 | #if !defined(__LP64__) |
1221 | uint32_t __reasonPad; |
1222 | #endif /* !defined(__LP64__) */ |
1223 | char __reason[128]; |
1224 | }; |
1225 | #pragma pack(4) |
1226 | struct IOService__ClaimSystemWakeEvent_Msg |
1227 | { |
1228 | IORPCMessageMach mach; |
1229 | mach_msg_port_descriptor_t __object__descriptor; |
1230 | mach_msg_port_descriptor_t device__descriptor; |
1231 | mach_msg_ool_descriptor_t details__descriptor; |
1232 | IOService__ClaimSystemWakeEvent_Msg_Content content; |
1233 | }; |
1234 | #pragma pack() |
1235 | #define IOService__ClaimSystemWakeEvent_Msg_ObjRefs (3) |
1236 | |
1237 | struct IOService__ClaimSystemWakeEvent_Rpl_Content |
1238 | { |
1239 | IORPCMessage __hdr; |
1240 | }; |
1241 | #pragma pack(4) |
1242 | struct IOService__ClaimSystemWakeEvent_Rpl |
1243 | { |
1244 | IORPCMessageMach mach; |
1245 | IOService__ClaimSystemWakeEvent_Rpl_Content content; |
1246 | }; |
1247 | #pragma pack() |
1248 | #define IOService__ClaimSystemWakeEvent_Rpl_ObjRefs (0) |
1249 | |
1250 | |
1251 | typedef union |
1252 | { |
1253 | const IORPC rpc; |
1254 | struct |
1255 | { |
1256 | const struct IOService__ClaimSystemWakeEvent_Msg * message; |
1257 | struct IOService__ClaimSystemWakeEvent_Rpl * reply; |
1258 | uint32_t sendSize; |
1259 | uint32_t replySize; |
1260 | }; |
1261 | } |
1262 | IOService__ClaimSystemWakeEvent_Invocation; |
1263 | struct IOService_UserSetProperties_Msg_Content |
1264 | { |
1265 | IORPCMessage __hdr; |
1266 | OSObjectRef __object; |
1267 | OSContainer * properties; |
1268 | #if !defined(__LP64__) |
1269 | uint32_t __propertiesPad; |
1270 | #endif /* !defined(__LP64__) */ |
1271 | }; |
1272 | #pragma pack(4) |
1273 | struct IOService_UserSetProperties_Msg |
1274 | { |
1275 | IORPCMessageMach mach; |
1276 | mach_msg_port_descriptor_t __object__descriptor; |
1277 | mach_msg_ool_descriptor_t properties__descriptor; |
1278 | IOService_UserSetProperties_Msg_Content content; |
1279 | }; |
1280 | #pragma pack() |
1281 | #define IOService_UserSetProperties_Msg_ObjRefs (2) |
1282 | |
1283 | struct IOService_UserSetProperties_Rpl_Content |
1284 | { |
1285 | IORPCMessage __hdr; |
1286 | }; |
1287 | #pragma pack(4) |
1288 | struct IOService_UserSetProperties_Rpl |
1289 | { |
1290 | IORPCMessageMach mach; |
1291 | IOService_UserSetProperties_Rpl_Content content; |
1292 | }; |
1293 | #pragma pack() |
1294 | #define IOService_UserSetProperties_Rpl_ObjRefs (0) |
1295 | |
1296 | |
1297 | typedef union |
1298 | { |
1299 | const IORPC rpc; |
1300 | struct |
1301 | { |
1302 | const struct IOService_UserSetProperties_Msg * message; |
1303 | struct IOService_UserSetProperties_Rpl * reply; |
1304 | uint32_t sendSize; |
1305 | uint32_t replySize; |
1306 | }; |
1307 | } |
1308 | IOService_UserSetProperties_Invocation; |
1309 | struct IOService_SendIOMessageServicePropertyChange_Msg_Content |
1310 | { |
1311 | IORPCMessage __hdr; |
1312 | OSObjectRef __object; |
1313 | }; |
1314 | #pragma pack(4) |
1315 | struct IOService_SendIOMessageServicePropertyChange_Msg |
1316 | { |
1317 | IORPCMessageMach mach; |
1318 | mach_msg_port_descriptor_t __object__descriptor; |
1319 | IOService_SendIOMessageServicePropertyChange_Msg_Content content; |
1320 | }; |
1321 | #pragma pack() |
1322 | #define IOService_SendIOMessageServicePropertyChange_Msg_ObjRefs (1) |
1323 | |
1324 | struct IOService_SendIOMessageServicePropertyChange_Rpl_Content |
1325 | { |
1326 | IORPCMessage __hdr; |
1327 | }; |
1328 | #pragma pack(4) |
1329 | struct IOService_SendIOMessageServicePropertyChange_Rpl |
1330 | { |
1331 | IORPCMessageMach mach; |
1332 | IOService_SendIOMessageServicePropertyChange_Rpl_Content content; |
1333 | }; |
1334 | #pragma pack() |
1335 | #define IOService_SendIOMessageServicePropertyChange_Rpl_ObjRefs (0) |
1336 | |
1337 | |
1338 | typedef union |
1339 | { |
1340 | const IORPC rpc; |
1341 | struct |
1342 | { |
1343 | const struct IOService_SendIOMessageServicePropertyChange_Msg * message; |
1344 | struct IOService_SendIOMessageServicePropertyChange_Rpl * reply; |
1345 | uint32_t sendSize; |
1346 | uint32_t replySize; |
1347 | }; |
1348 | } |
1349 | IOService_SendIOMessageServicePropertyChange_Invocation; |
1350 | struct IOService_RemoveProperty_Msg_Content |
1351 | { |
1352 | IORPCMessage __hdr; |
1353 | OSObjectRef __object; |
1354 | OSString * propertyName; |
1355 | #if !defined(__LP64__) |
1356 | uint32_t __propertyNamePad; |
1357 | #endif /* !defined(__LP64__) */ |
1358 | }; |
1359 | #pragma pack(4) |
1360 | struct IOService_RemoveProperty_Msg |
1361 | { |
1362 | IORPCMessageMach mach; |
1363 | mach_msg_port_descriptor_t __object__descriptor; |
1364 | mach_msg_ool_descriptor_t propertyName__descriptor; |
1365 | IOService_RemoveProperty_Msg_Content content; |
1366 | }; |
1367 | #pragma pack() |
1368 | #define IOService_RemoveProperty_Msg_ObjRefs (2) |
1369 | |
1370 | struct IOService_RemoveProperty_Rpl_Content |
1371 | { |
1372 | IORPCMessage __hdr; |
1373 | }; |
1374 | #pragma pack(4) |
1375 | struct IOService_RemoveProperty_Rpl |
1376 | { |
1377 | IORPCMessageMach mach; |
1378 | IOService_RemoveProperty_Rpl_Content content; |
1379 | }; |
1380 | #pragma pack() |
1381 | #define IOService_RemoveProperty_Rpl_ObjRefs (0) |
1382 | |
1383 | |
1384 | typedef union |
1385 | { |
1386 | const IORPC rpc; |
1387 | struct |
1388 | { |
1389 | const struct IOService_RemoveProperty_Msg * message; |
1390 | struct IOService_RemoveProperty_Rpl * reply; |
1391 | uint32_t sendSize; |
1392 | uint32_t replySize; |
1393 | }; |
1394 | } |
1395 | IOService_RemoveProperty_Invocation; |
1396 | struct IOService_CopySystemStateNotificationService_Msg_Content |
1397 | { |
1398 | IORPCMessage __hdr; |
1399 | OSObjectRef __object; |
1400 | }; |
1401 | #pragma pack(4) |
1402 | struct IOService_CopySystemStateNotificationService_Msg |
1403 | { |
1404 | IORPCMessageMach mach; |
1405 | mach_msg_port_descriptor_t __object__descriptor; |
1406 | IOService_CopySystemStateNotificationService_Msg_Content content; |
1407 | }; |
1408 | #pragma pack() |
1409 | #define IOService_CopySystemStateNotificationService_Msg_ObjRefs (1) |
1410 | |
1411 | struct IOService_CopySystemStateNotificationService_Rpl_Content |
1412 | { |
1413 | IORPCMessage __hdr; |
1414 | OSObjectRef service; |
1415 | }; |
1416 | #pragma pack(4) |
1417 | struct IOService_CopySystemStateNotificationService_Rpl |
1418 | { |
1419 | IORPCMessageMach mach; |
1420 | mach_msg_port_descriptor_t service__descriptor; |
1421 | IOService_CopySystemStateNotificationService_Rpl_Content content; |
1422 | }; |
1423 | #pragma pack() |
1424 | #define IOService_CopySystemStateNotificationService_Rpl_ObjRefs (1) |
1425 | |
1426 | |
1427 | typedef union |
1428 | { |
1429 | const IORPC rpc; |
1430 | struct |
1431 | { |
1432 | const struct IOService_CopySystemStateNotificationService_Msg * message; |
1433 | struct IOService_CopySystemStateNotificationService_Rpl * reply; |
1434 | uint32_t sendSize; |
1435 | uint32_t replySize; |
1436 | }; |
1437 | } |
1438 | IOService_CopySystemStateNotificationService_Invocation; |
1439 | struct IOService_StateNotificationItemCreate_Msg_Content |
1440 | { |
1441 | IORPCMessage __hdr; |
1442 | OSObjectRef __object; |
1443 | OSString * itemName; |
1444 | #if !defined(__LP64__) |
1445 | uint32_t __itemNamePad; |
1446 | #endif /* !defined(__LP64__) */ |
1447 | OSDictionary * schema; |
1448 | #if !defined(__LP64__) |
1449 | uint32_t __schemaPad; |
1450 | #endif /* !defined(__LP64__) */ |
1451 | }; |
1452 | #pragma pack(4) |
1453 | struct IOService_StateNotificationItemCreate_Msg |
1454 | { |
1455 | IORPCMessageMach mach; |
1456 | mach_msg_port_descriptor_t __object__descriptor; |
1457 | mach_msg_ool_descriptor_t itemName__descriptor; |
1458 | mach_msg_ool_descriptor_t schema__descriptor; |
1459 | IOService_StateNotificationItemCreate_Msg_Content content; |
1460 | }; |
1461 | #pragma pack() |
1462 | #define IOService_StateNotificationItemCreate_Msg_ObjRefs (3) |
1463 | |
1464 | struct IOService_StateNotificationItemCreate_Rpl_Content |
1465 | { |
1466 | IORPCMessage __hdr; |
1467 | }; |
1468 | #pragma pack(4) |
1469 | struct IOService_StateNotificationItemCreate_Rpl |
1470 | { |
1471 | IORPCMessageMach mach; |
1472 | IOService_StateNotificationItemCreate_Rpl_Content content; |
1473 | }; |
1474 | #pragma pack() |
1475 | #define IOService_StateNotificationItemCreate_Rpl_ObjRefs (0) |
1476 | |
1477 | |
1478 | typedef union |
1479 | { |
1480 | const IORPC rpc; |
1481 | struct |
1482 | { |
1483 | const struct IOService_StateNotificationItemCreate_Msg * message; |
1484 | struct IOService_StateNotificationItemCreate_Rpl * reply; |
1485 | uint32_t sendSize; |
1486 | uint32_t replySize; |
1487 | }; |
1488 | } |
1489 | IOService_StateNotificationItemCreate_Invocation; |
1490 | struct IOService_StateNotificationItemSet_Msg_Content |
1491 | { |
1492 | IORPCMessage __hdr; |
1493 | OSObjectRef __object; |
1494 | OSString * itemName; |
1495 | #if !defined(__LP64__) |
1496 | uint32_t __itemNamePad; |
1497 | #endif /* !defined(__LP64__) */ |
1498 | OSDictionary * value; |
1499 | #if !defined(__LP64__) |
1500 | uint32_t __valuePad; |
1501 | #endif /* !defined(__LP64__) */ |
1502 | }; |
1503 | #pragma pack(4) |
1504 | struct IOService_StateNotificationItemSet_Msg |
1505 | { |
1506 | IORPCMessageMach mach; |
1507 | mach_msg_port_descriptor_t __object__descriptor; |
1508 | mach_msg_ool_descriptor_t itemName__descriptor; |
1509 | mach_msg_ool_descriptor_t value__descriptor; |
1510 | IOService_StateNotificationItemSet_Msg_Content content; |
1511 | }; |
1512 | #pragma pack() |
1513 | #define IOService_StateNotificationItemSet_Msg_ObjRefs (3) |
1514 | |
1515 | struct IOService_StateNotificationItemSet_Rpl_Content |
1516 | { |
1517 | IORPCMessage __hdr; |
1518 | }; |
1519 | #pragma pack(4) |
1520 | struct IOService_StateNotificationItemSet_Rpl |
1521 | { |
1522 | IORPCMessageMach mach; |
1523 | IOService_StateNotificationItemSet_Rpl_Content content; |
1524 | }; |
1525 | #pragma pack() |
1526 | #define IOService_StateNotificationItemSet_Rpl_ObjRefs (0) |
1527 | |
1528 | |
1529 | typedef union |
1530 | { |
1531 | const IORPC rpc; |
1532 | struct |
1533 | { |
1534 | const struct IOService_StateNotificationItemSet_Msg * message; |
1535 | struct IOService_StateNotificationItemSet_Rpl * reply; |
1536 | uint32_t sendSize; |
1537 | uint32_t replySize; |
1538 | }; |
1539 | } |
1540 | IOService_StateNotificationItemSet_Invocation; |
1541 | struct IOService_StateNotificationItemCopy_Msg_Content |
1542 | { |
1543 | IORPCMessage __hdr; |
1544 | OSObjectRef __object; |
1545 | OSString * itemName; |
1546 | #if !defined(__LP64__) |
1547 | uint32_t __itemNamePad; |
1548 | #endif /* !defined(__LP64__) */ |
1549 | }; |
1550 | #pragma pack(4) |
1551 | struct IOService_StateNotificationItemCopy_Msg |
1552 | { |
1553 | IORPCMessageMach mach; |
1554 | mach_msg_port_descriptor_t __object__descriptor; |
1555 | mach_msg_ool_descriptor_t itemName__descriptor; |
1556 | IOService_StateNotificationItemCopy_Msg_Content content; |
1557 | }; |
1558 | #pragma pack() |
1559 | #define IOService_StateNotificationItemCopy_Msg_ObjRefs (2) |
1560 | |
1561 | struct IOService_StateNotificationItemCopy_Rpl_Content |
1562 | { |
1563 | IORPCMessage __hdr; |
1564 | OSDictionary * value; |
1565 | #if !defined(__LP64__) |
1566 | uint32_t __valuePad; |
1567 | #endif /* !defined(__LP64__) */ |
1568 | }; |
1569 | #pragma pack(4) |
1570 | struct IOService_StateNotificationItemCopy_Rpl |
1571 | { |
1572 | IORPCMessageMach mach; |
1573 | mach_msg_ool_descriptor_t value__descriptor; |
1574 | IOService_StateNotificationItemCopy_Rpl_Content content; |
1575 | }; |
1576 | #pragma pack() |
1577 | #define IOService_StateNotificationItemCopy_Rpl_ObjRefs (1) |
1578 | |
1579 | |
1580 | typedef union |
1581 | { |
1582 | const IORPC rpc; |
1583 | struct |
1584 | { |
1585 | const struct IOService_StateNotificationItemCopy_Msg * message; |
1586 | struct IOService_StateNotificationItemCopy_Rpl * reply; |
1587 | uint32_t sendSize; |
1588 | uint32_t replySize; |
1589 | }; |
1590 | } |
1591 | IOService_StateNotificationItemCopy_Invocation; |
1592 | struct IOService_Stop_async_Msg_Content |
1593 | { |
1594 | IORPCMessage __hdr; |
1595 | OSObjectRef __object; |
1596 | OSObjectRef provider; |
1597 | }; |
1598 | #pragma pack(4) |
1599 | struct IOService_Stop_async_Msg |
1600 | { |
1601 | IORPCMessageMach mach; |
1602 | mach_msg_port_descriptor_t __object__descriptor; |
1603 | mach_msg_port_descriptor_t provider__descriptor; |
1604 | IOService_Stop_async_Msg_Content content; |
1605 | }; |
1606 | #pragma pack() |
1607 | #define IOService_Stop_async_Msg_ObjRefs (2) |
1608 | |
1609 | struct IOService_Stop_async_Rpl_Content |
1610 | { |
1611 | IORPCMessage __hdr; |
1612 | }; |
1613 | #pragma pack(4) |
1614 | struct IOService_Stop_async_Rpl |
1615 | { |
1616 | IORPCMessageMach mach; |
1617 | IOService_Stop_async_Rpl_Content content; |
1618 | }; |
1619 | #pragma pack() |
1620 | #define IOService_Stop_async_Rpl_ObjRefs (0) |
1621 | |
1622 | |
1623 | typedef union |
1624 | { |
1625 | const IORPC rpc; |
1626 | struct |
1627 | { |
1628 | const struct IOService_Stop_async_Msg * message; |
1629 | struct IOService_Stop_async_Rpl * reply; |
1630 | uint32_t sendSize; |
1631 | uint32_t replySize; |
1632 | }; |
1633 | } |
1634 | IOService_Stop_async_Invocation; |
1635 | struct IOService__NewUserClient_Msg_Content |
1636 | { |
1637 | IORPCMessage __hdr; |
1638 | OSObjectRef __object; |
1639 | OSDictionary * entitlements; |
1640 | #if !defined(__LP64__) |
1641 | uint32_t __entitlementsPad; |
1642 | #endif /* !defined(__LP64__) */ |
1643 | uint32_t type; |
1644 | }; |
1645 | #pragma pack(4) |
1646 | struct IOService__NewUserClient_Msg |
1647 | { |
1648 | IORPCMessageMach mach; |
1649 | mach_msg_port_descriptor_t __object__descriptor; |
1650 | mach_msg_ool_descriptor_t entitlements__descriptor; |
1651 | IOService__NewUserClient_Msg_Content content; |
1652 | }; |
1653 | #pragma pack() |
1654 | #define IOService__NewUserClient_Msg_ObjRefs (2) |
1655 | |
1656 | struct IOService__NewUserClient_Rpl_Content |
1657 | { |
1658 | IORPCMessage __hdr; |
1659 | OSObjectRef userClient; |
1660 | }; |
1661 | #pragma pack(4) |
1662 | struct IOService__NewUserClient_Rpl |
1663 | { |
1664 | IORPCMessageMach mach; |
1665 | mach_msg_port_descriptor_t userClient__descriptor; |
1666 | IOService__NewUserClient_Rpl_Content content; |
1667 | }; |
1668 | #pragma pack() |
1669 | #define IOService__NewUserClient_Rpl_ObjRefs (1) |
1670 | |
1671 | |
1672 | typedef union |
1673 | { |
1674 | const IORPC rpc; |
1675 | struct |
1676 | { |
1677 | const struct IOService__NewUserClient_Msg * message; |
1678 | struct IOService__NewUserClient_Rpl * reply; |
1679 | uint32_t sendSize; |
1680 | uint32_t replySize; |
1681 | }; |
1682 | } |
1683 | IOService__NewUserClient_Invocation; |
1684 | #if !KERNEL |
1685 | extern OSMetaClass * gOSContainerMetaClass; |
1686 | extern OSMetaClass * gOSDataMetaClass; |
1687 | extern OSMetaClass * gOSNumberMetaClass; |
1688 | extern OSMetaClass * gOSStringMetaClass; |
1689 | extern OSMetaClass * gOSBooleanMetaClass; |
1690 | extern OSMetaClass * gOSDictionaryMetaClass; |
1691 | extern OSMetaClass * gOSArrayMetaClass; |
1692 | extern OSMetaClass * gOSSetMetaClass; |
1693 | extern OSMetaClass * gOSOrderedSetMetaClass; |
1694 | extern OSMetaClass * gIODispatchQueueMetaClass; |
1695 | extern OSMetaClass * gIOMemoryDescriptorMetaClass; |
1696 | extern OSMetaClass * gIOBufferMemoryDescriptorMetaClass; |
1697 | extern OSMetaClass * gIOUserClientMetaClass; |
1698 | extern OSMetaClass * gOSActionMetaClass; |
1699 | extern OSMetaClass * gIOServiceStateNotificationDispatchSourceMetaClass; |
1700 | #endif /* !KERNEL */ |
1701 | |
1702 | #if !KERNEL |
1703 | |
1704 | #define IOService_QueueNames "" |
1705 | |
1706 | #define IOService_MethodNames "" |
1707 | |
1708 | #define IOServiceMetaClass_MethodNames "" |
1709 | |
1710 | struct OSClassDescription_IOService_t |
1711 | { |
1712 | OSClassDescription base; |
1713 | uint64_t methodOptions[2 * 0]; |
1714 | uint64_t metaMethodOptions[2 * 0]; |
1715 | char queueNames[sizeof(IOService_QueueNames)]; |
1716 | char methodNames[sizeof(IOService_MethodNames)]; |
1717 | char metaMethodNames[sizeof(IOServiceMetaClass_MethodNames)]; |
1718 | }; |
1719 | |
1720 | const struct OSClassDescription_IOService_t |
1721 | OSClassDescription_IOService = |
1722 | { |
1723 | .base = |
1724 | { |
1725 | .descriptionSize = sizeof(OSClassDescription_IOService_t), |
1726 | .name = "IOService" , |
1727 | .superName = "OSObject" , |
1728 | .methodOptionsSize = 2 * sizeof(uint64_t) * 0, |
1729 | .methodOptionsOffset = __builtin_offsetof(struct OSClassDescription_IOService_t, methodOptions), |
1730 | .metaMethodOptionsSize = 2 * sizeof(uint64_t) * 0, |
1731 | .metaMethodOptionsOffset = __builtin_offsetof(struct OSClassDescription_IOService_t, metaMethodOptions), |
1732 | .queueNamesSize = sizeof(IOService_QueueNames), |
1733 | .queueNamesOffset = __builtin_offsetof(struct OSClassDescription_IOService_t, queueNames), |
1734 | .methodNamesSize = sizeof(IOService_MethodNames), |
1735 | .methodNamesOffset = __builtin_offsetof(struct OSClassDescription_IOService_t, methodNames), |
1736 | .metaMethodNamesSize = sizeof(IOServiceMetaClass_MethodNames), |
1737 | .metaMethodNamesOffset = __builtin_offsetof(struct OSClassDescription_IOService_t, metaMethodNames), |
1738 | .flags = 1*kOSClassCanRemote, |
1739 | }, |
1740 | .methodOptions = |
1741 | { |
1742 | }, |
1743 | .metaMethodOptions = |
1744 | { |
1745 | }, |
1746 | .queueNames = IOService_QueueNames, |
1747 | .methodNames = IOService_MethodNames, |
1748 | .metaMethodNames = IOServiceMetaClass_MethodNames, |
1749 | }; |
1750 | |
1751 | OSMetaClass * gIOServiceMetaClass; |
1752 | |
1753 | static kern_return_t |
1754 | IOService_New(OSMetaClass * instance); |
1755 | |
1756 | const OSClassLoadInformation |
1757 | IOService_Class = |
1758 | { |
1759 | .description = &OSClassDescription_IOService.base, |
1760 | .metaPointer = &gIOServiceMetaClass, |
1761 | .version = 1, |
1762 | .instanceSize = sizeof(IOService), |
1763 | |
1764 | .New = &IOService_New, |
1765 | }; |
1766 | |
1767 | extern const void * const |
1768 | gIOService_Declaration; |
1769 | const void * const |
1770 | gIOService_Declaration |
1771 | __attribute__((visibility("hidden" ),section("__DATA_CONST,__osclassinfo,regular,no_dead_strip" ),no_sanitize("address" ))) |
1772 | = &IOService_Class; |
1773 | |
1774 | static kern_return_t |
1775 | IOService_New(OSMetaClass * instance) |
1776 | { |
1777 | if (!new(instance) IOServiceMetaClass) return (kIOReturnNoMemory); |
1778 | return (kIOReturnSuccess); |
1779 | } |
1780 | |
1781 | kern_return_t |
1782 | IOServiceMetaClass::New(OSObject * instance) |
1783 | { |
1784 | if (!new(instance) IOService) return (kIOReturnNoMemory); |
1785 | return (kIOReturnSuccess); |
1786 | } |
1787 | |
1788 | #endif /* !KERNEL */ |
1789 | |
1790 | kern_return_t |
1791 | IOService::Dispatch(const IORPC rpc) |
1792 | { |
1793 | return _Dispatch(self: this, rpc); |
1794 | } |
1795 | |
1796 | kern_return_t |
1797 | IOService::_Dispatch(IOService * self, const IORPC rpc) |
1798 | { |
1799 | kern_return_t ret = kIOReturnUnsupported; |
1800 | IORPCMessage * msg = IORPCMessageFromMach(msg: rpc.message, reply: false); |
1801 | |
1802 | switch (msg->msgid) |
1803 | { |
1804 | case IOService_Start_ID: |
1805 | { |
1806 | ret = IOService::Start_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOService::Start_Handler, *self, &IOService::Start_Impl)); |
1807 | break; |
1808 | } |
1809 | case IOService_Stop_ID: |
1810 | { |
1811 | ret = IOService::Stop_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOService::Stop_Handler, *self, &IOService::Stop_Impl)); |
1812 | break; |
1813 | } |
1814 | #if KERNEL |
1815 | case IOService_ClientCrashed_ID: |
1816 | { |
1817 | ret = IOService::ClientCrashed_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOService::ClientCrashed_Handler, *self, &IOService::ClientCrashed_Impl)); |
1818 | break; |
1819 | } |
1820 | #endif /* !KERNEL */ |
1821 | case IOService_GetRegistryEntryID_ID: |
1822 | { |
1823 | ret = IOService::GetRegistryEntryID_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOService::GetRegistryEntryID_Handler, *self, &IOService::GetRegistryEntryID_Impl)); |
1824 | break; |
1825 | } |
1826 | #if KERNEL |
1827 | case IOService_SetName_ID: |
1828 | { |
1829 | ret = IOService::SetName_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOService::SetName_Handler, *self, &IOService::SetName_Impl)); |
1830 | break; |
1831 | } |
1832 | #endif /* !KERNEL */ |
1833 | #if KERNEL |
1834 | case IOService_RegisterService_ID: |
1835 | { |
1836 | ret = IOService::RegisterService_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOService::RegisterService_Handler, *self, &IOService::RegisterService_Impl)); |
1837 | break; |
1838 | } |
1839 | #endif /* !KERNEL */ |
1840 | case OSObject_SetDispatchQueue_ID: |
1841 | { |
1842 | ret = OSObject::SetDispatchQueue_Invoke(rpc, target: self, SimpleMemberFunctionCast(OSObject::SetDispatchQueue_Handler, *self, &IOService::SetDispatchQueue_Impl)); |
1843 | break; |
1844 | } |
1845 | #if KERNEL |
1846 | case OSObject_CopyDispatchQueue_ID: |
1847 | { |
1848 | ret = OSObject::CopyDispatchQueue_Invoke(rpc, target: self, SimpleMemberFunctionCast(OSObject::CopyDispatchQueue_Handler, *self, &IOService::CopyDispatchQueue_Impl)); |
1849 | break; |
1850 | } |
1851 | #endif /* !KERNEL */ |
1852 | case IOService_CreateDefaultDispatchQueue_ID: |
1853 | { |
1854 | ret = IOService::CreateDefaultDispatchQueue_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOService::CreateDefaultDispatchQueue_Handler, *self, &IOService::CreateDefaultDispatchQueue_Impl)); |
1855 | break; |
1856 | } |
1857 | #if KERNEL |
1858 | case IOService_CopyProperties_ID: |
1859 | { |
1860 | ret = IOService::CopyProperties_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOService::CopyProperties_Handler, *self, &IOService::CopyProperties_Impl)); |
1861 | break; |
1862 | } |
1863 | #endif /* !KERNEL */ |
1864 | #if KERNEL |
1865 | case IOService_SearchProperty_ID: |
1866 | { |
1867 | ret = IOService::SearchProperty_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOService::SearchProperty_Handler, *self, &IOService::SearchProperty_Impl)); |
1868 | break; |
1869 | } |
1870 | #endif /* !KERNEL */ |
1871 | #if KERNEL |
1872 | case IOService_SetProperties_ID: |
1873 | { |
1874 | ret = IOService::SetProperties_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOService::SetProperties_Handler, *self, &IOService::SetProperties_Impl)); |
1875 | break; |
1876 | } |
1877 | #endif /* !KERNEL */ |
1878 | #if KERNEL |
1879 | case IOService_JoinPMTree_ID: |
1880 | { |
1881 | ret = IOService::JoinPMTree_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOService::JoinPMTree_Handler, *self, &IOService::JoinPMTree_Impl)); |
1882 | break; |
1883 | } |
1884 | #endif /* !KERNEL */ |
1885 | case IOService_SetPowerState_ID: |
1886 | { |
1887 | ret = IOService::SetPowerState_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOService::SetPowerState_Handler, *self, &IOService::SetPowerState_Impl)); |
1888 | break; |
1889 | } |
1890 | #if KERNEL |
1891 | case IOService_ChangePowerState_ID: |
1892 | { |
1893 | ret = IOService::ChangePowerState_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOService::ChangePowerState_Handler, *self, &IOService::ChangePowerState_Impl)); |
1894 | break; |
1895 | } |
1896 | #endif /* !KERNEL */ |
1897 | #if KERNEL |
1898 | case IOService_NewUserClient_ID: |
1899 | { |
1900 | ret = IOService::NewUserClient_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOService::NewUserClient_Handler, *self, &IOService::NewUserClient_Impl)); |
1901 | break; |
1902 | } |
1903 | #endif /* !KERNEL */ |
1904 | case IOService_Create_ID: |
1905 | { |
1906 | ret = IOService::Create_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOService::Create_Handler, *self, &IOService::Create_Impl)); |
1907 | break; |
1908 | } |
1909 | #if KERNEL |
1910 | case IOService_Terminate_ID: |
1911 | { |
1912 | ret = IOService::Terminate_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOService::Terminate_Handler, *self, &IOService::Terminate_Impl)); |
1913 | break; |
1914 | } |
1915 | #endif /* !KERNEL */ |
1916 | #if KERNEL |
1917 | case IOService_CopyProviderProperties_ID: |
1918 | { |
1919 | ret = IOService::CopyProviderProperties_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOService::CopyProviderProperties_Handler, *self, &IOService::CopyProviderProperties_Impl)); |
1920 | break; |
1921 | } |
1922 | #endif /* !KERNEL */ |
1923 | #if KERNEL |
1924 | case IOService_RequireMaxBusStall_ID: |
1925 | { |
1926 | ret = IOService::RequireMaxBusStall_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOService::RequireMaxBusStall_Handler, *self, &IOService::RequireMaxBusStall_Impl)); |
1927 | break; |
1928 | } |
1929 | #endif /* !KERNEL */ |
1930 | #if KERNEL |
1931 | case IOService_AdjustBusy_ID: |
1932 | { |
1933 | ret = IOService::AdjustBusy_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOService::AdjustBusy_Handler, *self, &IOService::AdjustBusy_Impl)); |
1934 | break; |
1935 | } |
1936 | #endif /* !KERNEL */ |
1937 | #if KERNEL |
1938 | case IOService_GetBusyState_ID: |
1939 | { |
1940 | ret = IOService::GetBusyState_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOService::GetBusyState_Handler, *self, &IOService::GetBusyState_Impl)); |
1941 | break; |
1942 | } |
1943 | #endif /* !KERNEL */ |
1944 | #if KERNEL |
1945 | case IOService_CoreAnalyticsSendEvent_ID: |
1946 | { |
1947 | ret = IOService::CoreAnalyticsSendEvent_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOService::CoreAnalyticsSendEvent_Handler, *self, &IOService::CoreAnalyticsSendEvent_Impl)); |
1948 | break; |
1949 | } |
1950 | #endif /* !KERNEL */ |
1951 | #if KERNEL |
1952 | case IOService_UpdateReport_ID: |
1953 | { |
1954 | ret = IOService::UpdateReport_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOService::UpdateReport_Handler, *self, &IOService::UpdateReport_Impl)); |
1955 | break; |
1956 | } |
1957 | #endif /* !KERNEL */ |
1958 | #if KERNEL |
1959 | case IOService_ConfigureReport_ID: |
1960 | { |
1961 | ret = IOService::ConfigureReport_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOService::ConfigureReport_Handler, *self, &IOService::ConfigureReport_Impl)); |
1962 | break; |
1963 | } |
1964 | #endif /* !KERNEL */ |
1965 | #if KERNEL |
1966 | case IOService_SetLegend_ID: |
1967 | { |
1968 | ret = IOService::SetLegend_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOService::SetLegend_Handler, *self, &IOService::SetLegend_Impl)); |
1969 | break; |
1970 | } |
1971 | #endif /* !KERNEL */ |
1972 | #if KERNEL |
1973 | case IOService_CopyName_ID: |
1974 | { |
1975 | ret = IOService::CopyName_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOService::CopyName_Handler, *self, &IOService::CopyName_Impl)); |
1976 | break; |
1977 | } |
1978 | #endif /* !KERNEL */ |
1979 | #if KERNEL |
1980 | case IOService_StringFromReturn_ID: |
1981 | { |
1982 | ret = IOService::StringFromReturn_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOService::StringFromReturn_Handler, *self, &IOService::StringFromReturn_Impl)); |
1983 | break; |
1984 | } |
1985 | #endif /* !KERNEL */ |
1986 | #if KERNEL |
1987 | case IOService__ClaimSystemWakeEvent_ID: |
1988 | { |
1989 | ret = IOService::_ClaimSystemWakeEvent_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOService::_ClaimSystemWakeEvent_Handler, *self, &IOService::_ClaimSystemWakeEvent_Impl)); |
1990 | break; |
1991 | } |
1992 | #endif /* !KERNEL */ |
1993 | case IOService_UserSetProperties_ID: |
1994 | { |
1995 | ret = IOService::UserSetProperties_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOService::UserSetProperties_Handler, *self, &IOService::UserSetProperties_Impl)); |
1996 | break; |
1997 | } |
1998 | #if KERNEL |
1999 | case IOService_SendIOMessageServicePropertyChange_ID: |
2000 | { |
2001 | ret = IOService::SendIOMessageServicePropertyChange_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOService::SendIOMessageServicePropertyChange_Handler, *self, &IOService::SendIOMessageServicePropertyChange_Impl)); |
2002 | break; |
2003 | } |
2004 | #endif /* !KERNEL */ |
2005 | #if KERNEL |
2006 | case IOService_RemoveProperty_ID: |
2007 | { |
2008 | ret = IOService::RemoveProperty_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOService::RemoveProperty_Handler, *self, &IOService::RemoveProperty_Impl)); |
2009 | break; |
2010 | } |
2011 | #endif /* !KERNEL */ |
2012 | #if KERNEL |
2013 | case IOService_CopySystemStateNotificationService_ID: |
2014 | { |
2015 | ret = IOService::CopySystemStateNotificationService_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOService::CopySystemStateNotificationService_Handler, *self, &IOService::CopySystemStateNotificationService_Impl)); |
2016 | break; |
2017 | } |
2018 | #endif /* !KERNEL */ |
2019 | #if KERNEL |
2020 | case IOService_StateNotificationItemCreate_ID: |
2021 | { |
2022 | ret = IOService::StateNotificationItemCreate_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOService::StateNotificationItemCreate_Handler, *self, &IOService::StateNotificationItemCreate_Impl)); |
2023 | break; |
2024 | } |
2025 | #endif /* !KERNEL */ |
2026 | #if KERNEL |
2027 | case IOService_StateNotificationItemSet_ID: |
2028 | { |
2029 | ret = IOService::StateNotificationItemSet_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOService::StateNotificationItemSet_Handler, *self, &IOService::StateNotificationItemSet_Impl)); |
2030 | break; |
2031 | } |
2032 | #endif /* !KERNEL */ |
2033 | #if KERNEL |
2034 | case IOService_StateNotificationItemCopy_ID: |
2035 | { |
2036 | ret = IOService::StateNotificationItemCopy_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOService::StateNotificationItemCopy_Handler, *self, &IOService::StateNotificationItemCopy_Impl)); |
2037 | break; |
2038 | } |
2039 | #endif /* !KERNEL */ |
2040 | case IOService_Stop_async_ID: |
2041 | { |
2042 | ret = IOService::Stop_async_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOService::Stop_async_Handler, *self, &IOService::Stop_async_Impl)); |
2043 | break; |
2044 | } |
2045 | case IOService__NewUserClient_ID: |
2046 | { |
2047 | ret = IOService::_NewUserClient_Invoke(rpc, target: self, SimpleMemberFunctionCast(IOService::_NewUserClient_Handler, *self, &IOService::_NewUserClient_Impl)); |
2048 | break; |
2049 | } |
2050 | |
2051 | default: |
2052 | ret = OSObject::_Dispatch(self, rpc); |
2053 | break; |
2054 | } |
2055 | |
2056 | return (ret); |
2057 | } |
2058 | |
2059 | #if KERNEL |
2060 | kern_return_t |
2061 | IOService::MetaClass::Dispatch(const IORPC rpc) |
2062 | { |
2063 | #else /* KERNEL */ |
2064 | kern_return_t |
2065 | IOServiceMetaClass::Dispatch(const IORPC rpc) |
2066 | { |
2067 | #endif /* !KERNEL */ |
2068 | |
2069 | kern_return_t ret = kIOReturnUnsupported; |
2070 | IORPCMessage * msg = IORPCMessageFromMach(msg: rpc.message, reply: false); |
2071 | |
2072 | switch (msg->msgid) |
2073 | { |
2074 | |
2075 | default: |
2076 | ret = OSMetaClassBase::Dispatch(rpc); |
2077 | break; |
2078 | } |
2079 | |
2080 | return (ret); |
2081 | } |
2082 | |
2083 | kern_return_t |
2084 | IOService::Start( |
2085 | IOService * provider, |
2086 | OSDispatchMethod supermethod) |
2087 | { |
2088 | kern_return_t ret; |
2089 | union |
2090 | { |
2091 | IOService_Start_Msg msg; |
2092 | struct |
2093 | { |
2094 | IOService_Start_Rpl rpl; |
2095 | mach_msg_max_trailer_t trailer; |
2096 | } rpl; |
2097 | } buf; |
2098 | struct IOService_Start_Msg * msg = &buf.msg; |
2099 | struct IOService_Start_Rpl * rpl = &buf.rpl.rpl; |
2100 | |
2101 | memset(s: msg, c: 0, n: sizeof(struct IOService_Start_Msg)); |
2102 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
2103 | msg->mach.msgh.msgh_size = sizeof(*msg); |
2104 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
2105 | | 1*kIORPCMessageSimpleReply |
2106 | | 0*kIORPCMessageLocalHost |
2107 | | 0*kIORPCMessageOnqueue; |
2108 | msg->content.__hdr.msgid = IOService_Start_ID; |
2109 | msg->content.__object = (OSObjectRef) this; |
2110 | msg->content.__hdr.objectRefs = IOService_Start_Msg_ObjRefs; |
2111 | msg->mach.msgh_body.msgh_descriptor_count = 2; |
2112 | |
2113 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
2114 | |
2115 | msg->provider__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
2116 | msg->content.provider = (OSObjectRef) provider; |
2117 | |
2118 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
2119 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
2120 | else ret = ((OSObject *)this)->Invoke(rpc); |
2121 | |
2122 | if (kIOReturnSuccess == ret) |
2123 | do { |
2124 | { |
2125 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
2126 | if (rpl->content.__hdr.msgid != IOService_Start_ID) { ret = kIOReturnIPCError; break; }; |
2127 | if (rpl->mach.msgh_body.msgh_descriptor_count != 0) { ret = kIOReturnIPCError; break; }; |
2128 | if (IOService_Start_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
2129 | } |
2130 | } |
2131 | while (false); |
2132 | if (kIOReturnSuccess == ret) |
2133 | { |
2134 | } |
2135 | |
2136 | |
2137 | return (ret); |
2138 | } |
2139 | |
2140 | kern_return_t |
2141 | IOService::Stop( |
2142 | IOService * provider, |
2143 | OSDispatchMethod supermethod) |
2144 | { |
2145 | kern_return_t ret; |
2146 | union |
2147 | { |
2148 | IOService_Stop_Msg msg; |
2149 | struct |
2150 | { |
2151 | IOService_Stop_Rpl rpl; |
2152 | mach_msg_max_trailer_t trailer; |
2153 | } rpl; |
2154 | } buf; |
2155 | struct IOService_Stop_Msg * msg = &buf.msg; |
2156 | struct IOService_Stop_Rpl * rpl = &buf.rpl.rpl; |
2157 | |
2158 | memset(s: msg, c: 0, n: sizeof(struct IOService_Stop_Msg)); |
2159 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
2160 | msg->mach.msgh.msgh_size = sizeof(*msg); |
2161 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
2162 | | 1*kIORPCMessageSimpleReply |
2163 | | 0*kIORPCMessageLocalHost |
2164 | | 0*kIORPCMessageOnqueue; |
2165 | msg->content.__hdr.msgid = IOService_Stop_ID; |
2166 | msg->content.__object = (OSObjectRef) this; |
2167 | msg->content.__hdr.objectRefs = IOService_Stop_Msg_ObjRefs; |
2168 | msg->mach.msgh_body.msgh_descriptor_count = 2; |
2169 | |
2170 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
2171 | |
2172 | msg->provider__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
2173 | msg->content.provider = (OSObjectRef) provider; |
2174 | |
2175 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
2176 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
2177 | else ret = ((OSObject *)this)->Invoke(rpc); |
2178 | |
2179 | if (kIOReturnSuccess == ret) |
2180 | do { |
2181 | { |
2182 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
2183 | if (rpl->content.__hdr.msgid != IOService_Stop_ID) { ret = kIOReturnIPCError; break; }; |
2184 | if (rpl->mach.msgh_body.msgh_descriptor_count != 0) { ret = kIOReturnIPCError; break; }; |
2185 | if (IOService_Stop_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
2186 | } |
2187 | } |
2188 | while (false); |
2189 | if (kIOReturnSuccess == ret) |
2190 | { |
2191 | } |
2192 | |
2193 | |
2194 | return (ret); |
2195 | } |
2196 | |
2197 | kern_return_t |
2198 | IOService::ClientCrashed( |
2199 | IOService * client, |
2200 | uint64_t options, |
2201 | OSDispatchMethod supermethod) |
2202 | { |
2203 | kern_return_t ret; |
2204 | union |
2205 | { |
2206 | IOService_ClientCrashed_Msg msg; |
2207 | struct |
2208 | { |
2209 | IOService_ClientCrashed_Rpl rpl; |
2210 | mach_msg_max_trailer_t trailer; |
2211 | } rpl; |
2212 | } buf; |
2213 | struct IOService_ClientCrashed_Msg * msg = &buf.msg; |
2214 | struct IOService_ClientCrashed_Rpl * rpl = &buf.rpl.rpl; |
2215 | |
2216 | memset(s: msg, c: 0, n: sizeof(struct IOService_ClientCrashed_Msg)); |
2217 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
2218 | msg->mach.msgh.msgh_size = sizeof(*msg); |
2219 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
2220 | | 1*kIORPCMessageSimpleReply |
2221 | | 0*kIORPCMessageLocalHost |
2222 | | 0*kIORPCMessageOnqueue; |
2223 | msg->content.__hdr.msgid = IOService_ClientCrashed_ID; |
2224 | msg->content.__object = (OSObjectRef) this; |
2225 | msg->content.__hdr.objectRefs = IOService_ClientCrashed_Msg_ObjRefs; |
2226 | msg->mach.msgh_body.msgh_descriptor_count = 2; |
2227 | |
2228 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
2229 | |
2230 | msg->client__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
2231 | msg->content.client = (OSObjectRef) client; |
2232 | |
2233 | msg->content.options = options; |
2234 | |
2235 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
2236 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
2237 | else ret = ((OSObject *)this)->Invoke(rpc); |
2238 | |
2239 | if (kIOReturnSuccess == ret) |
2240 | do { |
2241 | { |
2242 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
2243 | if (rpl->content.__hdr.msgid != IOService_ClientCrashed_ID) { ret = kIOReturnIPCError; break; }; |
2244 | if (rpl->mach.msgh_body.msgh_descriptor_count != 0) { ret = kIOReturnIPCError; break; }; |
2245 | if (IOService_ClientCrashed_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
2246 | } |
2247 | } |
2248 | while (false); |
2249 | if (kIOReturnSuccess == ret) |
2250 | { |
2251 | } |
2252 | |
2253 | |
2254 | return (ret); |
2255 | } |
2256 | |
2257 | kern_return_t |
2258 | IOService::GetRegistryEntryID( |
2259 | uint64_t * registryEntryID, |
2260 | OSDispatchMethod supermethod) |
2261 | { |
2262 | kern_return_t ret; |
2263 | union |
2264 | { |
2265 | IOService_GetRegistryEntryID_Msg msg; |
2266 | struct |
2267 | { |
2268 | IOService_GetRegistryEntryID_Rpl rpl; |
2269 | mach_msg_max_trailer_t trailer; |
2270 | } rpl; |
2271 | } buf; |
2272 | struct IOService_GetRegistryEntryID_Msg * msg = &buf.msg; |
2273 | struct IOService_GetRegistryEntryID_Rpl * rpl = &buf.rpl.rpl; |
2274 | |
2275 | memset(s: msg, c: 0, n: sizeof(struct IOService_GetRegistryEntryID_Msg)); |
2276 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
2277 | msg->mach.msgh.msgh_size = sizeof(*msg); |
2278 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
2279 | | 1*kIORPCMessageSimpleReply |
2280 | | 0*kIORPCMessageLocalHost |
2281 | | 0*kIORPCMessageOnqueue; |
2282 | msg->content.__hdr.msgid = IOService_GetRegistryEntryID_ID; |
2283 | msg->content.__object = (OSObjectRef) this; |
2284 | msg->content.__hdr.objectRefs = IOService_GetRegistryEntryID_Msg_ObjRefs; |
2285 | msg->mach.msgh_body.msgh_descriptor_count = 1; |
2286 | |
2287 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
2288 | |
2289 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
2290 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
2291 | else ret = ((OSObject *)this)->Invoke(rpc); |
2292 | |
2293 | if (kIOReturnSuccess == ret) |
2294 | do { |
2295 | { |
2296 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
2297 | if (rpl->content.__hdr.msgid != IOService_GetRegistryEntryID_ID) { ret = kIOReturnIPCError; break; }; |
2298 | if (rpl->mach.msgh_body.msgh_descriptor_count != 0) { ret = kIOReturnIPCError; break; }; |
2299 | if (IOService_GetRegistryEntryID_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
2300 | } |
2301 | } |
2302 | while (false); |
2303 | if (kIOReturnSuccess == ret) |
2304 | { |
2305 | if (registryEntryID) *registryEntryID = rpl->content.registryEntryID; |
2306 | } |
2307 | |
2308 | |
2309 | return (ret); |
2310 | } |
2311 | |
2312 | kern_return_t |
2313 | IOService::SetName( |
2314 | const char * name, |
2315 | OSDispatchMethod supermethod) |
2316 | { |
2317 | kern_return_t ret; |
2318 | union |
2319 | { |
2320 | IOService_SetName_Msg msg; |
2321 | struct |
2322 | { |
2323 | IOService_SetName_Rpl rpl; |
2324 | mach_msg_max_trailer_t trailer; |
2325 | } rpl; |
2326 | } buf; |
2327 | struct IOService_SetName_Msg * msg = &buf.msg; |
2328 | struct IOService_SetName_Rpl * rpl = &buf.rpl.rpl; |
2329 | |
2330 | memset(s: msg, c: 0, n: sizeof(struct IOService_SetName_Msg)); |
2331 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
2332 | msg->mach.msgh.msgh_size = sizeof(*msg); |
2333 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
2334 | | 1*kIORPCMessageSimpleReply |
2335 | | 0*kIORPCMessageLocalHost |
2336 | | 0*kIORPCMessageOnqueue; |
2337 | msg->content.__hdr.msgid = IOService_SetName_ID; |
2338 | msg->content.__object = (OSObjectRef) this; |
2339 | msg->content.__hdr.objectRefs = IOService_SetName_Msg_ObjRefs; |
2340 | msg->mach.msgh_body.msgh_descriptor_count = 1; |
2341 | |
2342 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
2343 | |
2344 | msg->content.name = NULL; |
2345 | |
2346 | strlcpy(dst: &msg->content.__name[0], src: name, n: sizeof(msg->content.__name)); |
2347 | |
2348 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
2349 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
2350 | else ret = ((OSObject *)this)->Invoke(rpc); |
2351 | |
2352 | if (kIOReturnSuccess == ret) |
2353 | do { |
2354 | { |
2355 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
2356 | if (rpl->content.__hdr.msgid != IOService_SetName_ID) { ret = kIOReturnIPCError; break; }; |
2357 | if (rpl->mach.msgh_body.msgh_descriptor_count != 0) { ret = kIOReturnIPCError; break; }; |
2358 | if (IOService_SetName_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
2359 | } |
2360 | } |
2361 | while (false); |
2362 | if (kIOReturnSuccess == ret) |
2363 | { |
2364 | } |
2365 | |
2366 | |
2367 | return (ret); |
2368 | } |
2369 | |
2370 | kern_return_t |
2371 | IOService::RegisterService( OSDispatchMethod supermethod) |
2372 | { |
2373 | kern_return_t ret; |
2374 | union |
2375 | { |
2376 | IOService_RegisterService_Msg msg; |
2377 | struct |
2378 | { |
2379 | IOService_RegisterService_Rpl rpl; |
2380 | mach_msg_max_trailer_t trailer; |
2381 | } rpl; |
2382 | } buf; |
2383 | struct IOService_RegisterService_Msg * msg = &buf.msg; |
2384 | struct IOService_RegisterService_Rpl * rpl = &buf.rpl.rpl; |
2385 | |
2386 | memset(s: msg, c: 0, n: sizeof(struct IOService_RegisterService_Msg)); |
2387 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
2388 | msg->mach.msgh.msgh_size = sizeof(*msg); |
2389 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
2390 | | 1*kIORPCMessageSimpleReply |
2391 | | 0*kIORPCMessageLocalHost |
2392 | | 0*kIORPCMessageOnqueue; |
2393 | msg->content.__hdr.msgid = IOService_RegisterService_ID; |
2394 | msg->content.__object = (OSObjectRef) this; |
2395 | msg->content.__hdr.objectRefs = IOService_RegisterService_Msg_ObjRefs; |
2396 | msg->mach.msgh_body.msgh_descriptor_count = 1; |
2397 | |
2398 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
2399 | |
2400 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
2401 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
2402 | else ret = ((OSObject *)this)->Invoke(rpc); |
2403 | |
2404 | if (kIOReturnSuccess == ret) |
2405 | do { |
2406 | { |
2407 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
2408 | if (rpl->content.__hdr.msgid != IOService_RegisterService_ID) { ret = kIOReturnIPCError; break; }; |
2409 | if (rpl->mach.msgh_body.msgh_descriptor_count != 0) { ret = kIOReturnIPCError; break; }; |
2410 | if (IOService_RegisterService_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
2411 | } |
2412 | } |
2413 | while (false); |
2414 | if (kIOReturnSuccess == ret) |
2415 | { |
2416 | } |
2417 | |
2418 | |
2419 | return (ret); |
2420 | } |
2421 | |
2422 | kern_return_t |
2423 | IOService::CreateDefaultDispatchQueue( |
2424 | IODispatchQueue ** queue, |
2425 | OSDispatchMethod supermethod) |
2426 | { |
2427 | kern_return_t ret; |
2428 | union |
2429 | { |
2430 | IOService_CreateDefaultDispatchQueue_Msg msg; |
2431 | struct |
2432 | { |
2433 | IOService_CreateDefaultDispatchQueue_Rpl rpl; |
2434 | mach_msg_max_trailer_t trailer; |
2435 | } rpl; |
2436 | } buf; |
2437 | struct IOService_CreateDefaultDispatchQueue_Msg * msg = &buf.msg; |
2438 | struct IOService_CreateDefaultDispatchQueue_Rpl * rpl = &buf.rpl.rpl; |
2439 | |
2440 | memset(s: msg, c: 0, n: sizeof(struct IOService_CreateDefaultDispatchQueue_Msg)); |
2441 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
2442 | msg->mach.msgh.msgh_size = sizeof(*msg); |
2443 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
2444 | | 0*kIORPCMessageSimpleReply |
2445 | | 0*kIORPCMessageLocalHost |
2446 | | 0*kIORPCMessageOnqueue; |
2447 | msg->content.__hdr.msgid = IOService_CreateDefaultDispatchQueue_ID; |
2448 | msg->content.__object = (OSObjectRef) this; |
2449 | msg->content.__hdr.objectRefs = IOService_CreateDefaultDispatchQueue_Msg_ObjRefs; |
2450 | msg->mach.msgh_body.msgh_descriptor_count = 1; |
2451 | |
2452 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
2453 | |
2454 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
2455 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
2456 | else ret = ((OSObject *)this)->Invoke(rpc); |
2457 | |
2458 | if (kIOReturnSuccess == ret) |
2459 | do { |
2460 | { |
2461 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
2462 | if (rpl->content.__hdr.msgid != IOService_CreateDefaultDispatchQueue_ID) { ret = kIOReturnIPCError; break; }; |
2463 | if (rpl->mach.msgh_body.msgh_descriptor_count != 1) { ret = kIOReturnIPCError; break; }; |
2464 | if (IOService_CreateDefaultDispatchQueue_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
2465 | } |
2466 | } |
2467 | while (false); |
2468 | if (kIOReturnSuccess == ret) |
2469 | { |
2470 | *queue = OSDynamicCast(IODispatchQueue, (OSObject *) rpl->content.queue); |
2471 | if (rpl->content.queue && !*queue) ret = kIOReturnBadArgument; |
2472 | } |
2473 | |
2474 | |
2475 | return (ret); |
2476 | } |
2477 | |
2478 | kern_return_t |
2479 | IOService::CopyProperties( |
2480 | OSDictionary ** properties, |
2481 | OSDispatchMethod supermethod) |
2482 | { |
2483 | kern_return_t ret; |
2484 | union |
2485 | { |
2486 | IOService_CopyProperties_Msg msg; |
2487 | struct |
2488 | { |
2489 | IOService_CopyProperties_Rpl rpl; |
2490 | mach_msg_max_trailer_t trailer; |
2491 | } rpl; |
2492 | } buf; |
2493 | struct IOService_CopyProperties_Msg * msg = &buf.msg; |
2494 | struct IOService_CopyProperties_Rpl * rpl = &buf.rpl.rpl; |
2495 | |
2496 | memset(s: msg, c: 0, n: sizeof(struct IOService_CopyProperties_Msg)); |
2497 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
2498 | msg->mach.msgh.msgh_size = sizeof(*msg); |
2499 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
2500 | | 0*kIORPCMessageSimpleReply |
2501 | | 0*kIORPCMessageLocalHost |
2502 | | 0*kIORPCMessageOnqueue; |
2503 | msg->content.__hdr.msgid = IOService_CopyProperties_ID; |
2504 | msg->content.__object = (OSObjectRef) this; |
2505 | msg->content.__hdr.objectRefs = IOService_CopyProperties_Msg_ObjRefs; |
2506 | msg->mach.msgh_body.msgh_descriptor_count = 1; |
2507 | |
2508 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
2509 | |
2510 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
2511 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
2512 | else ret = ((OSObject *)this)->Invoke(rpc); |
2513 | |
2514 | if (kIOReturnSuccess == ret) |
2515 | do { |
2516 | { |
2517 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
2518 | if (rpl->content.__hdr.msgid != IOService_CopyProperties_ID) { ret = kIOReturnIPCError; break; }; |
2519 | if (rpl->mach.msgh_body.msgh_descriptor_count != 1) { ret = kIOReturnIPCError; break; }; |
2520 | if (IOService_CopyProperties_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
2521 | } |
2522 | } |
2523 | while (false); |
2524 | if (kIOReturnSuccess == ret) |
2525 | { |
2526 | *properties = OSDynamicCast(OSDictionary, (OSObject *) rpl->content.properties); |
2527 | if (rpl->content.properties && !*properties) ret = kIOReturnBadArgument; |
2528 | } |
2529 | |
2530 | |
2531 | return (ret); |
2532 | } |
2533 | |
2534 | kern_return_t |
2535 | IOService::SearchProperty( |
2536 | const char * name, |
2537 | const char * plane, |
2538 | uint64_t options, |
2539 | OSContainer ** property, |
2540 | OSDispatchMethod supermethod) |
2541 | { |
2542 | kern_return_t ret; |
2543 | union |
2544 | { |
2545 | IOService_SearchProperty_Msg msg; |
2546 | struct |
2547 | { |
2548 | IOService_SearchProperty_Rpl rpl; |
2549 | mach_msg_max_trailer_t trailer; |
2550 | } rpl; |
2551 | } buf; |
2552 | struct IOService_SearchProperty_Msg * msg = &buf.msg; |
2553 | struct IOService_SearchProperty_Rpl * rpl = &buf.rpl.rpl; |
2554 | |
2555 | memset(s: msg, c: 0, n: sizeof(struct IOService_SearchProperty_Msg)); |
2556 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
2557 | msg->mach.msgh.msgh_size = sizeof(*msg); |
2558 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
2559 | | 0*kIORPCMessageSimpleReply |
2560 | | 0*kIORPCMessageLocalHost |
2561 | | 0*kIORPCMessageOnqueue; |
2562 | msg->content.__hdr.msgid = IOService_SearchProperty_ID; |
2563 | msg->content.__object = (OSObjectRef) this; |
2564 | msg->content.__hdr.objectRefs = IOService_SearchProperty_Msg_ObjRefs; |
2565 | msg->mach.msgh_body.msgh_descriptor_count = 1; |
2566 | |
2567 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
2568 | |
2569 | msg->content.name = NULL; |
2570 | |
2571 | strlcpy(dst: &msg->content.__name[0], src: name, n: sizeof(msg->content.__name)); |
2572 | |
2573 | msg->content.plane = NULL; |
2574 | |
2575 | strlcpy(dst: &msg->content.__plane[0], src: plane, n: sizeof(msg->content.__plane)); |
2576 | |
2577 | msg->content.options = options; |
2578 | |
2579 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
2580 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
2581 | else ret = ((OSObject *)this)->Invoke(rpc); |
2582 | |
2583 | if (kIOReturnSuccess == ret) |
2584 | do { |
2585 | { |
2586 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
2587 | if (rpl->content.__hdr.msgid != IOService_SearchProperty_ID) { ret = kIOReturnIPCError; break; }; |
2588 | if (rpl->mach.msgh_body.msgh_descriptor_count != 1) { ret = kIOReturnIPCError; break; }; |
2589 | if (IOService_SearchProperty_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
2590 | } |
2591 | } |
2592 | while (false); |
2593 | if (kIOReturnSuccess == ret) |
2594 | { |
2595 | *property = OSDynamicCast(OSContainer, (OSObject *) rpl->content.property); |
2596 | if (rpl->content.property && !*property) ret = kIOReturnBadArgument; |
2597 | } |
2598 | |
2599 | |
2600 | return (ret); |
2601 | } |
2602 | |
2603 | kern_return_t |
2604 | IOService::SetProperties( |
2605 | OSDictionary * properties, |
2606 | OSDispatchMethod supermethod) |
2607 | { |
2608 | kern_return_t ret; |
2609 | union |
2610 | { |
2611 | IOService_SetProperties_Msg msg; |
2612 | struct |
2613 | { |
2614 | IOService_SetProperties_Rpl rpl; |
2615 | mach_msg_max_trailer_t trailer; |
2616 | } rpl; |
2617 | } buf; |
2618 | struct IOService_SetProperties_Msg * msg = &buf.msg; |
2619 | struct IOService_SetProperties_Rpl * rpl = &buf.rpl.rpl; |
2620 | |
2621 | memset(s: msg, c: 0, n: sizeof(struct IOService_SetProperties_Msg)); |
2622 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
2623 | msg->mach.msgh.msgh_size = sizeof(*msg); |
2624 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
2625 | | 0*kIORPCMessageSimpleReply |
2626 | | 0*kIORPCMessageLocalHost |
2627 | | 0*kIORPCMessageOnqueue; |
2628 | msg->content.__hdr.msgid = IOService_SetProperties_ID; |
2629 | msg->content.__object = (OSObjectRef) this; |
2630 | msg->content.__hdr.objectRefs = IOService_SetProperties_Msg_ObjRefs; |
2631 | msg->mach.msgh_body.msgh_descriptor_count = 2; |
2632 | |
2633 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
2634 | |
2635 | msg->properties__descriptor.type = MACH_MSG_OOL_DESCRIPTOR; |
2636 | msg->properties__descriptor.copy = MACH_MSG_VIRTUAL_COPY; |
2637 | msg->properties__descriptor.address = (void *) __builtin_offsetof(IOService_SetProperties_Msg_Content, properties); |
2638 | msg->content.properties = properties; |
2639 | |
2640 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
2641 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
2642 | else ret = ((OSObject *)this)->Invoke(rpc); |
2643 | |
2644 | if (kIOReturnSuccess == ret) |
2645 | do { |
2646 | { |
2647 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
2648 | if (rpl->content.__hdr.msgid != IOService_SetProperties_ID) { ret = kIOReturnIPCError; break; }; |
2649 | if (rpl->mach.msgh_body.msgh_descriptor_count != 0) { ret = kIOReturnIPCError; break; }; |
2650 | if (IOService_SetProperties_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
2651 | } |
2652 | } |
2653 | while (false); |
2654 | if (kIOReturnSuccess == ret) |
2655 | { |
2656 | } |
2657 | |
2658 | |
2659 | return (ret); |
2660 | } |
2661 | |
2662 | kern_return_t |
2663 | IOService::JoinPMTree( OSDispatchMethod supermethod) |
2664 | { |
2665 | kern_return_t ret; |
2666 | union |
2667 | { |
2668 | IOService_JoinPMTree_Msg msg; |
2669 | struct |
2670 | { |
2671 | IOService_JoinPMTree_Rpl rpl; |
2672 | mach_msg_max_trailer_t trailer; |
2673 | } rpl; |
2674 | } buf; |
2675 | struct IOService_JoinPMTree_Msg * msg = &buf.msg; |
2676 | struct IOService_JoinPMTree_Rpl * rpl = &buf.rpl.rpl; |
2677 | |
2678 | memset(s: msg, c: 0, n: sizeof(struct IOService_JoinPMTree_Msg)); |
2679 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
2680 | msg->mach.msgh.msgh_size = sizeof(*msg); |
2681 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
2682 | | 1*kIORPCMessageSimpleReply |
2683 | | 0*kIORPCMessageLocalHost |
2684 | | 0*kIORPCMessageOnqueue; |
2685 | msg->content.__hdr.msgid = IOService_JoinPMTree_ID; |
2686 | msg->content.__object = (OSObjectRef) this; |
2687 | msg->content.__hdr.objectRefs = IOService_JoinPMTree_Msg_ObjRefs; |
2688 | msg->mach.msgh_body.msgh_descriptor_count = 1; |
2689 | |
2690 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
2691 | |
2692 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
2693 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
2694 | else ret = ((OSObject *)this)->Invoke(rpc); |
2695 | |
2696 | if (kIOReturnSuccess == ret) |
2697 | do { |
2698 | { |
2699 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
2700 | if (rpl->content.__hdr.msgid != IOService_JoinPMTree_ID) { ret = kIOReturnIPCError; break; }; |
2701 | if (rpl->mach.msgh_body.msgh_descriptor_count != 0) { ret = kIOReturnIPCError; break; }; |
2702 | if (IOService_JoinPMTree_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
2703 | } |
2704 | } |
2705 | while (false); |
2706 | if (kIOReturnSuccess == ret) |
2707 | { |
2708 | } |
2709 | |
2710 | |
2711 | return (ret); |
2712 | } |
2713 | |
2714 | kern_return_t |
2715 | IOService::SetPowerState( |
2716 | uint32_t powerFlags, |
2717 | OSDispatchMethod supermethod) |
2718 | { |
2719 | kern_return_t ret; |
2720 | union |
2721 | { |
2722 | IOService_SetPowerState_Msg msg; |
2723 | struct |
2724 | { |
2725 | IOService_SetPowerState_Rpl rpl; |
2726 | mach_msg_max_trailer_t trailer; |
2727 | } rpl; |
2728 | } buf; |
2729 | struct IOService_SetPowerState_Msg * msg = &buf.msg; |
2730 | struct IOService_SetPowerState_Rpl * rpl = &buf.rpl.rpl; |
2731 | |
2732 | memset(s: msg, c: 0, n: sizeof(struct IOService_SetPowerState_Msg)); |
2733 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
2734 | msg->mach.msgh.msgh_size = sizeof(*msg); |
2735 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
2736 | | 1*kIORPCMessageSimpleReply |
2737 | | 0*kIORPCMessageLocalHost |
2738 | | 0*kIORPCMessageOnqueue; |
2739 | msg->content.__hdr.msgid = IOService_SetPowerState_ID; |
2740 | msg->content.__object = (OSObjectRef) this; |
2741 | msg->content.__hdr.objectRefs = IOService_SetPowerState_Msg_ObjRefs; |
2742 | msg->mach.msgh_body.msgh_descriptor_count = 1; |
2743 | |
2744 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
2745 | |
2746 | msg->content.powerFlags = powerFlags; |
2747 | |
2748 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
2749 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
2750 | else ret = ((OSObject *)this)->Invoke(rpc); |
2751 | |
2752 | if (kIOReturnSuccess == ret) |
2753 | do { |
2754 | { |
2755 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
2756 | if (rpl->content.__hdr.msgid != IOService_SetPowerState_ID) { ret = kIOReturnIPCError; break; }; |
2757 | if (rpl->mach.msgh_body.msgh_descriptor_count != 0) { ret = kIOReturnIPCError; break; }; |
2758 | if (IOService_SetPowerState_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
2759 | } |
2760 | } |
2761 | while (false); |
2762 | if (kIOReturnSuccess == ret) |
2763 | { |
2764 | } |
2765 | |
2766 | |
2767 | return (ret); |
2768 | } |
2769 | |
2770 | kern_return_t |
2771 | IOService::ChangePowerState( |
2772 | uint32_t powerFlags, |
2773 | OSDispatchMethod supermethod) |
2774 | { |
2775 | kern_return_t ret; |
2776 | union |
2777 | { |
2778 | IOService_ChangePowerState_Msg msg; |
2779 | struct |
2780 | { |
2781 | IOService_ChangePowerState_Rpl rpl; |
2782 | mach_msg_max_trailer_t trailer; |
2783 | } rpl; |
2784 | } buf; |
2785 | struct IOService_ChangePowerState_Msg * msg = &buf.msg; |
2786 | struct IOService_ChangePowerState_Rpl * rpl = &buf.rpl.rpl; |
2787 | |
2788 | memset(s: msg, c: 0, n: sizeof(struct IOService_ChangePowerState_Msg)); |
2789 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
2790 | msg->mach.msgh.msgh_size = sizeof(*msg); |
2791 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
2792 | | 1*kIORPCMessageSimpleReply |
2793 | | 0*kIORPCMessageLocalHost |
2794 | | 0*kIORPCMessageOnqueue; |
2795 | msg->content.__hdr.msgid = IOService_ChangePowerState_ID; |
2796 | msg->content.__object = (OSObjectRef) this; |
2797 | msg->content.__hdr.objectRefs = IOService_ChangePowerState_Msg_ObjRefs; |
2798 | msg->mach.msgh_body.msgh_descriptor_count = 1; |
2799 | |
2800 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
2801 | |
2802 | msg->content.powerFlags = powerFlags; |
2803 | |
2804 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
2805 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
2806 | else ret = ((OSObject *)this)->Invoke(rpc); |
2807 | |
2808 | if (kIOReturnSuccess == ret) |
2809 | do { |
2810 | { |
2811 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
2812 | if (rpl->content.__hdr.msgid != IOService_ChangePowerState_ID) { ret = kIOReturnIPCError; break; }; |
2813 | if (rpl->mach.msgh_body.msgh_descriptor_count != 0) { ret = kIOReturnIPCError; break; }; |
2814 | if (IOService_ChangePowerState_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
2815 | } |
2816 | } |
2817 | while (false); |
2818 | if (kIOReturnSuccess == ret) |
2819 | { |
2820 | } |
2821 | |
2822 | |
2823 | return (ret); |
2824 | } |
2825 | |
2826 | kern_return_t |
2827 | IOService::NewUserClient( |
2828 | uint32_t type, |
2829 | IOUserClient ** userClient, |
2830 | OSDispatchMethod supermethod) |
2831 | { |
2832 | kern_return_t ret; |
2833 | union |
2834 | { |
2835 | IOService_NewUserClient_Msg msg; |
2836 | struct |
2837 | { |
2838 | IOService_NewUserClient_Rpl rpl; |
2839 | mach_msg_max_trailer_t trailer; |
2840 | } rpl; |
2841 | } buf; |
2842 | struct IOService_NewUserClient_Msg * msg = &buf.msg; |
2843 | struct IOService_NewUserClient_Rpl * rpl = &buf.rpl.rpl; |
2844 | |
2845 | memset(s: msg, c: 0, n: sizeof(struct IOService_NewUserClient_Msg)); |
2846 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
2847 | msg->mach.msgh.msgh_size = sizeof(*msg); |
2848 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
2849 | | 0*kIORPCMessageSimpleReply |
2850 | | 0*kIORPCMessageLocalHost |
2851 | | 0*kIORPCMessageOnqueue; |
2852 | msg->content.__hdr.msgid = IOService_NewUserClient_ID; |
2853 | msg->content.__object = (OSObjectRef) this; |
2854 | msg->content.__hdr.objectRefs = IOService_NewUserClient_Msg_ObjRefs; |
2855 | msg->mach.msgh_body.msgh_descriptor_count = 1; |
2856 | |
2857 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
2858 | |
2859 | msg->content.type = type; |
2860 | |
2861 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
2862 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
2863 | else ret = ((OSObject *)this)->Invoke(rpc); |
2864 | |
2865 | if (kIOReturnSuccess == ret) |
2866 | do { |
2867 | { |
2868 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
2869 | if (rpl->content.__hdr.msgid != IOService_NewUserClient_ID) { ret = kIOReturnIPCError; break; }; |
2870 | if (rpl->mach.msgh_body.msgh_descriptor_count != 1) { ret = kIOReturnIPCError; break; }; |
2871 | if (IOService_NewUserClient_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
2872 | } |
2873 | } |
2874 | while (false); |
2875 | if (kIOReturnSuccess == ret) |
2876 | { |
2877 | *userClient = OSDynamicCast(IOUserClient, (OSObject *) rpl->content.userClient); |
2878 | if (rpl->content.userClient && !*userClient) ret = kIOReturnBadArgument; |
2879 | } |
2880 | |
2881 | |
2882 | return (ret); |
2883 | } |
2884 | |
2885 | kern_return_t |
2886 | IOService::Create( |
2887 | IOService * provider, |
2888 | const char * propertiesKey, |
2889 | IOService ** result, |
2890 | OSDispatchMethod supermethod) |
2891 | { |
2892 | kern_return_t ret; |
2893 | union |
2894 | { |
2895 | IOService_Create_Msg msg; |
2896 | struct |
2897 | { |
2898 | IOService_Create_Rpl rpl; |
2899 | mach_msg_max_trailer_t trailer; |
2900 | } rpl; |
2901 | } buf; |
2902 | struct IOService_Create_Msg * msg = &buf.msg; |
2903 | struct IOService_Create_Rpl * rpl = &buf.rpl.rpl; |
2904 | |
2905 | memset(s: msg, c: 0, n: sizeof(struct IOService_Create_Msg)); |
2906 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
2907 | msg->mach.msgh.msgh_size = sizeof(*msg); |
2908 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
2909 | | 0*kIORPCMessageSimpleReply |
2910 | | 0*kIORPCMessageLocalHost |
2911 | | 0*kIORPCMessageOnqueue; |
2912 | msg->content.__hdr.msgid = IOService_Create_ID; |
2913 | msg->content.__object = (OSObjectRef) this; |
2914 | msg->content.__hdr.objectRefs = IOService_Create_Msg_ObjRefs; |
2915 | msg->mach.msgh_body.msgh_descriptor_count = 2; |
2916 | |
2917 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
2918 | |
2919 | msg->provider__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
2920 | msg->content.provider = (OSObjectRef) provider; |
2921 | |
2922 | msg->content.propertiesKey = NULL; |
2923 | |
2924 | strlcpy(dst: &msg->content.__propertiesKey[0], src: propertiesKey, n: sizeof(msg->content.__propertiesKey)); |
2925 | |
2926 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
2927 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
2928 | else ret = ((OSObject *)this)->Invoke(rpc); |
2929 | |
2930 | if (kIOReturnSuccess == ret) |
2931 | do { |
2932 | { |
2933 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
2934 | if (rpl->content.__hdr.msgid != IOService_Create_ID) { ret = kIOReturnIPCError; break; }; |
2935 | if (rpl->mach.msgh_body.msgh_descriptor_count != 1) { ret = kIOReturnIPCError; break; }; |
2936 | if (IOService_Create_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
2937 | } |
2938 | } |
2939 | while (false); |
2940 | if (kIOReturnSuccess == ret) |
2941 | { |
2942 | *result = OSDynamicCast(IOService, (OSObject *) rpl->content.result); |
2943 | if (rpl->content.result && !*result) ret = kIOReturnBadArgument; |
2944 | } |
2945 | |
2946 | |
2947 | return (ret); |
2948 | } |
2949 | |
2950 | kern_return_t |
2951 | IOService::Terminate( |
2952 | uint64_t options, |
2953 | OSDispatchMethod supermethod) |
2954 | { |
2955 | kern_return_t ret; |
2956 | union |
2957 | { |
2958 | IOService_Terminate_Msg msg; |
2959 | struct |
2960 | { |
2961 | IOService_Terminate_Rpl rpl; |
2962 | mach_msg_max_trailer_t trailer; |
2963 | } rpl; |
2964 | } buf; |
2965 | struct IOService_Terminate_Msg * msg = &buf.msg; |
2966 | struct IOService_Terminate_Rpl * rpl = &buf.rpl.rpl; |
2967 | |
2968 | memset(s: msg, c: 0, n: sizeof(struct IOService_Terminate_Msg)); |
2969 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
2970 | msg->mach.msgh.msgh_size = sizeof(*msg); |
2971 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
2972 | | 1*kIORPCMessageSimpleReply |
2973 | | 0*kIORPCMessageLocalHost |
2974 | | 0*kIORPCMessageOnqueue; |
2975 | msg->content.__hdr.msgid = IOService_Terminate_ID; |
2976 | msg->content.__object = (OSObjectRef) this; |
2977 | msg->content.__hdr.objectRefs = IOService_Terminate_Msg_ObjRefs; |
2978 | msg->mach.msgh_body.msgh_descriptor_count = 1; |
2979 | |
2980 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
2981 | |
2982 | msg->content.options = options; |
2983 | |
2984 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
2985 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
2986 | else ret = ((OSObject *)this)->Invoke(rpc); |
2987 | |
2988 | if (kIOReturnSuccess == ret) |
2989 | do { |
2990 | { |
2991 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
2992 | if (rpl->content.__hdr.msgid != IOService_Terminate_ID) { ret = kIOReturnIPCError; break; }; |
2993 | if (rpl->mach.msgh_body.msgh_descriptor_count != 0) { ret = kIOReturnIPCError; break; }; |
2994 | if (IOService_Terminate_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
2995 | } |
2996 | } |
2997 | while (false); |
2998 | if (kIOReturnSuccess == ret) |
2999 | { |
3000 | } |
3001 | |
3002 | |
3003 | return (ret); |
3004 | } |
3005 | |
3006 | kern_return_t |
3007 | IOService::CopyProviderProperties( |
3008 | OSArray * propertyKeys, |
3009 | OSArray ** properties, |
3010 | OSDispatchMethod supermethod) |
3011 | { |
3012 | kern_return_t ret; |
3013 | union |
3014 | { |
3015 | IOService_CopyProviderProperties_Msg msg; |
3016 | struct |
3017 | { |
3018 | IOService_CopyProviderProperties_Rpl rpl; |
3019 | mach_msg_max_trailer_t trailer; |
3020 | } rpl; |
3021 | } buf; |
3022 | struct IOService_CopyProviderProperties_Msg * msg = &buf.msg; |
3023 | struct IOService_CopyProviderProperties_Rpl * rpl = &buf.rpl.rpl; |
3024 | |
3025 | memset(s: msg, c: 0, n: sizeof(struct IOService_CopyProviderProperties_Msg)); |
3026 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
3027 | msg->mach.msgh.msgh_size = sizeof(*msg); |
3028 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
3029 | | 0*kIORPCMessageSimpleReply |
3030 | | 0*kIORPCMessageLocalHost |
3031 | | 0*kIORPCMessageOnqueue; |
3032 | msg->content.__hdr.msgid = IOService_CopyProviderProperties_ID; |
3033 | msg->content.__object = (OSObjectRef) this; |
3034 | msg->content.__hdr.objectRefs = IOService_CopyProviderProperties_Msg_ObjRefs; |
3035 | msg->mach.msgh_body.msgh_descriptor_count = 2; |
3036 | |
3037 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
3038 | |
3039 | msg->propertyKeys__descriptor.type = MACH_MSG_OOL_DESCRIPTOR; |
3040 | msg->propertyKeys__descriptor.copy = MACH_MSG_VIRTUAL_COPY; |
3041 | msg->propertyKeys__descriptor.address = (void *) __builtin_offsetof(IOService_CopyProviderProperties_Msg_Content, propertyKeys); |
3042 | msg->content.propertyKeys = propertyKeys; |
3043 | |
3044 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
3045 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
3046 | else ret = ((OSObject *)this)->Invoke(rpc); |
3047 | |
3048 | if (kIOReturnSuccess == ret) |
3049 | do { |
3050 | { |
3051 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
3052 | if (rpl->content.__hdr.msgid != IOService_CopyProviderProperties_ID) { ret = kIOReturnIPCError; break; }; |
3053 | if (rpl->mach.msgh_body.msgh_descriptor_count != 1) { ret = kIOReturnIPCError; break; }; |
3054 | if (IOService_CopyProviderProperties_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
3055 | } |
3056 | } |
3057 | while (false); |
3058 | if (kIOReturnSuccess == ret) |
3059 | { |
3060 | *properties = OSDynamicCast(OSArray, (OSObject *) rpl->content.properties); |
3061 | if (rpl->content.properties && !*properties) ret = kIOReturnBadArgument; |
3062 | } |
3063 | |
3064 | |
3065 | return (ret); |
3066 | } |
3067 | |
3068 | kern_return_t |
3069 | IOService::RequireMaxBusStall( |
3070 | uint64_t maxBusStall, |
3071 | OSDispatchMethod supermethod) |
3072 | { |
3073 | kern_return_t ret; |
3074 | union |
3075 | { |
3076 | IOService_RequireMaxBusStall_Msg msg; |
3077 | struct |
3078 | { |
3079 | IOService_RequireMaxBusStall_Rpl rpl; |
3080 | mach_msg_max_trailer_t trailer; |
3081 | } rpl; |
3082 | } buf; |
3083 | struct IOService_RequireMaxBusStall_Msg * msg = &buf.msg; |
3084 | struct IOService_RequireMaxBusStall_Rpl * rpl = &buf.rpl.rpl; |
3085 | |
3086 | memset(s: msg, c: 0, n: sizeof(struct IOService_RequireMaxBusStall_Msg)); |
3087 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
3088 | msg->mach.msgh.msgh_size = sizeof(*msg); |
3089 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
3090 | | 1*kIORPCMessageSimpleReply |
3091 | | 0*kIORPCMessageLocalHost |
3092 | | 0*kIORPCMessageOnqueue; |
3093 | msg->content.__hdr.msgid = IOService_RequireMaxBusStall_ID; |
3094 | msg->content.__object = (OSObjectRef) this; |
3095 | msg->content.__hdr.objectRefs = IOService_RequireMaxBusStall_Msg_ObjRefs; |
3096 | msg->mach.msgh_body.msgh_descriptor_count = 1; |
3097 | |
3098 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
3099 | |
3100 | msg->content.maxBusStall = maxBusStall; |
3101 | |
3102 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
3103 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
3104 | else ret = ((OSObject *)this)->Invoke(rpc); |
3105 | |
3106 | if (kIOReturnSuccess == ret) |
3107 | do { |
3108 | { |
3109 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
3110 | if (rpl->content.__hdr.msgid != IOService_RequireMaxBusStall_ID) { ret = kIOReturnIPCError; break; }; |
3111 | if (rpl->mach.msgh_body.msgh_descriptor_count != 0) { ret = kIOReturnIPCError; break; }; |
3112 | if (IOService_RequireMaxBusStall_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
3113 | } |
3114 | } |
3115 | while (false); |
3116 | if (kIOReturnSuccess == ret) |
3117 | { |
3118 | } |
3119 | |
3120 | |
3121 | return (ret); |
3122 | } |
3123 | |
3124 | kern_return_t |
3125 | IOService::AdjustBusy( |
3126 | int32_t delta, |
3127 | OSDispatchMethod supermethod) |
3128 | { |
3129 | kern_return_t ret; |
3130 | union |
3131 | { |
3132 | IOService_AdjustBusy_Msg msg; |
3133 | struct |
3134 | { |
3135 | IOService_AdjustBusy_Rpl rpl; |
3136 | mach_msg_max_trailer_t trailer; |
3137 | } rpl; |
3138 | } buf; |
3139 | struct IOService_AdjustBusy_Msg * msg = &buf.msg; |
3140 | struct IOService_AdjustBusy_Rpl * rpl = &buf.rpl.rpl; |
3141 | |
3142 | memset(s: msg, c: 0, n: sizeof(struct IOService_AdjustBusy_Msg)); |
3143 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
3144 | msg->mach.msgh.msgh_size = sizeof(*msg); |
3145 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
3146 | | 1*kIORPCMessageSimpleReply |
3147 | | 0*kIORPCMessageLocalHost |
3148 | | 0*kIORPCMessageOnqueue; |
3149 | msg->content.__hdr.msgid = IOService_AdjustBusy_ID; |
3150 | msg->content.__object = (OSObjectRef) this; |
3151 | msg->content.__hdr.objectRefs = IOService_AdjustBusy_Msg_ObjRefs; |
3152 | msg->mach.msgh_body.msgh_descriptor_count = 1; |
3153 | |
3154 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
3155 | |
3156 | msg->content.delta = delta; |
3157 | |
3158 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
3159 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
3160 | else ret = ((OSObject *)this)->Invoke(rpc); |
3161 | |
3162 | if (kIOReturnSuccess == ret) |
3163 | do { |
3164 | { |
3165 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
3166 | if (rpl->content.__hdr.msgid != IOService_AdjustBusy_ID) { ret = kIOReturnIPCError; break; }; |
3167 | if (rpl->mach.msgh_body.msgh_descriptor_count != 0) { ret = kIOReturnIPCError; break; }; |
3168 | if (IOService_AdjustBusy_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
3169 | } |
3170 | } |
3171 | while (false); |
3172 | if (kIOReturnSuccess == ret) |
3173 | { |
3174 | } |
3175 | |
3176 | |
3177 | return (ret); |
3178 | } |
3179 | |
3180 | kern_return_t |
3181 | IOService::GetBusyState( |
3182 | uint32_t * busyState, |
3183 | OSDispatchMethod supermethod) |
3184 | { |
3185 | kern_return_t ret; |
3186 | union |
3187 | { |
3188 | IOService_GetBusyState_Msg msg; |
3189 | struct |
3190 | { |
3191 | IOService_GetBusyState_Rpl rpl; |
3192 | mach_msg_max_trailer_t trailer; |
3193 | } rpl; |
3194 | } buf; |
3195 | struct IOService_GetBusyState_Msg * msg = &buf.msg; |
3196 | struct IOService_GetBusyState_Rpl * rpl = &buf.rpl.rpl; |
3197 | |
3198 | memset(s: msg, c: 0, n: sizeof(struct IOService_GetBusyState_Msg)); |
3199 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
3200 | msg->mach.msgh.msgh_size = sizeof(*msg); |
3201 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
3202 | | 1*kIORPCMessageSimpleReply |
3203 | | 0*kIORPCMessageLocalHost |
3204 | | 0*kIORPCMessageOnqueue; |
3205 | msg->content.__hdr.msgid = IOService_GetBusyState_ID; |
3206 | msg->content.__object = (OSObjectRef) this; |
3207 | msg->content.__hdr.objectRefs = IOService_GetBusyState_Msg_ObjRefs; |
3208 | msg->mach.msgh_body.msgh_descriptor_count = 1; |
3209 | |
3210 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
3211 | |
3212 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
3213 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
3214 | else ret = ((OSObject *)this)->Invoke(rpc); |
3215 | |
3216 | if (kIOReturnSuccess == ret) |
3217 | do { |
3218 | { |
3219 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
3220 | if (rpl->content.__hdr.msgid != IOService_GetBusyState_ID) { ret = kIOReturnIPCError; break; }; |
3221 | if (rpl->mach.msgh_body.msgh_descriptor_count != 0) { ret = kIOReturnIPCError; break; }; |
3222 | if (IOService_GetBusyState_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
3223 | } |
3224 | } |
3225 | while (false); |
3226 | if (kIOReturnSuccess == ret) |
3227 | { |
3228 | if (busyState) *busyState = rpl->content.busyState; |
3229 | } |
3230 | |
3231 | |
3232 | return (ret); |
3233 | } |
3234 | |
3235 | kern_return_t |
3236 | IOService::CoreAnalyticsSendEvent( |
3237 | uint64_t options, |
3238 | OSString * eventName, |
3239 | OSDictionary * eventPayload, |
3240 | OSDispatchMethod supermethod) |
3241 | { |
3242 | kern_return_t ret; |
3243 | union |
3244 | { |
3245 | IOService_CoreAnalyticsSendEvent_Msg msg; |
3246 | struct |
3247 | { |
3248 | IOService_CoreAnalyticsSendEvent_Rpl rpl; |
3249 | mach_msg_max_trailer_t trailer; |
3250 | } rpl; |
3251 | } buf; |
3252 | struct IOService_CoreAnalyticsSendEvent_Msg * msg = &buf.msg; |
3253 | struct IOService_CoreAnalyticsSendEvent_Rpl * rpl = &buf.rpl.rpl; |
3254 | |
3255 | memset(s: msg, c: 0, n: sizeof(struct IOService_CoreAnalyticsSendEvent_Msg)); |
3256 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
3257 | msg->mach.msgh.msgh_size = sizeof(*msg); |
3258 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
3259 | | 0*kIORPCMessageSimpleReply |
3260 | | 0*kIORPCMessageLocalHost |
3261 | | 0*kIORPCMessageOnqueue; |
3262 | msg->content.__hdr.msgid = IOService_CoreAnalyticsSendEvent_ID; |
3263 | msg->content.__object = (OSObjectRef) this; |
3264 | msg->content.__hdr.objectRefs = IOService_CoreAnalyticsSendEvent_Msg_ObjRefs; |
3265 | msg->mach.msgh_body.msgh_descriptor_count = 3; |
3266 | |
3267 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
3268 | |
3269 | msg->content.options = options; |
3270 | |
3271 | msg->eventName__descriptor.type = MACH_MSG_OOL_DESCRIPTOR; |
3272 | msg->eventName__descriptor.copy = MACH_MSG_VIRTUAL_COPY; |
3273 | msg->eventName__descriptor.address = (void *) __builtin_offsetof(IOService_CoreAnalyticsSendEvent_Msg_Content, eventName); |
3274 | msg->content.eventName = eventName; |
3275 | |
3276 | msg->eventPayload__descriptor.type = MACH_MSG_OOL_DESCRIPTOR; |
3277 | msg->eventPayload__descriptor.copy = MACH_MSG_VIRTUAL_COPY; |
3278 | msg->eventPayload__descriptor.address = (void *) __builtin_offsetof(IOService_CoreAnalyticsSendEvent_Msg_Content, eventPayload); |
3279 | msg->content.eventPayload = eventPayload; |
3280 | |
3281 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
3282 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
3283 | else ret = ((OSObject *)this)->Invoke(rpc); |
3284 | |
3285 | if (kIOReturnSuccess == ret) |
3286 | do { |
3287 | { |
3288 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
3289 | if (rpl->content.__hdr.msgid != IOService_CoreAnalyticsSendEvent_ID) { ret = kIOReturnIPCError; break; }; |
3290 | if (rpl->mach.msgh_body.msgh_descriptor_count != 0) { ret = kIOReturnIPCError; break; }; |
3291 | if (IOService_CoreAnalyticsSendEvent_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
3292 | } |
3293 | } |
3294 | while (false); |
3295 | if (kIOReturnSuccess == ret) |
3296 | { |
3297 | } |
3298 | |
3299 | |
3300 | return (ret); |
3301 | } |
3302 | |
3303 | IOReturn |
3304 | IOService::UpdateReport( |
3305 | OSData * channels, |
3306 | uint32_t action, |
3307 | uint32_t * outElementCount, |
3308 | uint64_t offset, |
3309 | uint64_t capacity, |
3310 | IOMemoryDescriptor * buffer, |
3311 | OSDispatchMethod supermethod) |
3312 | { |
3313 | kern_return_t ret; |
3314 | union |
3315 | { |
3316 | IOService_UpdateReport_Msg msg; |
3317 | struct |
3318 | { |
3319 | IOService_UpdateReport_Rpl rpl; |
3320 | mach_msg_max_trailer_t trailer; |
3321 | } rpl; |
3322 | } buf; |
3323 | struct IOService_UpdateReport_Msg * msg = &buf.msg; |
3324 | struct IOService_UpdateReport_Rpl * rpl = &buf.rpl.rpl; |
3325 | |
3326 | memset(s: msg, c: 0, n: sizeof(struct IOService_UpdateReport_Msg)); |
3327 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
3328 | msg->mach.msgh.msgh_size = sizeof(*msg); |
3329 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
3330 | | 0*kIORPCMessageSimpleReply |
3331 | | 0*kIORPCMessageLocalHost |
3332 | | 0*kIORPCMessageOnqueue; |
3333 | msg->content.__hdr.msgid = IOService_UpdateReport_ID; |
3334 | msg->content.__object = (OSObjectRef) this; |
3335 | msg->content.__hdr.objectRefs = IOService_UpdateReport_Msg_ObjRefs; |
3336 | msg->mach.msgh_body.msgh_descriptor_count = 3; |
3337 | |
3338 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
3339 | |
3340 | msg->channels__descriptor.type = MACH_MSG_OOL_DESCRIPTOR; |
3341 | msg->channels__descriptor.copy = MACH_MSG_VIRTUAL_COPY; |
3342 | msg->channels__descriptor.address = (void *) __builtin_offsetof(IOService_UpdateReport_Msg_Content, channels); |
3343 | msg->content.channels = channels; |
3344 | |
3345 | msg->content.action = action; |
3346 | |
3347 | msg->content.offset = offset; |
3348 | |
3349 | msg->content.capacity = capacity; |
3350 | |
3351 | msg->buffer__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
3352 | msg->content.buffer = (OSObjectRef) buffer; |
3353 | |
3354 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
3355 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
3356 | else ret = ((OSObject *)this)->Invoke(rpc); |
3357 | |
3358 | if (kIOReturnSuccess == ret) |
3359 | do { |
3360 | { |
3361 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
3362 | if (rpl->content.__hdr.msgid != IOService_UpdateReport_ID) { ret = kIOReturnIPCError; break; }; |
3363 | if (rpl->mach.msgh_body.msgh_descriptor_count != 0) { ret = kIOReturnIPCError; break; }; |
3364 | if (IOService_UpdateReport_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
3365 | } |
3366 | } |
3367 | while (false); |
3368 | if (kIOReturnSuccess == ret) |
3369 | { |
3370 | if (outElementCount) *outElementCount = rpl->content.outElementCount; |
3371 | } |
3372 | |
3373 | |
3374 | return (ret); |
3375 | } |
3376 | |
3377 | IOReturn |
3378 | IOService::ConfigureReport( |
3379 | OSData * channels, |
3380 | uint32_t action, |
3381 | uint32_t * outCount, |
3382 | OSDispatchMethod supermethod) |
3383 | { |
3384 | kern_return_t ret; |
3385 | union |
3386 | { |
3387 | IOService_ConfigureReport_Msg msg; |
3388 | struct |
3389 | { |
3390 | IOService_ConfigureReport_Rpl rpl; |
3391 | mach_msg_max_trailer_t trailer; |
3392 | } rpl; |
3393 | } buf; |
3394 | struct IOService_ConfigureReport_Msg * msg = &buf.msg; |
3395 | struct IOService_ConfigureReport_Rpl * rpl = &buf.rpl.rpl; |
3396 | |
3397 | memset(s: msg, c: 0, n: sizeof(struct IOService_ConfigureReport_Msg)); |
3398 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
3399 | msg->mach.msgh.msgh_size = sizeof(*msg); |
3400 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
3401 | | 0*kIORPCMessageSimpleReply |
3402 | | 0*kIORPCMessageLocalHost |
3403 | | 0*kIORPCMessageOnqueue; |
3404 | msg->content.__hdr.msgid = IOService_ConfigureReport_ID; |
3405 | msg->content.__object = (OSObjectRef) this; |
3406 | msg->content.__hdr.objectRefs = IOService_ConfigureReport_Msg_ObjRefs; |
3407 | msg->mach.msgh_body.msgh_descriptor_count = 2; |
3408 | |
3409 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
3410 | |
3411 | msg->channels__descriptor.type = MACH_MSG_OOL_DESCRIPTOR; |
3412 | msg->channels__descriptor.copy = MACH_MSG_VIRTUAL_COPY; |
3413 | msg->channels__descriptor.address = (void *) __builtin_offsetof(IOService_ConfigureReport_Msg_Content, channels); |
3414 | msg->content.channels = channels; |
3415 | |
3416 | msg->content.action = action; |
3417 | |
3418 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
3419 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
3420 | else ret = ((OSObject *)this)->Invoke(rpc); |
3421 | |
3422 | if (kIOReturnSuccess == ret) |
3423 | do { |
3424 | { |
3425 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
3426 | if (rpl->content.__hdr.msgid != IOService_ConfigureReport_ID) { ret = kIOReturnIPCError; break; }; |
3427 | if (rpl->mach.msgh_body.msgh_descriptor_count != 0) { ret = kIOReturnIPCError; break; }; |
3428 | if (IOService_ConfigureReport_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
3429 | } |
3430 | } |
3431 | while (false); |
3432 | if (kIOReturnSuccess == ret) |
3433 | { |
3434 | if (outCount) *outCount = rpl->content.outCount; |
3435 | } |
3436 | |
3437 | |
3438 | return (ret); |
3439 | } |
3440 | |
3441 | IOReturn |
3442 | IOService::SetLegend( |
3443 | OSArray * legend, |
3444 | bool is_public, |
3445 | OSDispatchMethod supermethod) |
3446 | { |
3447 | kern_return_t ret; |
3448 | union |
3449 | { |
3450 | IOService_SetLegend_Msg msg; |
3451 | struct |
3452 | { |
3453 | IOService_SetLegend_Rpl rpl; |
3454 | mach_msg_max_trailer_t trailer; |
3455 | } rpl; |
3456 | } buf; |
3457 | struct IOService_SetLegend_Msg * msg = &buf.msg; |
3458 | struct IOService_SetLegend_Rpl * rpl = &buf.rpl.rpl; |
3459 | |
3460 | memset(s: msg, c: 0, n: sizeof(struct IOService_SetLegend_Msg)); |
3461 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
3462 | msg->mach.msgh.msgh_size = sizeof(*msg); |
3463 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
3464 | | 0*kIORPCMessageSimpleReply |
3465 | | 0*kIORPCMessageLocalHost |
3466 | | 0*kIORPCMessageOnqueue; |
3467 | msg->content.__hdr.msgid = IOService_SetLegend_ID; |
3468 | msg->content.__object = (OSObjectRef) this; |
3469 | msg->content.__hdr.objectRefs = IOService_SetLegend_Msg_ObjRefs; |
3470 | msg->mach.msgh_body.msgh_descriptor_count = 2; |
3471 | |
3472 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
3473 | |
3474 | msg->legend__descriptor.type = MACH_MSG_OOL_DESCRIPTOR; |
3475 | msg->legend__descriptor.copy = MACH_MSG_VIRTUAL_COPY; |
3476 | msg->legend__descriptor.address = (void *) __builtin_offsetof(IOService_SetLegend_Msg_Content, legend); |
3477 | msg->content.legend = legend; |
3478 | |
3479 | msg->content.is_public = is_public; |
3480 | |
3481 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
3482 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
3483 | else ret = ((OSObject *)this)->Invoke(rpc); |
3484 | |
3485 | if (kIOReturnSuccess == ret) |
3486 | do { |
3487 | { |
3488 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
3489 | if (rpl->content.__hdr.msgid != IOService_SetLegend_ID) { ret = kIOReturnIPCError; break; }; |
3490 | if (rpl->mach.msgh_body.msgh_descriptor_count != 0) { ret = kIOReturnIPCError; break; }; |
3491 | if (IOService_SetLegend_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
3492 | } |
3493 | } |
3494 | while (false); |
3495 | if (kIOReturnSuccess == ret) |
3496 | { |
3497 | } |
3498 | |
3499 | |
3500 | return (ret); |
3501 | } |
3502 | |
3503 | kern_return_t |
3504 | IOService::CopyName( |
3505 | OSString ** name, |
3506 | OSDispatchMethod supermethod) |
3507 | { |
3508 | kern_return_t ret; |
3509 | union |
3510 | { |
3511 | IOService_CopyName_Msg msg; |
3512 | struct |
3513 | { |
3514 | IOService_CopyName_Rpl rpl; |
3515 | mach_msg_max_trailer_t trailer; |
3516 | } rpl; |
3517 | } buf; |
3518 | struct IOService_CopyName_Msg * msg = &buf.msg; |
3519 | struct IOService_CopyName_Rpl * rpl = &buf.rpl.rpl; |
3520 | |
3521 | memset(s: msg, c: 0, n: sizeof(struct IOService_CopyName_Msg)); |
3522 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
3523 | msg->mach.msgh.msgh_size = sizeof(*msg); |
3524 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
3525 | | 0*kIORPCMessageSimpleReply |
3526 | | 0*kIORPCMessageLocalHost |
3527 | | 0*kIORPCMessageOnqueue; |
3528 | msg->content.__hdr.msgid = IOService_CopyName_ID; |
3529 | msg->content.__object = (OSObjectRef) this; |
3530 | msg->content.__hdr.objectRefs = IOService_CopyName_Msg_ObjRefs; |
3531 | msg->mach.msgh_body.msgh_descriptor_count = 1; |
3532 | |
3533 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
3534 | |
3535 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
3536 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
3537 | else ret = ((OSObject *)this)->Invoke(rpc); |
3538 | |
3539 | if (kIOReturnSuccess == ret) |
3540 | do { |
3541 | { |
3542 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
3543 | if (rpl->content.__hdr.msgid != IOService_CopyName_ID) { ret = kIOReturnIPCError; break; }; |
3544 | if (rpl->mach.msgh_body.msgh_descriptor_count != 1) { ret = kIOReturnIPCError; break; }; |
3545 | if (IOService_CopyName_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
3546 | } |
3547 | } |
3548 | while (false); |
3549 | if (kIOReturnSuccess == ret) |
3550 | { |
3551 | *name = OSDynamicCast(OSString, (OSObject *) rpl->content.name); |
3552 | if (rpl->content.name && !*name) ret = kIOReturnBadArgument; |
3553 | } |
3554 | |
3555 | |
3556 | return (ret); |
3557 | } |
3558 | |
3559 | kern_return_t |
3560 | IOService::StringFromReturn( |
3561 | IOReturn retval, |
3562 | OSString ** str, |
3563 | OSDispatchMethod supermethod) |
3564 | { |
3565 | kern_return_t ret; |
3566 | union |
3567 | { |
3568 | IOService_StringFromReturn_Msg msg; |
3569 | struct |
3570 | { |
3571 | IOService_StringFromReturn_Rpl rpl; |
3572 | mach_msg_max_trailer_t trailer; |
3573 | } rpl; |
3574 | } buf; |
3575 | struct IOService_StringFromReturn_Msg * msg = &buf.msg; |
3576 | struct IOService_StringFromReturn_Rpl * rpl = &buf.rpl.rpl; |
3577 | |
3578 | memset(s: msg, c: 0, n: sizeof(struct IOService_StringFromReturn_Msg)); |
3579 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
3580 | msg->mach.msgh.msgh_size = sizeof(*msg); |
3581 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
3582 | | 0*kIORPCMessageSimpleReply |
3583 | | 0*kIORPCMessageLocalHost |
3584 | | 0*kIORPCMessageOnqueue; |
3585 | msg->content.__hdr.msgid = IOService_StringFromReturn_ID; |
3586 | msg->content.__object = (OSObjectRef) this; |
3587 | msg->content.__hdr.objectRefs = IOService_StringFromReturn_Msg_ObjRefs; |
3588 | msg->mach.msgh_body.msgh_descriptor_count = 1; |
3589 | |
3590 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
3591 | |
3592 | msg->content.retval = retval; |
3593 | |
3594 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
3595 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
3596 | else ret = ((OSObject *)this)->Invoke(rpc); |
3597 | |
3598 | if (kIOReturnSuccess == ret) |
3599 | do { |
3600 | { |
3601 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
3602 | if (rpl->content.__hdr.msgid != IOService_StringFromReturn_ID) { ret = kIOReturnIPCError; break; }; |
3603 | if (rpl->mach.msgh_body.msgh_descriptor_count != 1) { ret = kIOReturnIPCError; break; }; |
3604 | if (IOService_StringFromReturn_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
3605 | } |
3606 | } |
3607 | while (false); |
3608 | if (kIOReturnSuccess == ret) |
3609 | { |
3610 | *str = OSDynamicCast(OSString, (OSObject *) rpl->content.str); |
3611 | if (rpl->content.str && !*str) ret = kIOReturnBadArgument; |
3612 | } |
3613 | |
3614 | |
3615 | return (ret); |
3616 | } |
3617 | |
3618 | kern_return_t |
3619 | IOService::_ClaimSystemWakeEvent( |
3620 | IOService * device, |
3621 | uint64_t flags, |
3622 | const char * reason, |
3623 | OSContainer * details, |
3624 | OSDispatchMethod supermethod) |
3625 | { |
3626 | kern_return_t ret; |
3627 | union |
3628 | { |
3629 | IOService__ClaimSystemWakeEvent_Msg msg; |
3630 | struct |
3631 | { |
3632 | IOService__ClaimSystemWakeEvent_Rpl rpl; |
3633 | mach_msg_max_trailer_t trailer; |
3634 | } rpl; |
3635 | } buf; |
3636 | struct IOService__ClaimSystemWakeEvent_Msg * msg = &buf.msg; |
3637 | struct IOService__ClaimSystemWakeEvent_Rpl * rpl = &buf.rpl.rpl; |
3638 | |
3639 | memset(s: msg, c: 0, n: sizeof(struct IOService__ClaimSystemWakeEvent_Msg)); |
3640 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
3641 | msg->mach.msgh.msgh_size = sizeof(*msg); |
3642 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
3643 | | 0*kIORPCMessageSimpleReply |
3644 | | 0*kIORPCMessageLocalHost |
3645 | | 0*kIORPCMessageOnqueue; |
3646 | msg->content.__hdr.msgid = IOService__ClaimSystemWakeEvent_ID; |
3647 | msg->content.__object = (OSObjectRef) this; |
3648 | msg->content.__hdr.objectRefs = IOService__ClaimSystemWakeEvent_Msg_ObjRefs; |
3649 | msg->mach.msgh_body.msgh_descriptor_count = 3; |
3650 | |
3651 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
3652 | |
3653 | msg->device__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
3654 | msg->content.device = (OSObjectRef) device; |
3655 | |
3656 | msg->content.flags = flags; |
3657 | |
3658 | msg->content.reason = NULL; |
3659 | |
3660 | strlcpy(dst: &msg->content.__reason[0], src: reason, n: sizeof(msg->content.__reason)); |
3661 | |
3662 | msg->details__descriptor.type = MACH_MSG_OOL_DESCRIPTOR; |
3663 | msg->details__descriptor.copy = MACH_MSG_VIRTUAL_COPY; |
3664 | msg->details__descriptor.address = (void *) __builtin_offsetof(IOService__ClaimSystemWakeEvent_Msg_Content, details); |
3665 | msg->content.details = details; |
3666 | |
3667 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
3668 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
3669 | else ret = ((OSObject *)this)->Invoke(rpc); |
3670 | |
3671 | if (kIOReturnSuccess == ret) |
3672 | do { |
3673 | { |
3674 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
3675 | if (rpl->content.__hdr.msgid != IOService__ClaimSystemWakeEvent_ID) { ret = kIOReturnIPCError; break; }; |
3676 | if (rpl->mach.msgh_body.msgh_descriptor_count != 0) { ret = kIOReturnIPCError; break; }; |
3677 | if (IOService__ClaimSystemWakeEvent_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
3678 | } |
3679 | } |
3680 | while (false); |
3681 | if (kIOReturnSuccess == ret) |
3682 | { |
3683 | } |
3684 | |
3685 | |
3686 | return (ret); |
3687 | } |
3688 | |
3689 | kern_return_t |
3690 | IOService::UserSetProperties( |
3691 | OSContainer * properties, |
3692 | OSDispatchMethod supermethod) |
3693 | { |
3694 | kern_return_t ret; |
3695 | union |
3696 | { |
3697 | IOService_UserSetProperties_Msg msg; |
3698 | struct |
3699 | { |
3700 | IOService_UserSetProperties_Rpl rpl; |
3701 | mach_msg_max_trailer_t trailer; |
3702 | } rpl; |
3703 | } buf; |
3704 | struct IOService_UserSetProperties_Msg * msg = &buf.msg; |
3705 | struct IOService_UserSetProperties_Rpl * rpl = &buf.rpl.rpl; |
3706 | |
3707 | memset(s: msg, c: 0, n: sizeof(struct IOService_UserSetProperties_Msg)); |
3708 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
3709 | msg->mach.msgh.msgh_size = sizeof(*msg); |
3710 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
3711 | | 0*kIORPCMessageSimpleReply |
3712 | | 0*kIORPCMessageLocalHost |
3713 | | 0*kIORPCMessageOnqueue; |
3714 | msg->content.__hdr.msgid = IOService_UserSetProperties_ID; |
3715 | msg->content.__object = (OSObjectRef) this; |
3716 | msg->content.__hdr.objectRefs = IOService_UserSetProperties_Msg_ObjRefs; |
3717 | msg->mach.msgh_body.msgh_descriptor_count = 2; |
3718 | |
3719 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
3720 | |
3721 | msg->properties__descriptor.type = MACH_MSG_OOL_DESCRIPTOR; |
3722 | msg->properties__descriptor.copy = MACH_MSG_VIRTUAL_COPY; |
3723 | msg->properties__descriptor.address = (void *) __builtin_offsetof(IOService_UserSetProperties_Msg_Content, properties); |
3724 | msg->content.properties = properties; |
3725 | |
3726 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
3727 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
3728 | else ret = ((OSObject *)this)->Invoke(rpc); |
3729 | |
3730 | if (kIOReturnSuccess == ret) |
3731 | do { |
3732 | { |
3733 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
3734 | if (rpl->content.__hdr.msgid != IOService_UserSetProperties_ID) { ret = kIOReturnIPCError; break; }; |
3735 | if (rpl->mach.msgh_body.msgh_descriptor_count != 0) { ret = kIOReturnIPCError; break; }; |
3736 | if (IOService_UserSetProperties_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
3737 | } |
3738 | } |
3739 | while (false); |
3740 | if (kIOReturnSuccess == ret) |
3741 | { |
3742 | } |
3743 | |
3744 | |
3745 | return (ret); |
3746 | } |
3747 | |
3748 | kern_return_t |
3749 | IOService::SendIOMessageServicePropertyChange( OSDispatchMethod supermethod) |
3750 | { |
3751 | kern_return_t ret; |
3752 | union |
3753 | { |
3754 | IOService_SendIOMessageServicePropertyChange_Msg msg; |
3755 | struct |
3756 | { |
3757 | IOService_SendIOMessageServicePropertyChange_Rpl rpl; |
3758 | mach_msg_max_trailer_t trailer; |
3759 | } rpl; |
3760 | } buf; |
3761 | struct IOService_SendIOMessageServicePropertyChange_Msg * msg = &buf.msg; |
3762 | struct IOService_SendIOMessageServicePropertyChange_Rpl * rpl = &buf.rpl.rpl; |
3763 | |
3764 | memset(s: msg, c: 0, n: sizeof(struct IOService_SendIOMessageServicePropertyChange_Msg)); |
3765 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
3766 | msg->mach.msgh.msgh_size = sizeof(*msg); |
3767 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
3768 | | 1*kIORPCMessageSimpleReply |
3769 | | 0*kIORPCMessageLocalHost |
3770 | | 0*kIORPCMessageOnqueue; |
3771 | msg->content.__hdr.msgid = IOService_SendIOMessageServicePropertyChange_ID; |
3772 | msg->content.__object = (OSObjectRef) this; |
3773 | msg->content.__hdr.objectRefs = IOService_SendIOMessageServicePropertyChange_Msg_ObjRefs; |
3774 | msg->mach.msgh_body.msgh_descriptor_count = 1; |
3775 | |
3776 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
3777 | |
3778 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
3779 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
3780 | else ret = ((OSObject *)this)->Invoke(rpc); |
3781 | |
3782 | if (kIOReturnSuccess == ret) |
3783 | do { |
3784 | { |
3785 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
3786 | if (rpl->content.__hdr.msgid != IOService_SendIOMessageServicePropertyChange_ID) { ret = kIOReturnIPCError; break; }; |
3787 | if (rpl->mach.msgh_body.msgh_descriptor_count != 0) { ret = kIOReturnIPCError; break; }; |
3788 | if (IOService_SendIOMessageServicePropertyChange_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
3789 | } |
3790 | } |
3791 | while (false); |
3792 | if (kIOReturnSuccess == ret) |
3793 | { |
3794 | } |
3795 | |
3796 | |
3797 | return (ret); |
3798 | } |
3799 | |
3800 | kern_return_t |
3801 | IOService::RemoveProperty( |
3802 | OSString * propertyName, |
3803 | OSDispatchMethod supermethod) |
3804 | { |
3805 | kern_return_t ret; |
3806 | union |
3807 | { |
3808 | IOService_RemoveProperty_Msg msg; |
3809 | struct |
3810 | { |
3811 | IOService_RemoveProperty_Rpl rpl; |
3812 | mach_msg_max_trailer_t trailer; |
3813 | } rpl; |
3814 | } buf; |
3815 | struct IOService_RemoveProperty_Msg * msg = &buf.msg; |
3816 | struct IOService_RemoveProperty_Rpl * rpl = &buf.rpl.rpl; |
3817 | |
3818 | memset(s: msg, c: 0, n: sizeof(struct IOService_RemoveProperty_Msg)); |
3819 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
3820 | msg->mach.msgh.msgh_size = sizeof(*msg); |
3821 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
3822 | | 0*kIORPCMessageSimpleReply |
3823 | | 0*kIORPCMessageLocalHost |
3824 | | 0*kIORPCMessageOnqueue; |
3825 | msg->content.__hdr.msgid = IOService_RemoveProperty_ID; |
3826 | msg->content.__object = (OSObjectRef) this; |
3827 | msg->content.__hdr.objectRefs = IOService_RemoveProperty_Msg_ObjRefs; |
3828 | msg->mach.msgh_body.msgh_descriptor_count = 2; |
3829 | |
3830 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
3831 | |
3832 | msg->propertyName__descriptor.type = MACH_MSG_OOL_DESCRIPTOR; |
3833 | msg->propertyName__descriptor.copy = MACH_MSG_VIRTUAL_COPY; |
3834 | msg->propertyName__descriptor.address = (void *) __builtin_offsetof(IOService_RemoveProperty_Msg_Content, propertyName); |
3835 | msg->content.propertyName = propertyName; |
3836 | |
3837 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
3838 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
3839 | else ret = ((OSObject *)this)->Invoke(rpc); |
3840 | |
3841 | if (kIOReturnSuccess == ret) |
3842 | do { |
3843 | { |
3844 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
3845 | if (rpl->content.__hdr.msgid != IOService_RemoveProperty_ID) { ret = kIOReturnIPCError; break; }; |
3846 | if (rpl->mach.msgh_body.msgh_descriptor_count != 0) { ret = kIOReturnIPCError; break; }; |
3847 | if (IOService_RemoveProperty_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
3848 | } |
3849 | } |
3850 | while (false); |
3851 | if (kIOReturnSuccess == ret) |
3852 | { |
3853 | } |
3854 | |
3855 | |
3856 | return (ret); |
3857 | } |
3858 | |
3859 | kern_return_t |
3860 | IOService::CopySystemStateNotificationService( |
3861 | IOService ** service, |
3862 | OSDispatchMethod supermethod) |
3863 | { |
3864 | kern_return_t ret; |
3865 | union |
3866 | { |
3867 | IOService_CopySystemStateNotificationService_Msg msg; |
3868 | struct |
3869 | { |
3870 | IOService_CopySystemStateNotificationService_Rpl rpl; |
3871 | mach_msg_max_trailer_t trailer; |
3872 | } rpl; |
3873 | } buf; |
3874 | struct IOService_CopySystemStateNotificationService_Msg * msg = &buf.msg; |
3875 | struct IOService_CopySystemStateNotificationService_Rpl * rpl = &buf.rpl.rpl; |
3876 | |
3877 | memset(s: msg, c: 0, n: sizeof(struct IOService_CopySystemStateNotificationService_Msg)); |
3878 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
3879 | msg->mach.msgh.msgh_size = sizeof(*msg); |
3880 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
3881 | | 0*kIORPCMessageSimpleReply |
3882 | | 0*kIORPCMessageLocalHost |
3883 | | 0*kIORPCMessageOnqueue; |
3884 | msg->content.__hdr.msgid = IOService_CopySystemStateNotificationService_ID; |
3885 | msg->content.__object = (OSObjectRef) this; |
3886 | msg->content.__hdr.objectRefs = IOService_CopySystemStateNotificationService_Msg_ObjRefs; |
3887 | msg->mach.msgh_body.msgh_descriptor_count = 1; |
3888 | |
3889 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
3890 | |
3891 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
3892 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
3893 | else ret = ((OSObject *)this)->Invoke(rpc); |
3894 | |
3895 | if (kIOReturnSuccess == ret) |
3896 | do { |
3897 | { |
3898 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
3899 | if (rpl->content.__hdr.msgid != IOService_CopySystemStateNotificationService_ID) { ret = kIOReturnIPCError; break; }; |
3900 | if (rpl->mach.msgh_body.msgh_descriptor_count != 1) { ret = kIOReturnIPCError; break; }; |
3901 | if (IOService_CopySystemStateNotificationService_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
3902 | } |
3903 | } |
3904 | while (false); |
3905 | if (kIOReturnSuccess == ret) |
3906 | { |
3907 | *service = OSDynamicCast(IOService, (OSObject *) rpl->content.service); |
3908 | if (rpl->content.service && !*service) ret = kIOReturnBadArgument; |
3909 | } |
3910 | |
3911 | |
3912 | return (ret); |
3913 | } |
3914 | |
3915 | kern_return_t |
3916 | IOService::StateNotificationItemCreate( |
3917 | OSString * itemName, |
3918 | OSDictionary * schema, |
3919 | OSDispatchMethod supermethod) |
3920 | { |
3921 | kern_return_t ret; |
3922 | union |
3923 | { |
3924 | IOService_StateNotificationItemCreate_Msg msg; |
3925 | struct |
3926 | { |
3927 | IOService_StateNotificationItemCreate_Rpl rpl; |
3928 | mach_msg_max_trailer_t trailer; |
3929 | } rpl; |
3930 | } buf; |
3931 | struct IOService_StateNotificationItemCreate_Msg * msg = &buf.msg; |
3932 | struct IOService_StateNotificationItemCreate_Rpl * rpl = &buf.rpl.rpl; |
3933 | |
3934 | memset(s: msg, c: 0, n: sizeof(struct IOService_StateNotificationItemCreate_Msg)); |
3935 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
3936 | msg->mach.msgh.msgh_size = sizeof(*msg); |
3937 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
3938 | | 0*kIORPCMessageSimpleReply |
3939 | | 0*kIORPCMessageLocalHost |
3940 | | 0*kIORPCMessageOnqueue; |
3941 | msg->content.__hdr.msgid = IOService_StateNotificationItemCreate_ID; |
3942 | msg->content.__object = (OSObjectRef) this; |
3943 | msg->content.__hdr.objectRefs = IOService_StateNotificationItemCreate_Msg_ObjRefs; |
3944 | msg->mach.msgh_body.msgh_descriptor_count = 3; |
3945 | |
3946 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
3947 | |
3948 | msg->itemName__descriptor.type = MACH_MSG_OOL_DESCRIPTOR; |
3949 | msg->itemName__descriptor.copy = MACH_MSG_VIRTUAL_COPY; |
3950 | msg->itemName__descriptor.address = (void *) __builtin_offsetof(IOService_StateNotificationItemCreate_Msg_Content, itemName); |
3951 | msg->content.itemName = itemName; |
3952 | |
3953 | msg->schema__descriptor.type = MACH_MSG_OOL_DESCRIPTOR; |
3954 | msg->schema__descriptor.copy = MACH_MSG_VIRTUAL_COPY; |
3955 | msg->schema__descriptor.address = (void *) __builtin_offsetof(IOService_StateNotificationItemCreate_Msg_Content, schema); |
3956 | msg->content.schema = schema; |
3957 | |
3958 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
3959 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
3960 | else ret = ((OSObject *)this)->Invoke(rpc); |
3961 | |
3962 | if (kIOReturnSuccess == ret) |
3963 | do { |
3964 | { |
3965 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
3966 | if (rpl->content.__hdr.msgid != IOService_StateNotificationItemCreate_ID) { ret = kIOReturnIPCError; break; }; |
3967 | if (rpl->mach.msgh_body.msgh_descriptor_count != 0) { ret = kIOReturnIPCError; break; }; |
3968 | if (IOService_StateNotificationItemCreate_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
3969 | } |
3970 | } |
3971 | while (false); |
3972 | if (kIOReturnSuccess == ret) |
3973 | { |
3974 | } |
3975 | |
3976 | |
3977 | return (ret); |
3978 | } |
3979 | |
3980 | kern_return_t |
3981 | IOService::StateNotificationItemSet( |
3982 | OSString * itemName, |
3983 | OSDictionary * value, |
3984 | OSDispatchMethod supermethod) |
3985 | { |
3986 | kern_return_t ret; |
3987 | union |
3988 | { |
3989 | IOService_StateNotificationItemSet_Msg msg; |
3990 | struct |
3991 | { |
3992 | IOService_StateNotificationItemSet_Rpl rpl; |
3993 | mach_msg_max_trailer_t trailer; |
3994 | } rpl; |
3995 | } buf; |
3996 | struct IOService_StateNotificationItemSet_Msg * msg = &buf.msg; |
3997 | struct IOService_StateNotificationItemSet_Rpl * rpl = &buf.rpl.rpl; |
3998 | |
3999 | memset(s: msg, c: 0, n: sizeof(struct IOService_StateNotificationItemSet_Msg)); |
4000 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
4001 | msg->mach.msgh.msgh_size = sizeof(*msg); |
4002 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
4003 | | 0*kIORPCMessageSimpleReply |
4004 | | 0*kIORPCMessageLocalHost |
4005 | | 0*kIORPCMessageOnqueue; |
4006 | msg->content.__hdr.msgid = IOService_StateNotificationItemSet_ID; |
4007 | msg->content.__object = (OSObjectRef) this; |
4008 | msg->content.__hdr.objectRefs = IOService_StateNotificationItemSet_Msg_ObjRefs; |
4009 | msg->mach.msgh_body.msgh_descriptor_count = 3; |
4010 | |
4011 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
4012 | |
4013 | msg->itemName__descriptor.type = MACH_MSG_OOL_DESCRIPTOR; |
4014 | msg->itemName__descriptor.copy = MACH_MSG_VIRTUAL_COPY; |
4015 | msg->itemName__descriptor.address = (void *) __builtin_offsetof(IOService_StateNotificationItemSet_Msg_Content, itemName); |
4016 | msg->content.itemName = itemName; |
4017 | |
4018 | msg->value__descriptor.type = MACH_MSG_OOL_DESCRIPTOR; |
4019 | msg->value__descriptor.copy = MACH_MSG_VIRTUAL_COPY; |
4020 | msg->value__descriptor.address = (void *) __builtin_offsetof(IOService_StateNotificationItemSet_Msg_Content, value); |
4021 | msg->content.value = value; |
4022 | |
4023 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
4024 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
4025 | else ret = ((OSObject *)this)->Invoke(rpc); |
4026 | |
4027 | if (kIOReturnSuccess == ret) |
4028 | do { |
4029 | { |
4030 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
4031 | if (rpl->content.__hdr.msgid != IOService_StateNotificationItemSet_ID) { ret = kIOReturnIPCError; break; }; |
4032 | if (rpl->mach.msgh_body.msgh_descriptor_count != 0) { ret = kIOReturnIPCError; break; }; |
4033 | if (IOService_StateNotificationItemSet_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
4034 | } |
4035 | } |
4036 | while (false); |
4037 | if (kIOReturnSuccess == ret) |
4038 | { |
4039 | } |
4040 | |
4041 | |
4042 | return (ret); |
4043 | } |
4044 | |
4045 | kern_return_t |
4046 | IOService::StateNotificationItemCopy( |
4047 | OSString * itemName, |
4048 | OSDictionary ** value, |
4049 | OSDispatchMethod supermethod) |
4050 | { |
4051 | kern_return_t ret; |
4052 | union |
4053 | { |
4054 | IOService_StateNotificationItemCopy_Msg msg; |
4055 | struct |
4056 | { |
4057 | IOService_StateNotificationItemCopy_Rpl rpl; |
4058 | mach_msg_max_trailer_t trailer; |
4059 | } rpl; |
4060 | } buf; |
4061 | struct IOService_StateNotificationItemCopy_Msg * msg = &buf.msg; |
4062 | struct IOService_StateNotificationItemCopy_Rpl * rpl = &buf.rpl.rpl; |
4063 | |
4064 | memset(s: msg, c: 0, n: sizeof(struct IOService_StateNotificationItemCopy_Msg)); |
4065 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
4066 | msg->mach.msgh.msgh_size = sizeof(*msg); |
4067 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
4068 | | 0*kIORPCMessageSimpleReply |
4069 | | 0*kIORPCMessageLocalHost |
4070 | | 0*kIORPCMessageOnqueue; |
4071 | msg->content.__hdr.msgid = IOService_StateNotificationItemCopy_ID; |
4072 | msg->content.__object = (OSObjectRef) this; |
4073 | msg->content.__hdr.objectRefs = IOService_StateNotificationItemCopy_Msg_ObjRefs; |
4074 | msg->mach.msgh_body.msgh_descriptor_count = 2; |
4075 | |
4076 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
4077 | |
4078 | msg->itemName__descriptor.type = MACH_MSG_OOL_DESCRIPTOR; |
4079 | msg->itemName__descriptor.copy = MACH_MSG_VIRTUAL_COPY; |
4080 | msg->itemName__descriptor.address = (void *) __builtin_offsetof(IOService_StateNotificationItemCopy_Msg_Content, itemName); |
4081 | msg->content.itemName = itemName; |
4082 | |
4083 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
4084 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
4085 | else ret = ((OSObject *)this)->Invoke(rpc); |
4086 | |
4087 | if (kIOReturnSuccess == ret) |
4088 | do { |
4089 | { |
4090 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
4091 | if (rpl->content.__hdr.msgid != IOService_StateNotificationItemCopy_ID) { ret = kIOReturnIPCError; break; }; |
4092 | if (rpl->mach.msgh_body.msgh_descriptor_count != 1) { ret = kIOReturnIPCError; break; }; |
4093 | if (IOService_StateNotificationItemCopy_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
4094 | } |
4095 | } |
4096 | while (false); |
4097 | if (kIOReturnSuccess == ret) |
4098 | { |
4099 | *value = OSDynamicCast(OSDictionary, (OSObject *) rpl->content.value); |
4100 | if (rpl->content.value && !*value) ret = kIOReturnBadArgument; |
4101 | } |
4102 | |
4103 | |
4104 | return (ret); |
4105 | } |
4106 | |
4107 | void |
4108 | IOService::Stop_async( |
4109 | IOService * provider, |
4110 | OSDispatchMethod supermethod) |
4111 | { |
4112 | kern_return_t ret; |
4113 | union |
4114 | { |
4115 | IOService_Stop_async_Msg msg; |
4116 | } buf; |
4117 | struct IOService_Stop_async_Msg * msg = &buf.msg; |
4118 | |
4119 | memset(s: msg, c: 0, n: sizeof(struct IOService_Stop_async_Msg)); |
4120 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
4121 | msg->mach.msgh.msgh_size = sizeof(*msg); |
4122 | msg->content.__hdr.flags = 1*kIORPCMessageOneway |
4123 | | 1*kIORPCMessageSimpleReply |
4124 | | 0*kIORPCMessageLocalHost |
4125 | | 0*kIORPCMessageOnqueue; |
4126 | msg->content.__hdr.msgid = IOService_Stop_async_ID; |
4127 | msg->content.__object = (OSObjectRef) this; |
4128 | msg->content.__hdr.objectRefs = IOService_Stop_async_Msg_ObjRefs; |
4129 | msg->mach.msgh_body.msgh_descriptor_count = 2; |
4130 | |
4131 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
4132 | |
4133 | msg->provider__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
4134 | msg->content.provider = (OSObjectRef) provider; |
4135 | |
4136 | IORPC rpc = { .message = &buf.msg.mach, .reply = NULL, .sendSize = sizeof(*msg), .replySize = 0 }; |
4137 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
4138 | else ret = ((OSObject *)this)->Invoke(rpc); |
4139 | |
4140 | } |
4141 | |
4142 | kern_return_t |
4143 | IOService::_NewUserClient( |
4144 | uint32_t type, |
4145 | OSDictionary * entitlements, |
4146 | IOUserClient ** userClient, |
4147 | OSDispatchMethod supermethod) |
4148 | { |
4149 | kern_return_t ret; |
4150 | union |
4151 | { |
4152 | IOService__NewUserClient_Msg msg; |
4153 | struct |
4154 | { |
4155 | IOService__NewUserClient_Rpl rpl; |
4156 | mach_msg_max_trailer_t trailer; |
4157 | } rpl; |
4158 | } buf; |
4159 | struct IOService__NewUserClient_Msg * msg = &buf.msg; |
4160 | struct IOService__NewUserClient_Rpl * rpl = &buf.rpl.rpl; |
4161 | |
4162 | memset(s: msg, c: 0, n: sizeof(struct IOService__NewUserClient_Msg)); |
4163 | msg->mach.msgh.msgh_id = kIORPCVersion190615; |
4164 | msg->mach.msgh.msgh_size = sizeof(*msg); |
4165 | msg->content.__hdr.flags = 0*kIORPCMessageOneway |
4166 | | 0*kIORPCMessageSimpleReply |
4167 | | 0*kIORPCMessageLocalHost |
4168 | | 0*kIORPCMessageOnqueue; |
4169 | msg->content.__hdr.msgid = IOService__NewUserClient_ID; |
4170 | msg->content.__object = (OSObjectRef) this; |
4171 | msg->content.__hdr.objectRefs = IOService__NewUserClient_Msg_ObjRefs; |
4172 | msg->mach.msgh_body.msgh_descriptor_count = 2; |
4173 | |
4174 | msg->__object__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
4175 | |
4176 | msg->content.type = type; |
4177 | |
4178 | msg->entitlements__descriptor.type = MACH_MSG_OOL_DESCRIPTOR; |
4179 | msg->entitlements__descriptor.copy = MACH_MSG_VIRTUAL_COPY; |
4180 | msg->entitlements__descriptor.address = (void *) __builtin_offsetof(IOService__NewUserClient_Msg_Content, entitlements); |
4181 | msg->content.entitlements = entitlements; |
4182 | |
4183 | IORPC rpc = { .message = &buf.msg.mach, .reply = &buf.rpl.rpl.mach, .sendSize = sizeof(buf.msg), .replySize = sizeof(buf.rpl) }; |
4184 | if (supermethod) ret = supermethod((OSObject *)this, rpc); |
4185 | else ret = ((OSObject *)this)->Invoke(rpc); |
4186 | |
4187 | if (kIOReturnSuccess == ret) |
4188 | do { |
4189 | { |
4190 | if (rpl->mach.msgh.msgh_size != sizeof(*rpl)) { ret = kIOReturnIPCError; break; }; |
4191 | if (rpl->content.__hdr.msgid != IOService__NewUserClient_ID) { ret = kIOReturnIPCError; break; }; |
4192 | if (rpl->mach.msgh_body.msgh_descriptor_count != 1) { ret = kIOReturnIPCError; break; }; |
4193 | if (IOService__NewUserClient_Rpl_ObjRefs != rpl->content.__hdr.objectRefs) { ret = kIOReturnIPCError; break; }; |
4194 | } |
4195 | } |
4196 | while (false); |
4197 | if (kIOReturnSuccess == ret) |
4198 | { |
4199 | *userClient = OSDynamicCast(IOUserClient, (OSObject *) rpl->content.userClient); |
4200 | if (rpl->content.userClient && !*userClient) ret = kIOReturnBadArgument; |
4201 | } |
4202 | |
4203 | |
4204 | return (ret); |
4205 | } |
4206 | |
4207 | kern_return_t |
4208 | IOService::Start_Invoke(const IORPC _rpc, |
4209 | OSMetaClassBase * target, |
4210 | Start_Handler func) |
4211 | { |
4212 | IOService_Start_Invocation rpc = { .rpc: _rpc }; |
4213 | kern_return_t ret; |
4214 | IOService * provider; |
4215 | |
4216 | if (2 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
4217 | if (IOService_Start_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
4218 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOService_Start_Msg)) return (kIOReturnIPCError); |
4219 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOService_Start_Rpl)) return (kIOReturnIPCError); |
4220 | provider = OSDynamicCast(IOService, (OSObject *) rpc.message->content.provider); |
4221 | if (!provider && rpc.message->content.provider) return (kIOReturnBadArgument); |
4222 | |
4223 | ret = (*func)(target, |
4224 | provider); |
4225 | |
4226 | if (kIOReturnSuccess != ret) return (ret); |
4227 | |
4228 | rpc.reply->content.__hdr.msgid = IOService_Start_ID; |
4229 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
4230 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
4231 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
4232 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 0; |
4233 | rpc.reply->content.__hdr.objectRefs = IOService_Start_Rpl_ObjRefs; |
4234 | |
4235 | return (ret); |
4236 | } |
4237 | |
4238 | kern_return_t |
4239 | IOService::Stop_Invoke(const IORPC _rpc, |
4240 | OSMetaClassBase * target, |
4241 | Stop_Handler func) |
4242 | { |
4243 | IOService_Stop_Invocation rpc = { .rpc: _rpc }; |
4244 | kern_return_t ret; |
4245 | IOService * provider; |
4246 | |
4247 | if (2 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
4248 | if (IOService_Stop_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
4249 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOService_Stop_Msg)) return (kIOReturnIPCError); |
4250 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOService_Stop_Rpl)) return (kIOReturnIPCError); |
4251 | provider = OSDynamicCast(IOService, (OSObject *) rpc.message->content.provider); |
4252 | if (!provider && rpc.message->content.provider) return (kIOReturnBadArgument); |
4253 | |
4254 | ret = (*func)(target, |
4255 | provider); |
4256 | |
4257 | if (kIOReturnSuccess != ret) return (ret); |
4258 | |
4259 | rpc.reply->content.__hdr.msgid = IOService_Stop_ID; |
4260 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
4261 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
4262 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
4263 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 0; |
4264 | rpc.reply->content.__hdr.objectRefs = IOService_Stop_Rpl_ObjRefs; |
4265 | |
4266 | return (ret); |
4267 | } |
4268 | |
4269 | kern_return_t |
4270 | IOService::ClientCrashed_Invoke(const IORPC _rpc, |
4271 | OSMetaClassBase * target, |
4272 | ClientCrashed_Handler func) |
4273 | { |
4274 | IOService_ClientCrashed_Invocation rpc = { .rpc: _rpc }; |
4275 | kern_return_t ret; |
4276 | IOService * client; |
4277 | |
4278 | if (2 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
4279 | if (IOService_ClientCrashed_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
4280 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOService_ClientCrashed_Msg)) return (kIOReturnIPCError); |
4281 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOService_ClientCrashed_Rpl)) return (kIOReturnIPCError); |
4282 | client = OSDynamicCast(IOService, (OSObject *) rpc.message->content.client); |
4283 | if (!client && rpc.message->content.client) return (kIOReturnBadArgument); |
4284 | |
4285 | ret = (*func)(target, |
4286 | client, |
4287 | rpc.message->content.options); |
4288 | |
4289 | if (kIOReturnSuccess != ret) return (ret); |
4290 | |
4291 | rpc.reply->content.__hdr.msgid = IOService_ClientCrashed_ID; |
4292 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
4293 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
4294 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
4295 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 0; |
4296 | rpc.reply->content.__hdr.objectRefs = IOService_ClientCrashed_Rpl_ObjRefs; |
4297 | |
4298 | return (ret); |
4299 | } |
4300 | |
4301 | kern_return_t |
4302 | IOService::GetRegistryEntryID_Invoke(const IORPC _rpc, |
4303 | OSMetaClassBase * target, |
4304 | GetRegistryEntryID_Handler func) |
4305 | { |
4306 | IOService_GetRegistryEntryID_Invocation rpc = { .rpc: _rpc }; |
4307 | kern_return_t ret; |
4308 | |
4309 | if (1 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
4310 | if (IOService_GetRegistryEntryID_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
4311 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOService_GetRegistryEntryID_Msg)) return (kIOReturnIPCError); |
4312 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOService_GetRegistryEntryID_Rpl)) return (kIOReturnIPCError); |
4313 | |
4314 | ret = (*func)(target, |
4315 | &rpc.reply->content.registryEntryID); |
4316 | |
4317 | if (kIOReturnSuccess != ret) return (ret); |
4318 | |
4319 | rpc.reply->content.__hdr.msgid = IOService_GetRegistryEntryID_ID; |
4320 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
4321 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
4322 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
4323 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 0; |
4324 | rpc.reply->content.__hdr.objectRefs = IOService_GetRegistryEntryID_Rpl_ObjRefs; |
4325 | |
4326 | return (ret); |
4327 | } |
4328 | |
4329 | kern_return_t |
4330 | IOService::SetName_Invoke(const IORPC _rpc, |
4331 | OSMetaClassBase * target, |
4332 | SetName_Handler func) |
4333 | { |
4334 | IOService_SetName_Invocation rpc = { .rpc: _rpc }; |
4335 | kern_return_t ret; |
4336 | |
4337 | if (1 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
4338 | if (IOService_SetName_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
4339 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOService_SetName_Msg)) return (kIOReturnIPCError); |
4340 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOService_SetName_Rpl)) return (kIOReturnIPCError); |
4341 | if (strnlen(s: &rpc.message->content.__name[0], n: sizeof(rpc.message->content.__name)) >= sizeof(rpc.message->content.__name)) return kIOReturnBadArgument; |
4342 | |
4343 | ret = (*func)(target, |
4344 | &rpc.message->content.__name[0]); |
4345 | |
4346 | if (kIOReturnSuccess != ret) return (ret); |
4347 | |
4348 | rpc.reply->content.__hdr.msgid = IOService_SetName_ID; |
4349 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
4350 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
4351 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
4352 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 0; |
4353 | rpc.reply->content.__hdr.objectRefs = IOService_SetName_Rpl_ObjRefs; |
4354 | |
4355 | return (ret); |
4356 | } |
4357 | |
4358 | kern_return_t |
4359 | IOService::RegisterService_Invoke(const IORPC _rpc, |
4360 | OSMetaClassBase * target, |
4361 | RegisterService_Handler func) |
4362 | { |
4363 | IOService_RegisterService_Invocation rpc = { .rpc: _rpc }; |
4364 | kern_return_t ret; |
4365 | |
4366 | if (1 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
4367 | if (IOService_RegisterService_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
4368 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOService_RegisterService_Msg)) return (kIOReturnIPCError); |
4369 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOService_RegisterService_Rpl)) return (kIOReturnIPCError); |
4370 | |
4371 | ret = (*func)(target); |
4372 | |
4373 | if (kIOReturnSuccess != ret) return (ret); |
4374 | |
4375 | rpc.reply->content.__hdr.msgid = IOService_RegisterService_ID; |
4376 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
4377 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
4378 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
4379 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 0; |
4380 | rpc.reply->content.__hdr.objectRefs = IOService_RegisterService_Rpl_ObjRefs; |
4381 | |
4382 | return (ret); |
4383 | } |
4384 | |
4385 | kern_return_t |
4386 | IOService::CreateDefaultDispatchQueue_Invoke(const IORPC _rpc, |
4387 | OSMetaClassBase * target, |
4388 | CreateDefaultDispatchQueue_Handler func) |
4389 | { |
4390 | IOService_CreateDefaultDispatchQueue_Invocation rpc = { .rpc: _rpc }; |
4391 | kern_return_t ret; |
4392 | |
4393 | if (1 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
4394 | if (IOService_CreateDefaultDispatchQueue_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
4395 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOService_CreateDefaultDispatchQueue_Msg)) return (kIOReturnIPCError); |
4396 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOService_CreateDefaultDispatchQueue_Rpl)) return (kIOReturnIPCError); |
4397 | |
4398 | ret = (*func)(target, |
4399 | (IODispatchQueue **)&rpc.reply->content.queue); |
4400 | |
4401 | if (kIOReturnSuccess != ret) return (ret); |
4402 | |
4403 | rpc.reply->content.__hdr.msgid = IOService_CreateDefaultDispatchQueue_ID; |
4404 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
4405 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
4406 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
4407 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 1; |
4408 | rpc.reply->content.__hdr.objectRefs = IOService_CreateDefaultDispatchQueue_Rpl_ObjRefs; |
4409 | rpc.reply->queue__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
4410 | |
4411 | return (ret); |
4412 | } |
4413 | |
4414 | kern_return_t |
4415 | IOService::CopyProperties_Invoke(const IORPC _rpc, |
4416 | OSMetaClassBase * target, |
4417 | CopyProperties_Handler func) |
4418 | { |
4419 | IOService_CopyProperties_Invocation rpc = { .rpc: _rpc }; |
4420 | kern_return_t ret; |
4421 | |
4422 | if (1 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
4423 | if (IOService_CopyProperties_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
4424 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOService_CopyProperties_Msg)) return (kIOReturnIPCError); |
4425 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOService_CopyProperties_Rpl)) return (kIOReturnIPCError); |
4426 | |
4427 | ret = (*func)(target, |
4428 | &rpc.reply->content.properties); |
4429 | |
4430 | if (kIOReturnSuccess != ret) return (ret); |
4431 | |
4432 | rpc.reply->content.__hdr.msgid = IOService_CopyProperties_ID; |
4433 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
4434 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
4435 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
4436 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 1; |
4437 | rpc.reply->content.__hdr.objectRefs = IOService_CopyProperties_Rpl_ObjRefs; |
4438 | rpc.reply->properties__descriptor.type = MACH_MSG_OOL_DESCRIPTOR; |
4439 | rpc.reply->properties__descriptor.copy = MACH_MSG_VIRTUAL_COPY; |
4440 | rpc.reply->properties__descriptor.address = (void *) __builtin_offsetof(IOService_CopyProperties_Rpl_Content, properties); |
4441 | rpc.reply->properties__descriptor.size = 0; |
4442 | |
4443 | return (ret); |
4444 | } |
4445 | |
4446 | kern_return_t |
4447 | IOService::SearchProperty_Invoke(const IORPC _rpc, |
4448 | OSMetaClassBase * target, |
4449 | SearchProperty_Handler func) |
4450 | { |
4451 | IOService_SearchProperty_Invocation rpc = { .rpc: _rpc }; |
4452 | kern_return_t ret; |
4453 | |
4454 | if (1 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
4455 | if (IOService_SearchProperty_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
4456 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOService_SearchProperty_Msg)) return (kIOReturnIPCError); |
4457 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOService_SearchProperty_Rpl)) return (kIOReturnIPCError); |
4458 | if (strnlen(s: &rpc.message->content.__name[0], n: sizeof(rpc.message->content.__name)) >= sizeof(rpc.message->content.__name)) return kIOReturnBadArgument; |
4459 | if (strnlen(s: &rpc.message->content.__plane[0], n: sizeof(rpc.message->content.__plane)) >= sizeof(rpc.message->content.__plane)) return kIOReturnBadArgument; |
4460 | |
4461 | ret = (*func)(target, |
4462 | &rpc.message->content.__name[0], |
4463 | &rpc.message->content.__plane[0], |
4464 | rpc.message->content.options, |
4465 | &rpc.reply->content.property); |
4466 | |
4467 | if (kIOReturnSuccess != ret) return (ret); |
4468 | |
4469 | rpc.reply->content.__hdr.msgid = IOService_SearchProperty_ID; |
4470 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
4471 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
4472 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
4473 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 1; |
4474 | rpc.reply->content.__hdr.objectRefs = IOService_SearchProperty_Rpl_ObjRefs; |
4475 | rpc.reply->property__descriptor.type = MACH_MSG_OOL_DESCRIPTOR; |
4476 | rpc.reply->property__descriptor.copy = MACH_MSG_VIRTUAL_COPY; |
4477 | rpc.reply->property__descriptor.address = (void *) __builtin_offsetof(IOService_SearchProperty_Rpl_Content, property); |
4478 | rpc.reply->property__descriptor.size = 0; |
4479 | |
4480 | return (ret); |
4481 | } |
4482 | |
4483 | kern_return_t |
4484 | IOService::SetProperties_Invoke(const IORPC _rpc, |
4485 | OSMetaClassBase * target, |
4486 | SetProperties_Handler func) |
4487 | { |
4488 | IOService_SetProperties_Invocation rpc = { .rpc: _rpc }; |
4489 | kern_return_t ret; |
4490 | |
4491 | if (2 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
4492 | if (IOService_SetProperties_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
4493 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOService_SetProperties_Msg)) return (kIOReturnIPCError); |
4494 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOService_SetProperties_Rpl)) return (kIOReturnIPCError); |
4495 | if (((OSObject *) rpc.message->content.properties) != NULL && OSDynamicCast(OSDictionary, (OSObject *) rpc.message->content.properties) == NULL) { return kIOReturnBadArgument; } |
4496 | |
4497 | ret = (*func)(target, |
4498 | rpc.message->content.properties); |
4499 | |
4500 | if (kIOReturnSuccess != ret) return (ret); |
4501 | |
4502 | rpc.reply->content.__hdr.msgid = IOService_SetProperties_ID; |
4503 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
4504 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
4505 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
4506 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 0; |
4507 | rpc.reply->content.__hdr.objectRefs = IOService_SetProperties_Rpl_ObjRefs; |
4508 | |
4509 | return (ret); |
4510 | } |
4511 | |
4512 | kern_return_t |
4513 | IOService::JoinPMTree_Invoke(const IORPC _rpc, |
4514 | OSMetaClassBase * target, |
4515 | JoinPMTree_Handler func) |
4516 | { |
4517 | IOService_JoinPMTree_Invocation rpc = { .rpc: _rpc }; |
4518 | kern_return_t ret; |
4519 | |
4520 | if (1 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
4521 | if (IOService_JoinPMTree_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
4522 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOService_JoinPMTree_Msg)) return (kIOReturnIPCError); |
4523 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOService_JoinPMTree_Rpl)) return (kIOReturnIPCError); |
4524 | |
4525 | ret = (*func)(target); |
4526 | |
4527 | if (kIOReturnSuccess != ret) return (ret); |
4528 | |
4529 | rpc.reply->content.__hdr.msgid = IOService_JoinPMTree_ID; |
4530 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
4531 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
4532 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
4533 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 0; |
4534 | rpc.reply->content.__hdr.objectRefs = IOService_JoinPMTree_Rpl_ObjRefs; |
4535 | |
4536 | return (ret); |
4537 | } |
4538 | |
4539 | kern_return_t |
4540 | IOService::SetPowerState_Invoke(const IORPC _rpc, |
4541 | OSMetaClassBase * target, |
4542 | SetPowerState_Handler func) |
4543 | { |
4544 | IOService_SetPowerState_Invocation rpc = { .rpc: _rpc }; |
4545 | kern_return_t ret; |
4546 | |
4547 | if (1 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
4548 | if (IOService_SetPowerState_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
4549 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOService_SetPowerState_Msg)) return (kIOReturnIPCError); |
4550 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOService_SetPowerState_Rpl)) return (kIOReturnIPCError); |
4551 | |
4552 | ret = (*func)(target, |
4553 | rpc.message->content.powerFlags); |
4554 | |
4555 | if (kIOReturnSuccess != ret) return (ret); |
4556 | |
4557 | rpc.reply->content.__hdr.msgid = IOService_SetPowerState_ID; |
4558 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
4559 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
4560 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
4561 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 0; |
4562 | rpc.reply->content.__hdr.objectRefs = IOService_SetPowerState_Rpl_ObjRefs; |
4563 | |
4564 | return (ret); |
4565 | } |
4566 | |
4567 | kern_return_t |
4568 | IOService::ChangePowerState_Invoke(const IORPC _rpc, |
4569 | OSMetaClassBase * target, |
4570 | ChangePowerState_Handler func) |
4571 | { |
4572 | IOService_ChangePowerState_Invocation rpc = { .rpc: _rpc }; |
4573 | kern_return_t ret; |
4574 | |
4575 | if (1 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
4576 | if (IOService_ChangePowerState_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
4577 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOService_ChangePowerState_Msg)) return (kIOReturnIPCError); |
4578 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOService_ChangePowerState_Rpl)) return (kIOReturnIPCError); |
4579 | |
4580 | ret = (*func)(target, |
4581 | rpc.message->content.powerFlags); |
4582 | |
4583 | if (kIOReturnSuccess != ret) return (ret); |
4584 | |
4585 | rpc.reply->content.__hdr.msgid = IOService_ChangePowerState_ID; |
4586 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
4587 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
4588 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
4589 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 0; |
4590 | rpc.reply->content.__hdr.objectRefs = IOService_ChangePowerState_Rpl_ObjRefs; |
4591 | |
4592 | return (ret); |
4593 | } |
4594 | |
4595 | kern_return_t |
4596 | IOService::NewUserClient_Invoke(const IORPC _rpc, |
4597 | OSMetaClassBase * target, |
4598 | NewUserClient_Handler func) |
4599 | { |
4600 | IOService_NewUserClient_Invocation rpc = { .rpc: _rpc }; |
4601 | kern_return_t ret; |
4602 | |
4603 | if (1 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
4604 | if (IOService_NewUserClient_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
4605 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOService_NewUserClient_Msg)) return (kIOReturnIPCError); |
4606 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOService_NewUserClient_Rpl)) return (kIOReturnIPCError); |
4607 | |
4608 | ret = (*func)(target, |
4609 | rpc.message->content.type, |
4610 | (IOUserClient **)&rpc.reply->content.userClient); |
4611 | |
4612 | if (kIOReturnSuccess != ret) return (ret); |
4613 | |
4614 | rpc.reply->content.__hdr.msgid = IOService_NewUserClient_ID; |
4615 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
4616 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
4617 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
4618 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 1; |
4619 | rpc.reply->content.__hdr.objectRefs = IOService_NewUserClient_Rpl_ObjRefs; |
4620 | rpc.reply->userClient__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
4621 | |
4622 | return (ret); |
4623 | } |
4624 | |
4625 | kern_return_t |
4626 | IOService::Create_Invoke(const IORPC _rpc, |
4627 | OSMetaClassBase * target, |
4628 | Create_Handler func) |
4629 | { |
4630 | IOService_Create_Invocation rpc = { .rpc: _rpc }; |
4631 | kern_return_t ret; |
4632 | IOService * provider; |
4633 | |
4634 | if (2 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
4635 | if (IOService_Create_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
4636 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOService_Create_Msg)) return (kIOReturnIPCError); |
4637 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOService_Create_Rpl)) return (kIOReturnIPCError); |
4638 | provider = OSDynamicCast(IOService, (OSObject *) rpc.message->content.provider); |
4639 | if (!provider && rpc.message->content.provider) return (kIOReturnBadArgument); |
4640 | if (strnlen(s: &rpc.message->content.__propertiesKey[0], n: sizeof(rpc.message->content.__propertiesKey)) >= sizeof(rpc.message->content.__propertiesKey)) return kIOReturnBadArgument; |
4641 | |
4642 | ret = (*func)(target, |
4643 | provider, |
4644 | &rpc.message->content.__propertiesKey[0], |
4645 | (IOService **)&rpc.reply->content.result); |
4646 | |
4647 | if (kIOReturnSuccess != ret) return (ret); |
4648 | |
4649 | rpc.reply->content.__hdr.msgid = IOService_Create_ID; |
4650 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
4651 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
4652 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
4653 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 1; |
4654 | rpc.reply->content.__hdr.objectRefs = IOService_Create_Rpl_ObjRefs; |
4655 | rpc.reply->result__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
4656 | |
4657 | return (ret); |
4658 | } |
4659 | |
4660 | kern_return_t |
4661 | IOService::Terminate_Invoke(const IORPC _rpc, |
4662 | OSMetaClassBase * target, |
4663 | Terminate_Handler func) |
4664 | { |
4665 | IOService_Terminate_Invocation rpc = { .rpc: _rpc }; |
4666 | kern_return_t ret; |
4667 | |
4668 | if (1 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
4669 | if (IOService_Terminate_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
4670 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOService_Terminate_Msg)) return (kIOReturnIPCError); |
4671 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOService_Terminate_Rpl)) return (kIOReturnIPCError); |
4672 | |
4673 | ret = (*func)(target, |
4674 | rpc.message->content.options); |
4675 | |
4676 | if (kIOReturnSuccess != ret) return (ret); |
4677 | |
4678 | rpc.reply->content.__hdr.msgid = IOService_Terminate_ID; |
4679 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
4680 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
4681 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
4682 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 0; |
4683 | rpc.reply->content.__hdr.objectRefs = IOService_Terminate_Rpl_ObjRefs; |
4684 | |
4685 | return (ret); |
4686 | } |
4687 | |
4688 | kern_return_t |
4689 | IOService::CopyProviderProperties_Invoke(const IORPC _rpc, |
4690 | OSMetaClassBase * target, |
4691 | CopyProviderProperties_Handler func) |
4692 | { |
4693 | IOService_CopyProviderProperties_Invocation rpc = { .rpc: _rpc }; |
4694 | kern_return_t ret; |
4695 | |
4696 | if (2 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
4697 | if (IOService_CopyProviderProperties_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
4698 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOService_CopyProviderProperties_Msg)) return (kIOReturnIPCError); |
4699 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOService_CopyProviderProperties_Rpl)) return (kIOReturnIPCError); |
4700 | if (((OSObject *) rpc.message->content.propertyKeys) != NULL && OSDynamicCast(OSArray, (OSObject *) rpc.message->content.propertyKeys) == NULL) { return kIOReturnBadArgument; } |
4701 | |
4702 | ret = (*func)(target, |
4703 | rpc.message->content.propertyKeys, |
4704 | &rpc.reply->content.properties); |
4705 | |
4706 | if (kIOReturnSuccess != ret) return (ret); |
4707 | |
4708 | rpc.reply->content.__hdr.msgid = IOService_CopyProviderProperties_ID; |
4709 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
4710 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
4711 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
4712 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 1; |
4713 | rpc.reply->content.__hdr.objectRefs = IOService_CopyProviderProperties_Rpl_ObjRefs; |
4714 | rpc.reply->properties__descriptor.type = MACH_MSG_OOL_DESCRIPTOR; |
4715 | rpc.reply->properties__descriptor.copy = MACH_MSG_VIRTUAL_COPY; |
4716 | rpc.reply->properties__descriptor.address = (void *) __builtin_offsetof(IOService_CopyProviderProperties_Rpl_Content, properties); |
4717 | rpc.reply->properties__descriptor.size = 0; |
4718 | |
4719 | return (ret); |
4720 | } |
4721 | |
4722 | kern_return_t |
4723 | IOService::RequireMaxBusStall_Invoke(const IORPC _rpc, |
4724 | OSMetaClassBase * target, |
4725 | RequireMaxBusStall_Handler func) |
4726 | { |
4727 | IOService_RequireMaxBusStall_Invocation rpc = { .rpc: _rpc }; |
4728 | kern_return_t ret; |
4729 | |
4730 | if (1 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
4731 | if (IOService_RequireMaxBusStall_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
4732 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOService_RequireMaxBusStall_Msg)) return (kIOReturnIPCError); |
4733 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOService_RequireMaxBusStall_Rpl)) return (kIOReturnIPCError); |
4734 | |
4735 | ret = (*func)(target, |
4736 | rpc.message->content.maxBusStall); |
4737 | |
4738 | if (kIOReturnSuccess != ret) return (ret); |
4739 | |
4740 | rpc.reply->content.__hdr.msgid = IOService_RequireMaxBusStall_ID; |
4741 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
4742 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
4743 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
4744 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 0; |
4745 | rpc.reply->content.__hdr.objectRefs = IOService_RequireMaxBusStall_Rpl_ObjRefs; |
4746 | |
4747 | return (ret); |
4748 | } |
4749 | |
4750 | kern_return_t |
4751 | IOService::AdjustBusy_Invoke(const IORPC _rpc, |
4752 | OSMetaClassBase * target, |
4753 | AdjustBusy_Handler func) |
4754 | { |
4755 | IOService_AdjustBusy_Invocation rpc = { .rpc: _rpc }; |
4756 | kern_return_t ret; |
4757 | |
4758 | if (1 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
4759 | if (IOService_AdjustBusy_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
4760 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOService_AdjustBusy_Msg)) return (kIOReturnIPCError); |
4761 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOService_AdjustBusy_Rpl)) return (kIOReturnIPCError); |
4762 | |
4763 | ret = (*func)(target, |
4764 | rpc.message->content.delta); |
4765 | |
4766 | if (kIOReturnSuccess != ret) return (ret); |
4767 | |
4768 | rpc.reply->content.__hdr.msgid = IOService_AdjustBusy_ID; |
4769 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
4770 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
4771 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
4772 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 0; |
4773 | rpc.reply->content.__hdr.objectRefs = IOService_AdjustBusy_Rpl_ObjRefs; |
4774 | |
4775 | return (ret); |
4776 | } |
4777 | |
4778 | kern_return_t |
4779 | IOService::GetBusyState_Invoke(const IORPC _rpc, |
4780 | OSMetaClassBase * target, |
4781 | GetBusyState_Handler func) |
4782 | { |
4783 | IOService_GetBusyState_Invocation rpc = { .rpc: _rpc }; |
4784 | kern_return_t ret; |
4785 | |
4786 | if (1 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
4787 | if (IOService_GetBusyState_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
4788 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOService_GetBusyState_Msg)) return (kIOReturnIPCError); |
4789 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOService_GetBusyState_Rpl)) return (kIOReturnIPCError); |
4790 | |
4791 | ret = (*func)(target, |
4792 | &rpc.reply->content.busyState); |
4793 | |
4794 | if (kIOReturnSuccess != ret) return (ret); |
4795 | |
4796 | rpc.reply->content.__hdr.msgid = IOService_GetBusyState_ID; |
4797 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
4798 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
4799 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
4800 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 0; |
4801 | rpc.reply->content.__hdr.objectRefs = IOService_GetBusyState_Rpl_ObjRefs; |
4802 | |
4803 | return (ret); |
4804 | } |
4805 | |
4806 | kern_return_t |
4807 | IOService::CoreAnalyticsSendEvent_Invoke(const IORPC _rpc, |
4808 | OSMetaClassBase * target, |
4809 | CoreAnalyticsSendEvent_Handler func) |
4810 | { |
4811 | IOService_CoreAnalyticsSendEvent_Invocation rpc = { .rpc: _rpc }; |
4812 | kern_return_t ret; |
4813 | |
4814 | if (3 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
4815 | if (IOService_CoreAnalyticsSendEvent_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
4816 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOService_CoreAnalyticsSendEvent_Msg)) return (kIOReturnIPCError); |
4817 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOService_CoreAnalyticsSendEvent_Rpl)) return (kIOReturnIPCError); |
4818 | if (((OSObject *) rpc.message->content.eventName) != NULL && OSDynamicCast(OSString, (OSObject *) rpc.message->content.eventName) == NULL) { return kIOReturnBadArgument; } |
4819 | if (((OSObject *) rpc.message->content.eventPayload) != NULL && OSDynamicCast(OSDictionary, (OSObject *) rpc.message->content.eventPayload) == NULL) { return kIOReturnBadArgument; } |
4820 | |
4821 | ret = (*func)(target, |
4822 | rpc.message->content.options, |
4823 | rpc.message->content.eventName, |
4824 | rpc.message->content.eventPayload); |
4825 | |
4826 | if (kIOReturnSuccess != ret) return (ret); |
4827 | |
4828 | rpc.reply->content.__hdr.msgid = IOService_CoreAnalyticsSendEvent_ID; |
4829 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
4830 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
4831 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
4832 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 0; |
4833 | rpc.reply->content.__hdr.objectRefs = IOService_CoreAnalyticsSendEvent_Rpl_ObjRefs; |
4834 | |
4835 | return (ret); |
4836 | } |
4837 | |
4838 | kern_return_t |
4839 | IOService::UpdateReport_Invoke(const IORPC _rpc, |
4840 | OSMetaClassBase * target, |
4841 | UpdateReport_Handler func) |
4842 | { |
4843 | IOService_UpdateReport_Invocation rpc = { .rpc: _rpc }; |
4844 | kern_return_t ret; |
4845 | IOMemoryDescriptor * buffer; |
4846 | |
4847 | if (3 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
4848 | if (IOService_UpdateReport_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
4849 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOService_UpdateReport_Msg)) return (kIOReturnIPCError); |
4850 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOService_UpdateReport_Rpl)) return (kIOReturnIPCError); |
4851 | if (((OSObject *) rpc.message->content.channels) != NULL && OSDynamicCast(OSData, (OSObject *) rpc.message->content.channels) == NULL) { return kIOReturnBadArgument; } |
4852 | buffer = OSDynamicCast(IOMemoryDescriptor, (OSObject *) rpc.message->content.buffer); |
4853 | if (!buffer && rpc.message->content.buffer) return (kIOReturnBadArgument); |
4854 | |
4855 | ret = (*func)(target, |
4856 | rpc.message->content.channels, |
4857 | rpc.message->content.action, |
4858 | &rpc.reply->content.outElementCount, |
4859 | rpc.message->content.offset, |
4860 | rpc.message->content.capacity, |
4861 | buffer); |
4862 | |
4863 | if (kIOReturnSuccess != ret) return (ret); |
4864 | |
4865 | rpc.reply->content.__hdr.msgid = IOService_UpdateReport_ID; |
4866 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
4867 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
4868 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
4869 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 0; |
4870 | rpc.reply->content.__hdr.objectRefs = IOService_UpdateReport_Rpl_ObjRefs; |
4871 | |
4872 | return (ret); |
4873 | } |
4874 | |
4875 | kern_return_t |
4876 | IOService::ConfigureReport_Invoke(const IORPC _rpc, |
4877 | OSMetaClassBase * target, |
4878 | ConfigureReport_Handler func) |
4879 | { |
4880 | IOService_ConfigureReport_Invocation rpc = { .rpc: _rpc }; |
4881 | kern_return_t ret; |
4882 | |
4883 | if (2 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
4884 | if (IOService_ConfigureReport_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
4885 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOService_ConfigureReport_Msg)) return (kIOReturnIPCError); |
4886 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOService_ConfigureReport_Rpl)) return (kIOReturnIPCError); |
4887 | if (((OSObject *) rpc.message->content.channels) != NULL && OSDynamicCast(OSData, (OSObject *) rpc.message->content.channels) == NULL) { return kIOReturnBadArgument; } |
4888 | |
4889 | ret = (*func)(target, |
4890 | rpc.message->content.channels, |
4891 | rpc.message->content.action, |
4892 | &rpc.reply->content.outCount); |
4893 | |
4894 | if (kIOReturnSuccess != ret) return (ret); |
4895 | |
4896 | rpc.reply->content.__hdr.msgid = IOService_ConfigureReport_ID; |
4897 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
4898 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
4899 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
4900 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 0; |
4901 | rpc.reply->content.__hdr.objectRefs = IOService_ConfigureReport_Rpl_ObjRefs; |
4902 | |
4903 | return (ret); |
4904 | } |
4905 | |
4906 | kern_return_t |
4907 | IOService::SetLegend_Invoke(const IORPC _rpc, |
4908 | OSMetaClassBase * target, |
4909 | SetLegend_Handler func) |
4910 | { |
4911 | IOService_SetLegend_Invocation rpc = { .rpc: _rpc }; |
4912 | kern_return_t ret; |
4913 | |
4914 | if (2 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
4915 | if (IOService_SetLegend_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
4916 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOService_SetLegend_Msg)) return (kIOReturnIPCError); |
4917 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOService_SetLegend_Rpl)) return (kIOReturnIPCError); |
4918 | if (((OSObject *) rpc.message->content.legend) != NULL && OSDynamicCast(OSArray, (OSObject *) rpc.message->content.legend) == NULL) { return kIOReturnBadArgument; } |
4919 | |
4920 | ret = (*func)(target, |
4921 | rpc.message->content.legend, |
4922 | rpc.message->content.is_public); |
4923 | |
4924 | if (kIOReturnSuccess != ret) return (ret); |
4925 | |
4926 | rpc.reply->content.__hdr.msgid = IOService_SetLegend_ID; |
4927 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
4928 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
4929 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
4930 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 0; |
4931 | rpc.reply->content.__hdr.objectRefs = IOService_SetLegend_Rpl_ObjRefs; |
4932 | |
4933 | return (ret); |
4934 | } |
4935 | |
4936 | kern_return_t |
4937 | IOService::CopyName_Invoke(const IORPC _rpc, |
4938 | OSMetaClassBase * target, |
4939 | CopyName_Handler func) |
4940 | { |
4941 | IOService_CopyName_Invocation rpc = { .rpc: _rpc }; |
4942 | kern_return_t ret; |
4943 | |
4944 | if (1 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
4945 | if (IOService_CopyName_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
4946 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOService_CopyName_Msg)) return (kIOReturnIPCError); |
4947 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOService_CopyName_Rpl)) return (kIOReturnIPCError); |
4948 | |
4949 | ret = (*func)(target, |
4950 | &rpc.reply->content.name); |
4951 | |
4952 | if (kIOReturnSuccess != ret) return (ret); |
4953 | |
4954 | rpc.reply->content.__hdr.msgid = IOService_CopyName_ID; |
4955 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
4956 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
4957 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
4958 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 1; |
4959 | rpc.reply->content.__hdr.objectRefs = IOService_CopyName_Rpl_ObjRefs; |
4960 | rpc.reply->name__descriptor.type = MACH_MSG_OOL_DESCRIPTOR; |
4961 | rpc.reply->name__descriptor.copy = MACH_MSG_VIRTUAL_COPY; |
4962 | rpc.reply->name__descriptor.address = (void *) __builtin_offsetof(IOService_CopyName_Rpl_Content, name); |
4963 | rpc.reply->name__descriptor.size = 0; |
4964 | |
4965 | return (ret); |
4966 | } |
4967 | |
4968 | kern_return_t |
4969 | IOService::StringFromReturn_Invoke(const IORPC _rpc, |
4970 | OSMetaClassBase * target, |
4971 | StringFromReturn_Handler func) |
4972 | { |
4973 | IOService_StringFromReturn_Invocation rpc = { .rpc: _rpc }; |
4974 | kern_return_t ret; |
4975 | |
4976 | if (1 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
4977 | if (IOService_StringFromReturn_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
4978 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOService_StringFromReturn_Msg)) return (kIOReturnIPCError); |
4979 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOService_StringFromReturn_Rpl)) return (kIOReturnIPCError); |
4980 | |
4981 | ret = (*func)(target, |
4982 | rpc.message->content.retval, |
4983 | &rpc.reply->content.str); |
4984 | |
4985 | if (kIOReturnSuccess != ret) return (ret); |
4986 | |
4987 | rpc.reply->content.__hdr.msgid = IOService_StringFromReturn_ID; |
4988 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
4989 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
4990 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
4991 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 1; |
4992 | rpc.reply->content.__hdr.objectRefs = IOService_StringFromReturn_Rpl_ObjRefs; |
4993 | rpc.reply->str__descriptor.type = MACH_MSG_OOL_DESCRIPTOR; |
4994 | rpc.reply->str__descriptor.copy = MACH_MSG_VIRTUAL_COPY; |
4995 | rpc.reply->str__descriptor.address = (void *) __builtin_offsetof(IOService_StringFromReturn_Rpl_Content, str); |
4996 | rpc.reply->str__descriptor.size = 0; |
4997 | |
4998 | return (ret); |
4999 | } |
5000 | |
5001 | kern_return_t |
5002 | IOService::_ClaimSystemWakeEvent_Invoke(const IORPC _rpc, |
5003 | OSMetaClassBase * target, |
5004 | _ClaimSystemWakeEvent_Handler func) |
5005 | { |
5006 | IOService__ClaimSystemWakeEvent_Invocation rpc = { .rpc: _rpc }; |
5007 | kern_return_t ret; |
5008 | IOService * device; |
5009 | |
5010 | if (3 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
5011 | if (IOService__ClaimSystemWakeEvent_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
5012 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOService__ClaimSystemWakeEvent_Msg)) return (kIOReturnIPCError); |
5013 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOService__ClaimSystemWakeEvent_Rpl)) return (kIOReturnIPCError); |
5014 | if (((OSObject *) rpc.message->content.details) != NULL && OSDynamicCast(OSContainer, (OSObject *) rpc.message->content.details) == NULL) { return kIOReturnBadArgument; } |
5015 | device = OSDynamicCast(IOService, (OSObject *) rpc.message->content.device); |
5016 | if (!device && rpc.message->content.device) return (kIOReturnBadArgument); |
5017 | if (strnlen(s: &rpc.message->content.__reason[0], n: sizeof(rpc.message->content.__reason)) >= sizeof(rpc.message->content.__reason)) return kIOReturnBadArgument; |
5018 | |
5019 | ret = (*func)(target, |
5020 | device, |
5021 | rpc.message->content.flags, |
5022 | &rpc.message->content.__reason[0], |
5023 | rpc.message->content.details); |
5024 | |
5025 | if (kIOReturnSuccess != ret) return (ret); |
5026 | |
5027 | rpc.reply->content.__hdr.msgid = IOService__ClaimSystemWakeEvent_ID; |
5028 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
5029 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
5030 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
5031 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 0; |
5032 | rpc.reply->content.__hdr.objectRefs = IOService__ClaimSystemWakeEvent_Rpl_ObjRefs; |
5033 | |
5034 | return (ret); |
5035 | } |
5036 | |
5037 | kern_return_t |
5038 | IOService::UserSetProperties_Invoke(const IORPC _rpc, |
5039 | OSMetaClassBase * target, |
5040 | UserSetProperties_Handler func) |
5041 | { |
5042 | IOService_UserSetProperties_Invocation rpc = { .rpc: _rpc }; |
5043 | kern_return_t ret; |
5044 | |
5045 | if (2 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
5046 | if (IOService_UserSetProperties_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
5047 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOService_UserSetProperties_Msg)) return (kIOReturnIPCError); |
5048 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOService_UserSetProperties_Rpl)) return (kIOReturnIPCError); |
5049 | if (((OSObject *) rpc.message->content.properties) != NULL && OSDynamicCast(OSContainer, (OSObject *) rpc.message->content.properties) == NULL) { return kIOReturnBadArgument; } |
5050 | |
5051 | ret = (*func)(target, |
5052 | rpc.message->content.properties); |
5053 | |
5054 | if (kIOReturnSuccess != ret) return (ret); |
5055 | |
5056 | rpc.reply->content.__hdr.msgid = IOService_UserSetProperties_ID; |
5057 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
5058 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
5059 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
5060 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 0; |
5061 | rpc.reply->content.__hdr.objectRefs = IOService_UserSetProperties_Rpl_ObjRefs; |
5062 | |
5063 | return (ret); |
5064 | } |
5065 | |
5066 | kern_return_t |
5067 | IOService::SendIOMessageServicePropertyChange_Invoke(const IORPC _rpc, |
5068 | OSMetaClassBase * target, |
5069 | SendIOMessageServicePropertyChange_Handler func) |
5070 | { |
5071 | IOService_SendIOMessageServicePropertyChange_Invocation rpc = { .rpc: _rpc }; |
5072 | kern_return_t ret; |
5073 | |
5074 | if (1 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
5075 | if (IOService_SendIOMessageServicePropertyChange_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
5076 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOService_SendIOMessageServicePropertyChange_Msg)) return (kIOReturnIPCError); |
5077 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOService_SendIOMessageServicePropertyChange_Rpl)) return (kIOReturnIPCError); |
5078 | |
5079 | ret = (*func)(target); |
5080 | |
5081 | if (kIOReturnSuccess != ret) return (ret); |
5082 | |
5083 | rpc.reply->content.__hdr.msgid = IOService_SendIOMessageServicePropertyChange_ID; |
5084 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
5085 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
5086 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
5087 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 0; |
5088 | rpc.reply->content.__hdr.objectRefs = IOService_SendIOMessageServicePropertyChange_Rpl_ObjRefs; |
5089 | |
5090 | return (ret); |
5091 | } |
5092 | |
5093 | kern_return_t |
5094 | IOService::RemoveProperty_Invoke(const IORPC _rpc, |
5095 | OSMetaClassBase * target, |
5096 | RemoveProperty_Handler func) |
5097 | { |
5098 | IOService_RemoveProperty_Invocation rpc = { .rpc: _rpc }; |
5099 | kern_return_t ret; |
5100 | |
5101 | if (2 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
5102 | if (IOService_RemoveProperty_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
5103 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOService_RemoveProperty_Msg)) return (kIOReturnIPCError); |
5104 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOService_RemoveProperty_Rpl)) return (kIOReturnIPCError); |
5105 | if (((OSObject *) rpc.message->content.propertyName) != NULL && OSDynamicCast(OSString, (OSObject *) rpc.message->content.propertyName) == NULL) { return kIOReturnBadArgument; } |
5106 | |
5107 | ret = (*func)(target, |
5108 | rpc.message->content.propertyName); |
5109 | |
5110 | if (kIOReturnSuccess != ret) return (ret); |
5111 | |
5112 | rpc.reply->content.__hdr.msgid = IOService_RemoveProperty_ID; |
5113 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
5114 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
5115 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
5116 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 0; |
5117 | rpc.reply->content.__hdr.objectRefs = IOService_RemoveProperty_Rpl_ObjRefs; |
5118 | |
5119 | return (ret); |
5120 | } |
5121 | |
5122 | kern_return_t |
5123 | IOService::CopySystemStateNotificationService_Invoke(const IORPC _rpc, |
5124 | OSMetaClassBase * target, |
5125 | CopySystemStateNotificationService_Handler func) |
5126 | { |
5127 | IOService_CopySystemStateNotificationService_Invocation rpc = { .rpc: _rpc }; |
5128 | kern_return_t ret; |
5129 | |
5130 | if (1 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
5131 | if (IOService_CopySystemStateNotificationService_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
5132 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOService_CopySystemStateNotificationService_Msg)) return (kIOReturnIPCError); |
5133 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOService_CopySystemStateNotificationService_Rpl)) return (kIOReturnIPCError); |
5134 | |
5135 | ret = (*func)(target, |
5136 | (IOService **)&rpc.reply->content.service); |
5137 | |
5138 | if (kIOReturnSuccess != ret) return (ret); |
5139 | |
5140 | rpc.reply->content.__hdr.msgid = IOService_CopySystemStateNotificationService_ID; |
5141 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
5142 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
5143 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
5144 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 1; |
5145 | rpc.reply->content.__hdr.objectRefs = IOService_CopySystemStateNotificationService_Rpl_ObjRefs; |
5146 | rpc.reply->service__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
5147 | |
5148 | return (ret); |
5149 | } |
5150 | |
5151 | kern_return_t |
5152 | IOService::StateNotificationItemCreate_Invoke(const IORPC _rpc, |
5153 | OSMetaClassBase * target, |
5154 | StateNotificationItemCreate_Handler func) |
5155 | { |
5156 | IOService_StateNotificationItemCreate_Invocation rpc = { .rpc: _rpc }; |
5157 | kern_return_t ret; |
5158 | |
5159 | if (3 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
5160 | if (IOService_StateNotificationItemCreate_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
5161 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOService_StateNotificationItemCreate_Msg)) return (kIOReturnIPCError); |
5162 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOService_StateNotificationItemCreate_Rpl)) return (kIOReturnIPCError); |
5163 | if (((OSObject *) rpc.message->content.itemName) != NULL && OSDynamicCast(OSString, (OSObject *) rpc.message->content.itemName) == NULL) { return kIOReturnBadArgument; } |
5164 | if (((OSObject *) rpc.message->content.schema) != NULL && OSDynamicCast(OSDictionary, (OSObject *) rpc.message->content.schema) == NULL) { return kIOReturnBadArgument; } |
5165 | |
5166 | ret = (*func)(target, |
5167 | rpc.message->content.itemName, |
5168 | rpc.message->content.schema); |
5169 | |
5170 | if (kIOReturnSuccess != ret) return (ret); |
5171 | |
5172 | rpc.reply->content.__hdr.msgid = IOService_StateNotificationItemCreate_ID; |
5173 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
5174 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
5175 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
5176 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 0; |
5177 | rpc.reply->content.__hdr.objectRefs = IOService_StateNotificationItemCreate_Rpl_ObjRefs; |
5178 | |
5179 | return (ret); |
5180 | } |
5181 | |
5182 | kern_return_t |
5183 | IOService::StateNotificationItemSet_Invoke(const IORPC _rpc, |
5184 | OSMetaClassBase * target, |
5185 | StateNotificationItemSet_Handler func) |
5186 | { |
5187 | IOService_StateNotificationItemSet_Invocation rpc = { .rpc: _rpc }; |
5188 | kern_return_t ret; |
5189 | |
5190 | if (3 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
5191 | if (IOService_StateNotificationItemSet_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
5192 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOService_StateNotificationItemSet_Msg)) return (kIOReturnIPCError); |
5193 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOService_StateNotificationItemSet_Rpl)) return (kIOReturnIPCError); |
5194 | if (((OSObject *) rpc.message->content.itemName) != NULL && OSDynamicCast(OSString, (OSObject *) rpc.message->content.itemName) == NULL) { return kIOReturnBadArgument; } |
5195 | if (((OSObject *) rpc.message->content.value) != NULL && OSDynamicCast(OSDictionary, (OSObject *) rpc.message->content.value) == NULL) { return kIOReturnBadArgument; } |
5196 | |
5197 | ret = (*func)(target, |
5198 | rpc.message->content.itemName, |
5199 | rpc.message->content.value); |
5200 | |
5201 | if (kIOReturnSuccess != ret) return (ret); |
5202 | |
5203 | rpc.reply->content.__hdr.msgid = IOService_StateNotificationItemSet_ID; |
5204 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
5205 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
5206 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
5207 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 0; |
5208 | rpc.reply->content.__hdr.objectRefs = IOService_StateNotificationItemSet_Rpl_ObjRefs; |
5209 | |
5210 | return (ret); |
5211 | } |
5212 | |
5213 | kern_return_t |
5214 | IOService::StateNotificationItemCopy_Invoke(const IORPC _rpc, |
5215 | OSMetaClassBase * target, |
5216 | StateNotificationItemCopy_Handler func) |
5217 | { |
5218 | IOService_StateNotificationItemCopy_Invocation rpc = { .rpc: _rpc }; |
5219 | kern_return_t ret; |
5220 | |
5221 | if (2 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
5222 | if (IOService_StateNotificationItemCopy_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
5223 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOService_StateNotificationItemCopy_Msg)) return (kIOReturnIPCError); |
5224 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOService_StateNotificationItemCopy_Rpl)) return (kIOReturnIPCError); |
5225 | if (((OSObject *) rpc.message->content.itemName) != NULL && OSDynamicCast(OSString, (OSObject *) rpc.message->content.itemName) == NULL) { return kIOReturnBadArgument; } |
5226 | |
5227 | ret = (*func)(target, |
5228 | rpc.message->content.itemName, |
5229 | &rpc.reply->content.value); |
5230 | |
5231 | if (kIOReturnSuccess != ret) return (ret); |
5232 | |
5233 | rpc.reply->content.__hdr.msgid = IOService_StateNotificationItemCopy_ID; |
5234 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
5235 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
5236 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
5237 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 1; |
5238 | rpc.reply->content.__hdr.objectRefs = IOService_StateNotificationItemCopy_Rpl_ObjRefs; |
5239 | rpc.reply->value__descriptor.type = MACH_MSG_OOL_DESCRIPTOR; |
5240 | rpc.reply->value__descriptor.copy = MACH_MSG_VIRTUAL_COPY; |
5241 | rpc.reply->value__descriptor.address = (void *) __builtin_offsetof(IOService_StateNotificationItemCopy_Rpl_Content, value); |
5242 | rpc.reply->value__descriptor.size = 0; |
5243 | |
5244 | return (ret); |
5245 | } |
5246 | |
5247 | kern_return_t |
5248 | IOService::Stop_async_Invoke(const IORPC _rpc, |
5249 | OSMetaClassBase * target, |
5250 | Stop_async_Handler func) |
5251 | { |
5252 | IOService_Stop_async_Invocation rpc = { .rpc: _rpc }; |
5253 | IOService * provider; |
5254 | |
5255 | if (2 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
5256 | if (IOService_Stop_async_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
5257 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOService_Stop_async_Msg)) return (kIOReturnIPCError); |
5258 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOService_Stop_async_Rpl)) return (kIOReturnIPCError); |
5259 | provider = OSDynamicCast(IOService, (OSObject *) rpc.message->content.provider); |
5260 | if (!provider && rpc.message->content.provider) return (kIOReturnBadArgument); |
5261 | |
5262 | (*func)(target, |
5263 | provider); |
5264 | |
5265 | |
5266 | return (kIOReturnSuccess); |
5267 | } |
5268 | |
5269 | kern_return_t |
5270 | IOService::_NewUserClient_Invoke(const IORPC _rpc, |
5271 | OSMetaClassBase * target, |
5272 | _NewUserClient_Handler func) |
5273 | { |
5274 | IOService__NewUserClient_Invocation rpc = { .rpc: _rpc }; |
5275 | kern_return_t ret; |
5276 | |
5277 | if (2 != rpc.message->mach.msgh_body.msgh_descriptor_count) return (kIOReturnIPCError); |
5278 | if (IOService__NewUserClient_Msg_ObjRefs != rpc.message->content.__hdr.objectRefs) return (kIOReturnIPCError); |
5279 | if (rpc.message != NULL && rpc.sendSize < sizeof(IOService__NewUserClient_Msg)) return (kIOReturnIPCError); |
5280 | if (rpc.reply != NULL && rpc.replySize < sizeof(IOService__NewUserClient_Rpl)) return (kIOReturnIPCError); |
5281 | if (((OSObject *) rpc.message->content.entitlements) != NULL && OSDynamicCast(OSDictionary, (OSObject *) rpc.message->content.entitlements) == NULL) { return kIOReturnBadArgument; } |
5282 | |
5283 | ret = (*func)(target, |
5284 | rpc.message->content.type, |
5285 | rpc.message->content.entitlements, |
5286 | (IOUserClient **)&rpc.reply->content.userClient); |
5287 | |
5288 | if (kIOReturnSuccess != ret) return (ret); |
5289 | |
5290 | rpc.reply->content.__hdr.msgid = IOService__NewUserClient_ID; |
5291 | rpc.reply->content.__hdr.flags = kIORPCMessageOneway; |
5292 | rpc.reply->mach.msgh.msgh_id = kIORPCVersion190615Reply; |
5293 | rpc.reply->mach.msgh.msgh_size = sizeof(*rpc.reply); |
5294 | rpc.reply->mach.msgh_body.msgh_descriptor_count = 1; |
5295 | rpc.reply->content.__hdr.objectRefs = IOService__NewUserClient_Rpl_ObjRefs; |
5296 | rpc.reply->userClient__descriptor.type = MACH_MSG_PORT_DESCRIPTOR; |
5297 | |
5298 | return (ret); |
5299 | } |
5300 | |
5301 | |
5302 | |
5303 | |