1/*
2 * IDENTIFICATION:
3 * stub generated Tue Apr 9 11:33:39 2019
4 * with a MiG generated by bootstrap_cmds-96.20.2.200.4
5 * OPTIONS:
6 * KernelServer
7 */
8
9/* Module iokit */
10
11#define __MIG_check__Request__iokit_subsystem__ 1
12
13#include "device_server.h"
14
15#ifndef mig_internal
16#define mig_internal static __inline__
17#endif /* mig_internal */
18
19#ifndef mig_external
20#define mig_external
21#endif /* mig_external */
22
23#if !defined(__MigTypeCheck) && defined(TypeCheck)
24#define __MigTypeCheck TypeCheck /* Legacy setting */
25#endif /* !defined(__MigTypeCheck) */
26
27#if !defined(__MigKernelSpecificCode) && defined(_MIG_KERNEL_SPECIFIC_CODE_)
28#define __MigKernelSpecificCode _MIG_KERNEL_SPECIFIC_CODE_ /* Legacy setting */
29#endif /* !defined(__MigKernelSpecificCode) */
30
31#ifndef LimitCheck
32#define LimitCheck 0
33#endif /* LimitCheck */
34
35#ifndef min
36#define min(a,b) ( ((a) < (b))? (a): (b) )
37#endif /* min */
38
39#if !defined(_WALIGN_)
40#define _WALIGN_(x) (((x) + 3) & ~3)
41#endif /* !defined(_WALIGN_) */
42
43#if !defined(_WALIGNSZ_)
44#define _WALIGNSZ_(x) _WALIGN_(sizeof(x))
45#endif /* !defined(_WALIGNSZ_) */
46
47#ifndef UseStaticTemplates
48#define UseStaticTemplates 0
49#endif /* UseStaticTemplates */
50
51#ifndef __DeclareRcvRpc
52#define __DeclareRcvRpc(_NUM_, _NAME_)
53#endif /* __DeclareRcvRpc */
54
55#ifndef __BeforeRcvRpc
56#define __BeforeRcvRpc(_NUM_, _NAME_)
57#endif /* __BeforeRcvRpc */
58
59#ifndef __AfterRcvRpc
60#define __AfterRcvRpc(_NUM_, _NAME_)
61#endif /* __AfterRcvRpc */
62
63#ifndef __DeclareRcvSimple
64#define __DeclareRcvSimple(_NUM_, _NAME_)
65#endif /* __DeclareRcvSimple */
66
67#ifndef __BeforeRcvSimple
68#define __BeforeRcvSimple(_NUM_, _NAME_)
69#endif /* __BeforeRcvSimple */
70
71#ifndef __AfterRcvSimple
72#define __AfterRcvSimple(_NUM_, _NAME_)
73#endif /* __AfterRcvSimple */
74
75#define novalue void
76
77#if __MigKernelSpecificCode
78#define msgh_request_port msgh_remote_port
79#define MACH_MSGH_BITS_REQUEST(bits) MACH_MSGH_BITS_REMOTE(bits)
80#define msgh_reply_port msgh_local_port
81#define MACH_MSGH_BITS_REPLY(bits) MACH_MSGH_BITS_LOCAL(bits)
82#else
83#define msgh_request_port msgh_local_port
84#define MACH_MSGH_BITS_REQUEST(bits) MACH_MSGH_BITS_LOCAL(bits)
85#define msgh_reply_port msgh_remote_port
86#define MACH_MSGH_BITS_REPLY(bits) MACH_MSGH_BITS_REMOTE(bits)
87#endif /* __MigKernelSpecificCode */
88
89#define MIG_RETURN_ERROR(X, code) {\
90 ((mig_reply_error_t *)X)->RetCode = code;\
91 ((mig_reply_error_t *)X)->NDR = NDR_record;\
92 return;\
93 }
94
95/* Forward Declarations */
96
97
98mig_internal novalue _Xio_object_get_class
99 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
100
101mig_internal novalue _Xio_object_conforms_to
102 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
103
104mig_internal novalue _Xio_iterator_next
105 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
106
107mig_internal novalue _Xio_iterator_reset
108 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
109
110mig_internal novalue _Xio_service_get_matching_services
111 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
112
113mig_internal novalue _Xio_registry_entry_get_property
114 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
115
116mig_internal novalue _Xio_registry_create_iterator
117 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
118
119mig_internal novalue _Xio_registry_iterator_enter_entry
120 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
121
122mig_internal novalue _Xio_registry_iterator_exit_entry
123 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
124
125mig_internal novalue _Xio_registry_entry_from_path
126 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
127
128mig_internal novalue _Xio_registry_entry_get_name
129 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
130
131mig_internal novalue _Xio_registry_entry_get_properties
132 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
133
134mig_internal novalue _Xio_registry_entry_get_property_bytes
135 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
136
137mig_internal novalue _Xio_registry_entry_get_child_iterator
138 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
139
140mig_internal novalue _Xio_registry_entry_get_parent_iterator
141 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
142
143mig_internal novalue _Xio_service_close
144 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
145
146mig_internal novalue _Xio_connect_get_service
147 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
148
149mig_internal novalue _Xio_connect_set_notification_port
150 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
151
152mig_internal novalue _Xio_connect_map_memory
153 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
154
155mig_internal novalue _Xio_connect_add_client
156 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
157
158mig_internal novalue _Xio_connect_set_properties
159 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
160
161mig_internal novalue _Xio_connect_method_scalarI_scalarO
162 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
163
164mig_internal novalue _Xio_connect_method_scalarI_structureO
165 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
166
167mig_internal novalue _Xio_connect_method_scalarI_structureI
168 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
169
170mig_internal novalue _Xio_connect_method_structureI_structureO
171 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
172
173mig_internal novalue _Xio_registry_entry_get_path
174 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
175
176mig_internal novalue _Xio_registry_get_root_entry
177 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
178
179mig_internal novalue _Xio_registry_entry_set_properties
180 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
181
182mig_internal novalue _Xio_registry_entry_in_plane
183 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
184
185mig_internal novalue _Xio_object_get_retain_count
186 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
187
188mig_internal novalue _Xio_service_get_busy_state
189 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
190
191mig_internal novalue _Xio_service_wait_quiet
192 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
193
194mig_internal novalue _Xio_registry_entry_create_iterator
195 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
196
197mig_internal novalue _Xio_iterator_is_valid
198 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
199
200mig_internal novalue _Xio_catalog_send_data
201 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
202
203mig_internal novalue _Xio_catalog_terminate
204 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
205
206mig_internal novalue _Xio_catalog_get_data
207 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
208
209mig_internal novalue _Xio_catalog_get_gen_count
210 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
211
212mig_internal novalue _Xio_catalog_module_loaded
213 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
214
215mig_internal novalue _Xio_catalog_reset
216 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
217
218mig_internal novalue _Xio_service_request_probe
219 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
220
221mig_internal novalue _Xio_registry_entry_get_name_in_plane
222 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
223
224mig_internal novalue _Xio_service_match_property_table
225 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
226
227mig_internal novalue _Xio_async_method_scalarI_scalarO
228 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
229
230mig_internal novalue _Xio_async_method_scalarI_structureO
231 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
232
233mig_internal novalue _Xio_async_method_scalarI_structureI
234 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
235
236mig_internal novalue _Xio_async_method_structureI_structureO
237 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
238
239mig_internal novalue _Xio_service_add_notification
240 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
241
242mig_internal novalue _Xio_service_add_interest_notification
243 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
244
245mig_internal novalue _Xio_service_acknowledge_notification
246 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
247
248mig_internal novalue _Xio_connect_get_notification_semaphore
249 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
250
251mig_internal novalue _Xio_connect_unmap_memory
252 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
253
254mig_internal novalue _Xio_registry_entry_get_location_in_plane
255 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
256
257mig_internal novalue _Xio_registry_entry_get_property_recursively
258 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
259
260mig_internal novalue _Xio_service_get_state
261 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
262
263mig_internal novalue _Xio_service_get_matching_services_ool
264 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
265
266mig_internal novalue _Xio_service_match_property_table_ool
267 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
268
269mig_internal novalue _Xio_service_add_notification_ool
270 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
271
272mig_internal novalue _Xio_object_get_superclass
273 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
274
275mig_internal novalue _Xio_object_get_bundle_identifier
276 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
277
278mig_internal novalue _Xio_service_open_extended
279 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
280
281mig_internal novalue _Xio_connect_map_memory_into_task
282 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
283
284mig_internal novalue _Xio_connect_unmap_memory_from_task
285 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
286
287mig_internal novalue _Xio_connect_method
288 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
289
290mig_internal novalue _Xio_connect_async_method
291 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
292
293mig_internal novalue _Xio_connect_set_notification_port_64
294 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
295
296mig_internal novalue _Xio_service_add_notification_64
297 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
298
299mig_internal novalue _Xio_service_add_interest_notification_64
300 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
301
302mig_internal novalue _Xio_service_add_notification_ool_64
303 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
304
305mig_internal novalue _Xio_registry_entry_get_registry_entry_id
306 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
307
308mig_internal novalue _Xio_connect_method_var_output
309 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
310
311mig_internal novalue _Xio_service_get_matching_service
312 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
313
314mig_internal novalue _Xio_service_get_matching_service_ool
315 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
316
317mig_internal novalue _Xio_service_get_authorization_id
318 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
319
320mig_internal novalue _Xio_service_set_authorization_id
321 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
322
323mig_internal novalue _Xio_server_version
324 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
325
326mig_internal novalue _Xio_registry_entry_get_properties_bin
327 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
328
329mig_internal novalue _Xio_registry_entry_get_property_bin
330 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
331
332mig_internal novalue _Xio_service_get_matching_service_bin
333 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
334
335mig_internal novalue _Xio_service_get_matching_services_bin
336 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
337
338mig_internal novalue _Xio_service_match_property_table_bin
339 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
340
341mig_internal novalue _Xio_service_add_notification_bin
342 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
343
344mig_internal novalue _Xio_service_add_notification_bin_64
345 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
346
347mig_internal novalue _Xio_registry_entry_get_path_ool
348 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
349
350mig_internal novalue _Xio_registry_entry_from_path_ool
351 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
352
353mig_internal novalue _Xio_device_tree_entry_exists_with_name
354 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
355
356
357#if ( __MigTypeCheck )
358#if __MIG_check__Request__iokit_subsystem__
359#if !defined(__MIG_check__Request__io_object_get_class_t__defined)
360#define __MIG_check__Request__io_object_get_class_t__defined
361
362mig_internal kern_return_t __MIG_check__Request__io_object_get_class_t(__attribute__((__unused__)) __Request__io_object_get_class_t *In0P)
363{
364
365 typedef __Request__io_object_get_class_t __Request;
366#if __MigTypeCheck
367 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
368 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
369 return MIG_BAD_ARGUMENTS;
370#endif /* __MigTypeCheck */
371
372 return MACH_MSG_SUCCESS;
373}
374#endif /* !defined(__MIG_check__Request__io_object_get_class_t__defined) */
375#endif /* __MIG_check__Request__iokit_subsystem__ */
376#endif /* ( __MigTypeCheck ) */
377
378
379/* Routine io_object_get_class */
380mig_internal novalue _Xio_object_get_class
381 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
382{
383
384#ifdef __MigPackStructs
385#pragma pack(4)
386#endif
387 typedef struct {
388 mach_msg_header_t Head;
389 mach_msg_trailer_t trailer;
390 } Request __attribute__((unused));
391#ifdef __MigPackStructs
392#pragma pack()
393#endif
394 typedef __Request__io_object_get_class_t __Request;
395 typedef __Reply__io_object_get_class_t Reply __attribute__((unused));
396
397 /*
398 * typedef struct {
399 * mach_msg_header_t Head;
400 * NDR_record_t NDR;
401 * kern_return_t RetCode;
402 * } mig_reply_error_t;
403 */
404
405 Request *In0P = (Request *) InHeadP;
406 Reply *OutP = (Reply *) OutHeadP;
407#ifdef __MIG_check__Request__io_object_get_class_t__defined
408 kern_return_t check_result;
409#endif /* __MIG_check__Request__io_object_get_class_t__defined */
410
411#if __MigKernelSpecificCode
412#else
413#endif /* __MigKernelSpecificCode */
414 io_object_t object;
415
416 __DeclareRcvRpc(2800, "io_object_get_class")
417 __BeforeRcvRpc(2800, "io_object_get_class")
418
419#if defined(__MIG_check__Request__io_object_get_class_t__defined)
420 check_result = __MIG_check__Request__io_object_get_class_t((__Request *)In0P);
421 if (check_result != MACH_MSG_SUCCESS)
422 { MIG_RETURN_ERROR(OutP, check_result); }
423#endif /* defined(__MIG_check__Request__io_object_get_class_t__defined) */
424
425 object = iokit_lookup_object_port(In0P->Head.msgh_request_port);
426
427 OutP->RetCode = is_io_object_get_class(object, OutP->className);
428 iokit_remove_reference(object);
429 if (OutP->RetCode != KERN_SUCCESS) {
430 MIG_RETURN_ERROR(OutP, OutP->RetCode);
431 }
432#if __MigKernelSpecificCode
433#endif /* __MigKernelSpecificCode */
434
435 OutP->NDR = NDR_record;
436
437#ifdef __LP64__
438 {
439 size_t strLength = strlen(OutP->className) + 1;
440 if (strLength > 0xffffffff)
441 MIG_RETURN_ERROR(OutP, MIG_BAD_ARGUMENTS);
442 OutP->classNameCnt = (mach_msg_type_number_t) strLength;
443 }
444#else
445 OutP->classNameCnt = (mach_msg_type_number_t) strlen(OutP->className) + 1;
446#endif /* __LP64__ */
447 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 128) + (_WALIGN_((OutP->classNameCnt + 3) & ~3));
448
449 __AfterRcvRpc(2800, "io_object_get_class")
450}
451
452#if ( __MigTypeCheck )
453#if __MIG_check__Request__iokit_subsystem__
454#if !defined(__MIG_check__Request__io_object_conforms_to_t__defined)
455#define __MIG_check__Request__io_object_conforms_to_t__defined
456
457mig_internal kern_return_t __MIG_check__Request__io_object_conforms_to_t(__attribute__((__unused__)) __Request__io_object_conforms_to_t *In0P)
458{
459
460 typedef __Request__io_object_conforms_to_t __Request;
461#if __MigTypeCheck
462 unsigned int msgh_size;
463#endif /* __MigTypeCheck */
464
465#if __MigTypeCheck
466 msgh_size = In0P->Head.msgh_size;
467 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
468 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 128)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
469 return MIG_BAD_ARGUMENTS;
470#endif /* __MigTypeCheck */
471
472#if defined(__NDR_convert__int_rep__Request__io_object_conforms_to_t__classNameCnt__defined)
473 if (In0P->NDR.int_rep != NDR_record.int_rep)
474 __NDR_convert__int_rep__Request__io_object_conforms_to_t__classNameCnt(&In0P->classNameCnt, In0P->NDR.int_rep);
475#endif /* __NDR_convert__int_rep__Request__io_object_conforms_to_t__classNameCnt__defined */
476#if __MigTypeCheck
477 if ( In0P->classNameCnt > 128 )
478 return MIG_BAD_ARGUMENTS;
479 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 128)) < In0P->classNameCnt) ||
480 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 128) + _WALIGN_(In0P->classNameCnt)))
481 return MIG_BAD_ARGUMENTS;
482#endif /* __MigTypeCheck */
483
484#if __MigTypeCheck
485 {
486 char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
487#if __MigKernelSpecificCode
488 size_t strnlen_limit;
489#else
490 size_t memchr_limit;
491#endif /* __MigKernelSpecificCode */
492
493#if __MigKernelSpecificCode
494 strnlen_limit = min((msg_limit - In0P->className), 128);
495 if (( strnlen(In0P->className, strnlen_limit) >= 128 + 1 ))
496 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
497#else
498 memchr_limit = min((msg_limit - In0P->className), 128);
499 if (( memchr(In0P->className, '\0', memchr_limit) == NULL ))
500 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
501#endif /* __MigKernelSpecificCode */
502 }
503#endif /* __MigTypeCheck */
504
505 return MACH_MSG_SUCCESS;
506}
507#endif /* !defined(__MIG_check__Request__io_object_conforms_to_t__defined) */
508#endif /* __MIG_check__Request__iokit_subsystem__ */
509#endif /* ( __MigTypeCheck ) */
510
511
512/* Routine io_object_conforms_to */
513mig_internal novalue _Xio_object_conforms_to
514 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
515{
516
517#ifdef __MigPackStructs
518#pragma pack(4)
519#endif
520 typedef struct {
521 mach_msg_header_t Head;
522 NDR_record_t NDR;
523 mach_msg_type_number_t classNameOffset; /* MiG doesn't use it */
524 mach_msg_type_number_t classNameCnt;
525 char className[128];
526 mach_msg_trailer_t trailer;
527 } Request __attribute__((unused));
528#ifdef __MigPackStructs
529#pragma pack()
530#endif
531 typedef __Request__io_object_conforms_to_t __Request;
532 typedef __Reply__io_object_conforms_to_t Reply __attribute__((unused));
533
534 /*
535 * typedef struct {
536 * mach_msg_header_t Head;
537 * NDR_record_t NDR;
538 * kern_return_t RetCode;
539 * } mig_reply_error_t;
540 */
541
542 Request *In0P = (Request *) InHeadP;
543 Reply *OutP = (Reply *) OutHeadP;
544#ifdef __MIG_check__Request__io_object_conforms_to_t__defined
545 kern_return_t check_result;
546#endif /* __MIG_check__Request__io_object_conforms_to_t__defined */
547
548#if __MigKernelSpecificCode
549#else
550#endif /* __MigKernelSpecificCode */
551 io_object_t object;
552
553 __DeclareRcvRpc(2801, "io_object_conforms_to")
554 __BeforeRcvRpc(2801, "io_object_conforms_to")
555
556#if defined(__MIG_check__Request__io_object_conforms_to_t__defined)
557 check_result = __MIG_check__Request__io_object_conforms_to_t((__Request *)In0P);
558 if (check_result != MACH_MSG_SUCCESS)
559 { MIG_RETURN_ERROR(OutP, check_result); }
560#endif /* defined(__MIG_check__Request__io_object_conforms_to_t__defined) */
561
562 object = iokit_lookup_object_port(In0P->Head.msgh_request_port);
563
564 OutP->RetCode = is_io_object_conforms_to(object, In0P->className, &OutP->conforms);
565 iokit_remove_reference(object);
566 if (OutP->RetCode != KERN_SUCCESS) {
567 MIG_RETURN_ERROR(OutP, OutP->RetCode);
568 }
569#if __MigKernelSpecificCode
570#endif /* __MigKernelSpecificCode */
571
572 OutP->NDR = NDR_record;
573
574
575 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
576 __AfterRcvRpc(2801, "io_object_conforms_to")
577}
578
579#if ( __MigTypeCheck )
580#if __MIG_check__Request__iokit_subsystem__
581#if !defined(__MIG_check__Request__io_iterator_next_t__defined)
582#define __MIG_check__Request__io_iterator_next_t__defined
583
584mig_internal kern_return_t __MIG_check__Request__io_iterator_next_t(__attribute__((__unused__)) __Request__io_iterator_next_t *In0P)
585{
586
587 typedef __Request__io_iterator_next_t __Request;
588#if __MigTypeCheck
589 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
590 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
591 return MIG_BAD_ARGUMENTS;
592#endif /* __MigTypeCheck */
593
594 return MACH_MSG_SUCCESS;
595}
596#endif /* !defined(__MIG_check__Request__io_iterator_next_t__defined) */
597#endif /* __MIG_check__Request__iokit_subsystem__ */
598#endif /* ( __MigTypeCheck ) */
599
600
601/* Routine io_iterator_next */
602mig_internal novalue _Xio_iterator_next
603 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
604{
605
606#ifdef __MigPackStructs
607#pragma pack(4)
608#endif
609 typedef struct {
610 mach_msg_header_t Head;
611 mach_msg_trailer_t trailer;
612 } Request __attribute__((unused));
613#ifdef __MigPackStructs
614#pragma pack()
615#endif
616 typedef __Request__io_iterator_next_t __Request;
617 typedef __Reply__io_iterator_next_t Reply __attribute__((unused));
618
619 /*
620 * typedef struct {
621 * mach_msg_header_t Head;
622 * NDR_record_t NDR;
623 * kern_return_t RetCode;
624 * } mig_reply_error_t;
625 */
626
627 Request *In0P = (Request *) InHeadP;
628 Reply *OutP = (Reply *) OutHeadP;
629#ifdef __MIG_check__Request__io_iterator_next_t__defined
630 kern_return_t check_result;
631#endif /* __MIG_check__Request__io_iterator_next_t__defined */
632
633#if __MigKernelSpecificCode
634#if UseStaticTemplates
635 const static mach_msg_port_descriptor_t objectTemplate = {
636 /* name = */ MACH_PORT_NULL,
637 /* pad1 = */ 0,
638 /* pad2 = */ 0,
639 /* disp = */ 17,
640 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
641 };
642#endif /* UseStaticTemplates */
643
644#else
645#if UseStaticTemplates
646 const static mach_msg_port_descriptor_t objectTemplate = {
647 /* name = */ MACH_PORT_NULL,
648 /* pad1 = */ 0,
649 /* pad2 = */ 0,
650 /* disp = */ 19,
651 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
652 };
653#endif /* UseStaticTemplates */
654
655#endif /* __MigKernelSpecificCode */
656 kern_return_t RetCode;
657 io_object_t iterator;
658 io_object_t object;
659
660 __DeclareRcvRpc(2802, "io_iterator_next")
661 __BeforeRcvRpc(2802, "io_iterator_next")
662
663#if defined(__MIG_check__Request__io_iterator_next_t__defined)
664 check_result = __MIG_check__Request__io_iterator_next_t((__Request *)In0P);
665 if (check_result != MACH_MSG_SUCCESS)
666 { MIG_RETURN_ERROR(OutP, check_result); }
667#endif /* defined(__MIG_check__Request__io_iterator_next_t__defined) */
668
669#if UseStaticTemplates
670 OutP->object = objectTemplate;
671#else /* UseStaticTemplates */
672#if __MigKernelSpecificCode
673 OutP->object.disposition = 17;
674#else
675 OutP->object.disposition = 19;
676#endif /* __MigKernelSpecificCode */
677#if !(defined(KERNEL) && defined(__LP64__))
678 OutP->object.pad1 = 0;
679#endif
680 OutP->object.pad2 = 0;
681 OutP->object.type = MACH_MSG_PORT_DESCRIPTOR;
682#if defined(KERNEL)
683 OutP->object.pad_end = 0;
684#endif
685#endif /* UseStaticTemplates */
686
687
688 iterator = iokit_lookup_object_port(In0P->Head.msgh_request_port);
689
690 RetCode = is_io_iterator_next(iterator, &object);
691 iokit_remove_reference(iterator);
692 if (RetCode != KERN_SUCCESS) {
693 MIG_RETURN_ERROR(OutP, RetCode);
694 }
695#if __MigKernelSpecificCode
696#endif /* __MigKernelSpecificCode */
697 OutP->object.name = (mach_port_t)iokit_make_object_port(object);
698
699
700 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
701 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
702 OutP->msgh_body.msgh_descriptor_count = 1;
703 __AfterRcvRpc(2802, "io_iterator_next")
704}
705
706#if ( __MigTypeCheck )
707#if __MIG_check__Request__iokit_subsystem__
708#if !defined(__MIG_check__Request__io_iterator_reset_t__defined)
709#define __MIG_check__Request__io_iterator_reset_t__defined
710
711mig_internal kern_return_t __MIG_check__Request__io_iterator_reset_t(__attribute__((__unused__)) __Request__io_iterator_reset_t *In0P)
712{
713
714 typedef __Request__io_iterator_reset_t __Request;
715#if __MigTypeCheck
716 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
717 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
718 return MIG_BAD_ARGUMENTS;
719#endif /* __MigTypeCheck */
720
721 return MACH_MSG_SUCCESS;
722}
723#endif /* !defined(__MIG_check__Request__io_iterator_reset_t__defined) */
724#endif /* __MIG_check__Request__iokit_subsystem__ */
725#endif /* ( __MigTypeCheck ) */
726
727
728/* Routine io_iterator_reset */
729mig_internal novalue _Xio_iterator_reset
730 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
731{
732
733#ifdef __MigPackStructs
734#pragma pack(4)
735#endif
736 typedef struct {
737 mach_msg_header_t Head;
738 mach_msg_trailer_t trailer;
739 } Request __attribute__((unused));
740#ifdef __MigPackStructs
741#pragma pack()
742#endif
743 typedef __Request__io_iterator_reset_t __Request;
744 typedef __Reply__io_iterator_reset_t Reply __attribute__((unused));
745
746 /*
747 * typedef struct {
748 * mach_msg_header_t Head;
749 * NDR_record_t NDR;
750 * kern_return_t RetCode;
751 * } mig_reply_error_t;
752 */
753
754 Request *In0P = (Request *) InHeadP;
755 Reply *OutP = (Reply *) OutHeadP;
756#ifdef __MIG_check__Request__io_iterator_reset_t__defined
757 kern_return_t check_result;
758#endif /* __MIG_check__Request__io_iterator_reset_t__defined */
759
760#if __MigKernelSpecificCode
761#else
762#endif /* __MigKernelSpecificCode */
763 io_object_t iterator;
764
765 __DeclareRcvRpc(2803, "io_iterator_reset")
766 __BeforeRcvRpc(2803, "io_iterator_reset")
767
768#if defined(__MIG_check__Request__io_iterator_reset_t__defined)
769 check_result = __MIG_check__Request__io_iterator_reset_t((__Request *)In0P);
770 if (check_result != MACH_MSG_SUCCESS)
771 { MIG_RETURN_ERROR(OutP, check_result); }
772#endif /* defined(__MIG_check__Request__io_iterator_reset_t__defined) */
773
774 iterator = iokit_lookup_object_port(In0P->Head.msgh_request_port);
775
776 OutP->RetCode = is_io_iterator_reset(iterator);
777 iokit_remove_reference(iterator);
778#if __MigKernelSpecificCode
779#endif /* __MigKernelSpecificCode */
780
781 OutP->NDR = NDR_record;
782
783
784 __AfterRcvRpc(2803, "io_iterator_reset")
785}
786
787#if ( __MigTypeCheck )
788#if __MIG_check__Request__iokit_subsystem__
789#if !defined(__MIG_check__Request__io_service_get_matching_services_t__defined)
790#define __MIG_check__Request__io_service_get_matching_services_t__defined
791
792mig_internal kern_return_t __MIG_check__Request__io_service_get_matching_services_t(__attribute__((__unused__)) __Request__io_service_get_matching_services_t *In0P)
793{
794
795 typedef __Request__io_service_get_matching_services_t __Request;
796#if __MigTypeCheck
797 unsigned int msgh_size;
798#endif /* __MigTypeCheck */
799
800#if __MigTypeCheck
801 msgh_size = In0P->Head.msgh_size;
802 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
803 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 512)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
804 return MIG_BAD_ARGUMENTS;
805#endif /* __MigTypeCheck */
806
807#if defined(__NDR_convert__int_rep__Request__io_service_get_matching_services_t__matchingCnt__defined)
808 if (In0P->NDR.int_rep != NDR_record.int_rep)
809 __NDR_convert__int_rep__Request__io_service_get_matching_services_t__matchingCnt(&In0P->matchingCnt, In0P->NDR.int_rep);
810#endif /* __NDR_convert__int_rep__Request__io_service_get_matching_services_t__matchingCnt__defined */
811#if __MigTypeCheck
812 if ( In0P->matchingCnt > 512 )
813 return MIG_BAD_ARGUMENTS;
814 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 512)) < In0P->matchingCnt) ||
815 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 512) + _WALIGN_(In0P->matchingCnt)))
816 return MIG_BAD_ARGUMENTS;
817#endif /* __MigTypeCheck */
818
819#if __MigTypeCheck
820 {
821 char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
822#if __MigKernelSpecificCode
823 size_t strnlen_limit;
824#else
825 size_t memchr_limit;
826#endif /* __MigKernelSpecificCode */
827
828#if __MigKernelSpecificCode
829 strnlen_limit = min((msg_limit - In0P->matching), 512);
830 if (( strnlen(In0P->matching, strnlen_limit) >= 512 + 1 ))
831 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
832#else
833 memchr_limit = min((msg_limit - In0P->matching), 512);
834 if (( memchr(In0P->matching, '\0', memchr_limit) == NULL ))
835 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
836#endif /* __MigKernelSpecificCode */
837 }
838#endif /* __MigTypeCheck */
839
840 return MACH_MSG_SUCCESS;
841}
842#endif /* !defined(__MIG_check__Request__io_service_get_matching_services_t__defined) */
843#endif /* __MIG_check__Request__iokit_subsystem__ */
844#endif /* ( __MigTypeCheck ) */
845
846
847/* Routine io_service_get_matching_services */
848mig_internal novalue _Xio_service_get_matching_services
849 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
850{
851
852#ifdef __MigPackStructs
853#pragma pack(4)
854#endif
855 typedef struct {
856 mach_msg_header_t Head;
857 NDR_record_t NDR;
858 mach_msg_type_number_t matchingOffset; /* MiG doesn't use it */
859 mach_msg_type_number_t matchingCnt;
860 char matching[512];
861 mach_msg_trailer_t trailer;
862 } Request __attribute__((unused));
863#ifdef __MigPackStructs
864#pragma pack()
865#endif
866 typedef __Request__io_service_get_matching_services_t __Request;
867 typedef __Reply__io_service_get_matching_services_t Reply __attribute__((unused));
868
869 /*
870 * typedef struct {
871 * mach_msg_header_t Head;
872 * NDR_record_t NDR;
873 * kern_return_t RetCode;
874 * } mig_reply_error_t;
875 */
876
877 Request *In0P = (Request *) InHeadP;
878 Reply *OutP = (Reply *) OutHeadP;
879#ifdef __MIG_check__Request__io_service_get_matching_services_t__defined
880 kern_return_t check_result;
881#endif /* __MIG_check__Request__io_service_get_matching_services_t__defined */
882
883#if __MigKernelSpecificCode
884#if UseStaticTemplates
885 const static mach_msg_port_descriptor_t existingTemplate = {
886 /* name = */ MACH_PORT_NULL,
887 /* pad1 = */ 0,
888 /* pad2 = */ 0,
889 /* disp = */ 17,
890 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
891 };
892#endif /* UseStaticTemplates */
893
894#else
895#if UseStaticTemplates
896 const static mach_msg_port_descriptor_t existingTemplate = {
897 /* name = */ MACH_PORT_NULL,
898 /* pad1 = */ 0,
899 /* pad2 = */ 0,
900 /* disp = */ 19,
901 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
902 };
903#endif /* UseStaticTemplates */
904
905#endif /* __MigKernelSpecificCode */
906 kern_return_t RetCode;
907 io_object_t existing;
908
909 __DeclareRcvRpc(2804, "io_service_get_matching_services")
910 __BeforeRcvRpc(2804, "io_service_get_matching_services")
911
912#if defined(__MIG_check__Request__io_service_get_matching_services_t__defined)
913 check_result = __MIG_check__Request__io_service_get_matching_services_t((__Request *)In0P);
914 if (check_result != MACH_MSG_SUCCESS)
915 { MIG_RETURN_ERROR(OutP, check_result); }
916#endif /* defined(__MIG_check__Request__io_service_get_matching_services_t__defined) */
917
918#if UseStaticTemplates
919 OutP->existing = existingTemplate;
920#else /* UseStaticTemplates */
921#if __MigKernelSpecificCode
922 OutP->existing.disposition = 17;
923#else
924 OutP->existing.disposition = 19;
925#endif /* __MigKernelSpecificCode */
926#if !(defined(KERNEL) && defined(__LP64__))
927 OutP->existing.pad1 = 0;
928#endif
929 OutP->existing.pad2 = 0;
930 OutP->existing.type = MACH_MSG_PORT_DESCRIPTOR;
931#if defined(KERNEL)
932 OutP->existing.pad_end = 0;
933#endif
934#endif /* UseStaticTemplates */
935
936
937 RetCode = is_io_service_get_matching_services(In0P->Head.msgh_request_port, In0P->matching, &existing);
938 if (RetCode != KERN_SUCCESS) {
939 MIG_RETURN_ERROR(OutP, RetCode);
940 }
941#if __MigKernelSpecificCode
942#endif /* __MigKernelSpecificCode */
943 OutP->existing.name = (mach_port_t)iokit_make_object_port(existing);
944
945
946 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
947 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
948 OutP->msgh_body.msgh_descriptor_count = 1;
949 __AfterRcvRpc(2804, "io_service_get_matching_services")
950}
951
952#if ( __MigTypeCheck )
953#if __MIG_check__Request__iokit_subsystem__
954#if !defined(__MIG_check__Request__io_registry_entry_get_property_t__defined)
955#define __MIG_check__Request__io_registry_entry_get_property_t__defined
956
957mig_internal kern_return_t __MIG_check__Request__io_registry_entry_get_property_t(__attribute__((__unused__)) __Request__io_registry_entry_get_property_t *In0P)
958{
959
960 typedef __Request__io_registry_entry_get_property_t __Request;
961#if __MigTypeCheck
962 unsigned int msgh_size;
963#endif /* __MigTypeCheck */
964
965#if __MigTypeCheck
966 msgh_size = In0P->Head.msgh_size;
967 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
968 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 128)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
969 return MIG_BAD_ARGUMENTS;
970#endif /* __MigTypeCheck */
971
972#if defined(__NDR_convert__int_rep__Request__io_registry_entry_get_property_t__property_nameCnt__defined)
973 if (In0P->NDR.int_rep != NDR_record.int_rep)
974 __NDR_convert__int_rep__Request__io_registry_entry_get_property_t__property_nameCnt(&In0P->property_nameCnt, In0P->NDR.int_rep);
975#endif /* __NDR_convert__int_rep__Request__io_registry_entry_get_property_t__property_nameCnt__defined */
976#if __MigTypeCheck
977 if ( In0P->property_nameCnt > 128 )
978 return MIG_BAD_ARGUMENTS;
979 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 128)) < In0P->property_nameCnt) ||
980 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 128) + _WALIGN_(In0P->property_nameCnt)))
981 return MIG_BAD_ARGUMENTS;
982#endif /* __MigTypeCheck */
983
984#if __MigTypeCheck
985 {
986 char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
987#if __MigKernelSpecificCode
988 size_t strnlen_limit;
989#else
990 size_t memchr_limit;
991#endif /* __MigKernelSpecificCode */
992
993#if __MigKernelSpecificCode
994 strnlen_limit = min((msg_limit - In0P->property_name), 128);
995 if (( strnlen(In0P->property_name, strnlen_limit) >= 128 + 1 ))
996 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
997#else
998 memchr_limit = min((msg_limit - In0P->property_name), 128);
999 if (( memchr(In0P->property_name, '\0', memchr_limit) == NULL ))
1000 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
1001#endif /* __MigKernelSpecificCode */
1002 }
1003#endif /* __MigTypeCheck */
1004
1005 return MACH_MSG_SUCCESS;
1006}
1007#endif /* !defined(__MIG_check__Request__io_registry_entry_get_property_t__defined) */
1008#endif /* __MIG_check__Request__iokit_subsystem__ */
1009#endif /* ( __MigTypeCheck ) */
1010
1011
1012/* Routine io_registry_entry_get_property */
1013mig_internal novalue _Xio_registry_entry_get_property
1014 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
1015{
1016
1017#ifdef __MigPackStructs
1018#pragma pack(4)
1019#endif
1020 typedef struct {
1021 mach_msg_header_t Head;
1022 NDR_record_t NDR;
1023 mach_msg_type_number_t property_nameOffset; /* MiG doesn't use it */
1024 mach_msg_type_number_t property_nameCnt;
1025 char property_name[128];
1026 mach_msg_trailer_t trailer;
1027 } Request __attribute__((unused));
1028#ifdef __MigPackStructs
1029#pragma pack()
1030#endif
1031 typedef __Request__io_registry_entry_get_property_t __Request;
1032 typedef __Reply__io_registry_entry_get_property_t Reply __attribute__((unused));
1033
1034 /*
1035 * typedef struct {
1036 * mach_msg_header_t Head;
1037 * NDR_record_t NDR;
1038 * kern_return_t RetCode;
1039 * } mig_reply_error_t;
1040 */
1041
1042 Request *In0P = (Request *) InHeadP;
1043 Reply *OutP = (Reply *) OutHeadP;
1044#ifdef __MIG_check__Request__io_registry_entry_get_property_t__defined
1045 kern_return_t check_result;
1046#endif /* __MIG_check__Request__io_registry_entry_get_property_t__defined */
1047
1048#if __MigKernelSpecificCode
1049#if UseStaticTemplates
1050 const static mach_msg_ool_descriptor_t propertiesTemplate = {
1051 /* addr = */ (void *)0,
1052 /* size = */ 0,
1053 /* deal = */ FALSE,
1054 /* copy = */ MACH_MSG_PHYSICAL_COPY,
1055 /* pad2 = */ 0,
1056 /* type = */ MACH_MSG_OOL_DESCRIPTOR,
1057 };
1058#endif /* UseStaticTemplates */
1059
1060#else
1061#if UseStaticTemplates
1062 const static mach_msg_ool_descriptor_t propertiesTemplate = {
1063 /* addr = */ (void *)0,
1064 /* size = */ 0,
1065 /* deal = */ FALSE,
1066 /* copy = */ MACH_MSG_PHYSICAL_COPY,
1067 /* pad2 = */ 0,
1068 /* type = */ MACH_MSG_OOL_DESCRIPTOR,
1069 };
1070#endif /* UseStaticTemplates */
1071
1072#endif /* __MigKernelSpecificCode */
1073 kern_return_t RetCode;
1074 io_object_t registry_entry;
1075
1076 __DeclareRcvRpc(2805, "io_registry_entry_get_property")
1077 __BeforeRcvRpc(2805, "io_registry_entry_get_property")
1078
1079#if defined(__MIG_check__Request__io_registry_entry_get_property_t__defined)
1080 check_result = __MIG_check__Request__io_registry_entry_get_property_t((__Request *)In0P);
1081 if (check_result != MACH_MSG_SUCCESS)
1082 { MIG_RETURN_ERROR(OutP, check_result); }
1083#endif /* defined(__MIG_check__Request__io_registry_entry_get_property_t__defined) */
1084
1085#if UseStaticTemplates
1086 OutP->properties = propertiesTemplate;
1087#else /* UseStaticTemplates */
1088 OutP->properties.deallocate = FALSE;
1089 OutP->properties.copy = MACH_MSG_PHYSICAL_COPY;
1090 OutP->properties.pad1 = 0;
1091 OutP->properties.type = MACH_MSG_OOL_DESCRIPTOR;
1092#if defined(KERNEL) && !defined(__LP64__)
1093 OutP->properties.pad_end = 0;
1094#endif
1095#endif /* UseStaticTemplates */
1096
1097
1098 registry_entry = iokit_lookup_object_port(In0P->Head.msgh_request_port);
1099
1100 RetCode = is_io_registry_entry_get_property(registry_entry, In0P->property_name, (io_buf_ptr_t *)&(OutP->properties.address), &OutP->propertiesCnt);
1101 iokit_remove_reference(registry_entry);
1102 if (RetCode != KERN_SUCCESS) {
1103 MIG_RETURN_ERROR(OutP, RetCode);
1104 }
1105#if __MigKernelSpecificCode
1106#endif /* __MigKernelSpecificCode */
1107 OutP->properties.size = OutP->propertiesCnt;
1108
1109
1110 OutP->NDR = NDR_record;
1111
1112
1113 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
1114 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
1115 OutP->msgh_body.msgh_descriptor_count = 1;
1116 __AfterRcvRpc(2805, "io_registry_entry_get_property")
1117}
1118
1119#if ( __MigTypeCheck )
1120#if __MIG_check__Request__iokit_subsystem__
1121#if !defined(__MIG_check__Request__io_registry_create_iterator_t__defined)
1122#define __MIG_check__Request__io_registry_create_iterator_t__defined
1123
1124mig_internal kern_return_t __MIG_check__Request__io_registry_create_iterator_t(__attribute__((__unused__)) __Request__io_registry_create_iterator_t *In0P, __attribute__((__unused__)) __Request__io_registry_create_iterator_t **In1PP)
1125{
1126
1127 typedef __Request__io_registry_create_iterator_t __Request;
1128 __Request *In1P;
1129#if __MigTypeCheck
1130 unsigned int msgh_size;
1131#endif /* __MigTypeCheck */
1132 unsigned int msgh_size_delta;
1133
1134#if __MigTypeCheck
1135 msgh_size = In0P->Head.msgh_size;
1136 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
1137 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 128)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
1138 return MIG_BAD_ARGUMENTS;
1139#endif /* __MigTypeCheck */
1140
1141#if defined(__NDR_convert__int_rep__Request__io_registry_create_iterator_t__planeCnt__defined)
1142 if (In0P->NDR.int_rep != NDR_record.int_rep)
1143 __NDR_convert__int_rep__Request__io_registry_create_iterator_t__planeCnt(&In0P->planeCnt, In0P->NDR.int_rep);
1144#endif /* __NDR_convert__int_rep__Request__io_registry_create_iterator_t__planeCnt__defined */
1145 msgh_size_delta = _WALIGN_(In0P->planeCnt);
1146#if __MigTypeCheck
1147 if ( In0P->planeCnt > 128 )
1148 return MIG_BAD_ARGUMENTS;
1149 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 128)) < In0P->planeCnt) ||
1150 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 128) + _WALIGN_(In0P->planeCnt)))
1151 return MIG_BAD_ARGUMENTS;
1152#endif /* __MigTypeCheck */
1153
1154 *In1PP = In1P = (__Request *) ((pointer_t) In0P + msgh_size_delta - 128);
1155
1156#if __MigTypeCheck
1157 {
1158 char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
1159#if __MigKernelSpecificCode
1160 size_t strnlen_limit;
1161#else
1162 size_t memchr_limit;
1163#endif /* __MigKernelSpecificCode */
1164
1165#if __MigKernelSpecificCode
1166 strnlen_limit = min((msg_limit - In0P->plane), 128);
1167 if (( strnlen(In0P->plane, strnlen_limit) >= 128 + 1 ))
1168 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
1169#else
1170 memchr_limit = min((msg_limit - In0P->plane), 128);
1171 if (( memchr(In0P->plane, '\0', memchr_limit) == NULL ))
1172 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
1173#endif /* __MigKernelSpecificCode */
1174 }
1175#endif /* __MigTypeCheck */
1176
1177 return MACH_MSG_SUCCESS;
1178}
1179#endif /* !defined(__MIG_check__Request__io_registry_create_iterator_t__defined) */
1180#endif /* __MIG_check__Request__iokit_subsystem__ */
1181#endif /* ( __MigTypeCheck ) */
1182
1183
1184/* Routine io_registry_create_iterator */
1185mig_internal novalue _Xio_registry_create_iterator
1186 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
1187{
1188
1189#ifdef __MigPackStructs
1190#pragma pack(4)
1191#endif
1192 typedef struct {
1193 mach_msg_header_t Head;
1194 NDR_record_t NDR;
1195 mach_msg_type_number_t planeOffset; /* MiG doesn't use it */
1196 mach_msg_type_number_t planeCnt;
1197 char plane[128];
1198 uint32_t options;
1199 mach_msg_trailer_t trailer;
1200 } Request __attribute__((unused));
1201#ifdef __MigPackStructs
1202#pragma pack()
1203#endif
1204 typedef __Request__io_registry_create_iterator_t __Request;
1205 typedef __Reply__io_registry_create_iterator_t Reply __attribute__((unused));
1206
1207 /*
1208 * typedef struct {
1209 * mach_msg_header_t Head;
1210 * NDR_record_t NDR;
1211 * kern_return_t RetCode;
1212 * } mig_reply_error_t;
1213 */
1214
1215 Request *In0P = (Request *) InHeadP;
1216 Request *In1P;
1217 Reply *OutP = (Reply *) OutHeadP;
1218#ifdef __MIG_check__Request__io_registry_create_iterator_t__defined
1219 kern_return_t check_result;
1220#endif /* __MIG_check__Request__io_registry_create_iterator_t__defined */
1221
1222#if __MigKernelSpecificCode
1223#if UseStaticTemplates
1224 const static mach_msg_port_descriptor_t iteratorTemplate = {
1225 /* name = */ MACH_PORT_NULL,
1226 /* pad1 = */ 0,
1227 /* pad2 = */ 0,
1228 /* disp = */ 17,
1229 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
1230 };
1231#endif /* UseStaticTemplates */
1232
1233#else
1234#if UseStaticTemplates
1235 const static mach_msg_port_descriptor_t iteratorTemplate = {
1236 /* name = */ MACH_PORT_NULL,
1237 /* pad1 = */ 0,
1238 /* pad2 = */ 0,
1239 /* disp = */ 19,
1240 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
1241 };
1242#endif /* UseStaticTemplates */
1243
1244#endif /* __MigKernelSpecificCode */
1245 kern_return_t RetCode;
1246 io_object_t iterator;
1247
1248 __DeclareRcvRpc(2806, "io_registry_create_iterator")
1249 __BeforeRcvRpc(2806, "io_registry_create_iterator")
1250
1251#if defined(__MIG_check__Request__io_registry_create_iterator_t__defined)
1252 check_result = __MIG_check__Request__io_registry_create_iterator_t((__Request *)In0P, (__Request **)&In1P);
1253 if (check_result != MACH_MSG_SUCCESS)
1254 { MIG_RETURN_ERROR(OutP, check_result); }
1255#endif /* defined(__MIG_check__Request__io_registry_create_iterator_t__defined) */
1256
1257#if UseStaticTemplates
1258 OutP->iterator = iteratorTemplate;
1259#else /* UseStaticTemplates */
1260#if __MigKernelSpecificCode
1261 OutP->iterator.disposition = 17;
1262#else
1263 OutP->iterator.disposition = 19;
1264#endif /* __MigKernelSpecificCode */
1265#if !(defined(KERNEL) && defined(__LP64__))
1266 OutP->iterator.pad1 = 0;
1267#endif
1268 OutP->iterator.pad2 = 0;
1269 OutP->iterator.type = MACH_MSG_PORT_DESCRIPTOR;
1270#if defined(KERNEL)
1271 OutP->iterator.pad_end = 0;
1272#endif
1273#endif /* UseStaticTemplates */
1274
1275
1276 RetCode = is_io_registry_create_iterator(In0P->Head.msgh_request_port, In0P->plane, In1P->options, &iterator);
1277 if (RetCode != KERN_SUCCESS) {
1278 MIG_RETURN_ERROR(OutP, RetCode);
1279 }
1280#if __MigKernelSpecificCode
1281#endif /* __MigKernelSpecificCode */
1282 OutP->iterator.name = (mach_port_t)iokit_make_object_port(iterator);
1283
1284
1285 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
1286 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
1287 OutP->msgh_body.msgh_descriptor_count = 1;
1288 __AfterRcvRpc(2806, "io_registry_create_iterator")
1289}
1290
1291#if ( __MigTypeCheck )
1292#if __MIG_check__Request__iokit_subsystem__
1293#if !defined(__MIG_check__Request__io_registry_iterator_enter_entry_t__defined)
1294#define __MIG_check__Request__io_registry_iterator_enter_entry_t__defined
1295
1296mig_internal kern_return_t __MIG_check__Request__io_registry_iterator_enter_entry_t(__attribute__((__unused__)) __Request__io_registry_iterator_enter_entry_t *In0P)
1297{
1298
1299 typedef __Request__io_registry_iterator_enter_entry_t __Request;
1300#if __MigTypeCheck
1301 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
1302 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
1303 return MIG_BAD_ARGUMENTS;
1304#endif /* __MigTypeCheck */
1305
1306 return MACH_MSG_SUCCESS;
1307}
1308#endif /* !defined(__MIG_check__Request__io_registry_iterator_enter_entry_t__defined) */
1309#endif /* __MIG_check__Request__iokit_subsystem__ */
1310#endif /* ( __MigTypeCheck ) */
1311
1312
1313/* Routine io_registry_iterator_enter_entry */
1314mig_internal novalue _Xio_registry_iterator_enter_entry
1315 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
1316{
1317
1318#ifdef __MigPackStructs
1319#pragma pack(4)
1320#endif
1321 typedef struct {
1322 mach_msg_header_t Head;
1323 mach_msg_trailer_t trailer;
1324 } Request __attribute__((unused));
1325#ifdef __MigPackStructs
1326#pragma pack()
1327#endif
1328 typedef __Request__io_registry_iterator_enter_entry_t __Request;
1329 typedef __Reply__io_registry_iterator_enter_entry_t Reply __attribute__((unused));
1330
1331 /*
1332 * typedef struct {
1333 * mach_msg_header_t Head;
1334 * NDR_record_t NDR;
1335 * kern_return_t RetCode;
1336 * } mig_reply_error_t;
1337 */
1338
1339 Request *In0P = (Request *) InHeadP;
1340 Reply *OutP = (Reply *) OutHeadP;
1341#ifdef __MIG_check__Request__io_registry_iterator_enter_entry_t__defined
1342 kern_return_t check_result;
1343#endif /* __MIG_check__Request__io_registry_iterator_enter_entry_t__defined */
1344
1345#if __MigKernelSpecificCode
1346#else
1347#endif /* __MigKernelSpecificCode */
1348 io_object_t iterator;
1349
1350 __DeclareRcvRpc(2807, "io_registry_iterator_enter_entry")
1351 __BeforeRcvRpc(2807, "io_registry_iterator_enter_entry")
1352
1353#if defined(__MIG_check__Request__io_registry_iterator_enter_entry_t__defined)
1354 check_result = __MIG_check__Request__io_registry_iterator_enter_entry_t((__Request *)In0P);
1355 if (check_result != MACH_MSG_SUCCESS)
1356 { MIG_RETURN_ERROR(OutP, check_result); }
1357#endif /* defined(__MIG_check__Request__io_registry_iterator_enter_entry_t__defined) */
1358
1359 iterator = iokit_lookup_object_port(In0P->Head.msgh_request_port);
1360
1361 OutP->RetCode = is_io_registry_iterator_enter_entry(iterator);
1362 iokit_remove_reference(iterator);
1363#if __MigKernelSpecificCode
1364#endif /* __MigKernelSpecificCode */
1365
1366 OutP->NDR = NDR_record;
1367
1368
1369 __AfterRcvRpc(2807, "io_registry_iterator_enter_entry")
1370}
1371
1372#if ( __MigTypeCheck )
1373#if __MIG_check__Request__iokit_subsystem__
1374#if !defined(__MIG_check__Request__io_registry_iterator_exit_entry_t__defined)
1375#define __MIG_check__Request__io_registry_iterator_exit_entry_t__defined
1376
1377mig_internal kern_return_t __MIG_check__Request__io_registry_iterator_exit_entry_t(__attribute__((__unused__)) __Request__io_registry_iterator_exit_entry_t *In0P)
1378{
1379
1380 typedef __Request__io_registry_iterator_exit_entry_t __Request;
1381#if __MigTypeCheck
1382 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
1383 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
1384 return MIG_BAD_ARGUMENTS;
1385#endif /* __MigTypeCheck */
1386
1387 return MACH_MSG_SUCCESS;
1388}
1389#endif /* !defined(__MIG_check__Request__io_registry_iterator_exit_entry_t__defined) */
1390#endif /* __MIG_check__Request__iokit_subsystem__ */
1391#endif /* ( __MigTypeCheck ) */
1392
1393
1394/* Routine io_registry_iterator_exit_entry */
1395mig_internal novalue _Xio_registry_iterator_exit_entry
1396 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
1397{
1398
1399#ifdef __MigPackStructs
1400#pragma pack(4)
1401#endif
1402 typedef struct {
1403 mach_msg_header_t Head;
1404 mach_msg_trailer_t trailer;
1405 } Request __attribute__((unused));
1406#ifdef __MigPackStructs
1407#pragma pack()
1408#endif
1409 typedef __Request__io_registry_iterator_exit_entry_t __Request;
1410 typedef __Reply__io_registry_iterator_exit_entry_t Reply __attribute__((unused));
1411
1412 /*
1413 * typedef struct {
1414 * mach_msg_header_t Head;
1415 * NDR_record_t NDR;
1416 * kern_return_t RetCode;
1417 * } mig_reply_error_t;
1418 */
1419
1420 Request *In0P = (Request *) InHeadP;
1421 Reply *OutP = (Reply *) OutHeadP;
1422#ifdef __MIG_check__Request__io_registry_iterator_exit_entry_t__defined
1423 kern_return_t check_result;
1424#endif /* __MIG_check__Request__io_registry_iterator_exit_entry_t__defined */
1425
1426#if __MigKernelSpecificCode
1427#else
1428#endif /* __MigKernelSpecificCode */
1429 io_object_t iterator;
1430
1431 __DeclareRcvRpc(2808, "io_registry_iterator_exit_entry")
1432 __BeforeRcvRpc(2808, "io_registry_iterator_exit_entry")
1433
1434#if defined(__MIG_check__Request__io_registry_iterator_exit_entry_t__defined)
1435 check_result = __MIG_check__Request__io_registry_iterator_exit_entry_t((__Request *)In0P);
1436 if (check_result != MACH_MSG_SUCCESS)
1437 { MIG_RETURN_ERROR(OutP, check_result); }
1438#endif /* defined(__MIG_check__Request__io_registry_iterator_exit_entry_t__defined) */
1439
1440 iterator = iokit_lookup_object_port(In0P->Head.msgh_request_port);
1441
1442 OutP->RetCode = is_io_registry_iterator_exit_entry(iterator);
1443 iokit_remove_reference(iterator);
1444#if __MigKernelSpecificCode
1445#endif /* __MigKernelSpecificCode */
1446
1447 OutP->NDR = NDR_record;
1448
1449
1450 __AfterRcvRpc(2808, "io_registry_iterator_exit_entry")
1451}
1452
1453#if ( __MigTypeCheck )
1454#if __MIG_check__Request__iokit_subsystem__
1455#if !defined(__MIG_check__Request__io_registry_entry_from_path_t__defined)
1456#define __MIG_check__Request__io_registry_entry_from_path_t__defined
1457
1458mig_internal kern_return_t __MIG_check__Request__io_registry_entry_from_path_t(__attribute__((__unused__)) __Request__io_registry_entry_from_path_t *In0P)
1459{
1460
1461 typedef __Request__io_registry_entry_from_path_t __Request;
1462#if __MigTypeCheck
1463 unsigned int msgh_size;
1464#endif /* __MigTypeCheck */
1465
1466#if __MigTypeCheck
1467 msgh_size = In0P->Head.msgh_size;
1468 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
1469 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 512)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
1470 return MIG_BAD_ARGUMENTS;
1471#endif /* __MigTypeCheck */
1472
1473#if defined(__NDR_convert__int_rep__Request__io_registry_entry_from_path_t__pathCnt__defined)
1474 if (In0P->NDR.int_rep != NDR_record.int_rep)
1475 __NDR_convert__int_rep__Request__io_registry_entry_from_path_t__pathCnt(&In0P->pathCnt, In0P->NDR.int_rep);
1476#endif /* __NDR_convert__int_rep__Request__io_registry_entry_from_path_t__pathCnt__defined */
1477#if __MigTypeCheck
1478 if ( In0P->pathCnt > 512 )
1479 return MIG_BAD_ARGUMENTS;
1480 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 512)) < In0P->pathCnt) ||
1481 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 512) + _WALIGN_(In0P->pathCnt)))
1482 return MIG_BAD_ARGUMENTS;
1483#endif /* __MigTypeCheck */
1484
1485#if __MigTypeCheck
1486 {
1487 char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
1488#if __MigKernelSpecificCode
1489 size_t strnlen_limit;
1490#else
1491 size_t memchr_limit;
1492#endif /* __MigKernelSpecificCode */
1493
1494#if __MigKernelSpecificCode
1495 strnlen_limit = min((msg_limit - In0P->path), 512);
1496 if (( strnlen(In0P->path, strnlen_limit) >= 512 + 1 ))
1497 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
1498#else
1499 memchr_limit = min((msg_limit - In0P->path), 512);
1500 if (( memchr(In0P->path, '\0', memchr_limit) == NULL ))
1501 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
1502#endif /* __MigKernelSpecificCode */
1503 }
1504#endif /* __MigTypeCheck */
1505
1506 return MACH_MSG_SUCCESS;
1507}
1508#endif /* !defined(__MIG_check__Request__io_registry_entry_from_path_t__defined) */
1509#endif /* __MIG_check__Request__iokit_subsystem__ */
1510#endif /* ( __MigTypeCheck ) */
1511
1512
1513/* Routine io_registry_entry_from_path */
1514mig_internal novalue _Xio_registry_entry_from_path
1515 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
1516{
1517
1518#ifdef __MigPackStructs
1519#pragma pack(4)
1520#endif
1521 typedef struct {
1522 mach_msg_header_t Head;
1523 NDR_record_t NDR;
1524 mach_msg_type_number_t pathOffset; /* MiG doesn't use it */
1525 mach_msg_type_number_t pathCnt;
1526 char path[512];
1527 mach_msg_trailer_t trailer;
1528 } Request __attribute__((unused));
1529#ifdef __MigPackStructs
1530#pragma pack()
1531#endif
1532 typedef __Request__io_registry_entry_from_path_t __Request;
1533 typedef __Reply__io_registry_entry_from_path_t Reply __attribute__((unused));
1534
1535 /*
1536 * typedef struct {
1537 * mach_msg_header_t Head;
1538 * NDR_record_t NDR;
1539 * kern_return_t RetCode;
1540 * } mig_reply_error_t;
1541 */
1542
1543 Request *In0P = (Request *) InHeadP;
1544 Reply *OutP = (Reply *) OutHeadP;
1545#ifdef __MIG_check__Request__io_registry_entry_from_path_t__defined
1546 kern_return_t check_result;
1547#endif /* __MIG_check__Request__io_registry_entry_from_path_t__defined */
1548
1549#if __MigKernelSpecificCode
1550#if UseStaticTemplates
1551 const static mach_msg_port_descriptor_t registry_entryTemplate = {
1552 /* name = */ MACH_PORT_NULL,
1553 /* pad1 = */ 0,
1554 /* pad2 = */ 0,
1555 /* disp = */ 17,
1556 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
1557 };
1558#endif /* UseStaticTemplates */
1559
1560#else
1561#if UseStaticTemplates
1562 const static mach_msg_port_descriptor_t registry_entryTemplate = {
1563 /* name = */ MACH_PORT_NULL,
1564 /* pad1 = */ 0,
1565 /* pad2 = */ 0,
1566 /* disp = */ 19,
1567 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
1568 };
1569#endif /* UseStaticTemplates */
1570
1571#endif /* __MigKernelSpecificCode */
1572 kern_return_t RetCode;
1573 io_object_t registry_entry;
1574
1575 __DeclareRcvRpc(2809, "io_registry_entry_from_path")
1576 __BeforeRcvRpc(2809, "io_registry_entry_from_path")
1577
1578#if defined(__MIG_check__Request__io_registry_entry_from_path_t__defined)
1579 check_result = __MIG_check__Request__io_registry_entry_from_path_t((__Request *)In0P);
1580 if (check_result != MACH_MSG_SUCCESS)
1581 { MIG_RETURN_ERROR(OutP, check_result); }
1582#endif /* defined(__MIG_check__Request__io_registry_entry_from_path_t__defined) */
1583
1584#if UseStaticTemplates
1585 OutP->registry_entry = registry_entryTemplate;
1586#else /* UseStaticTemplates */
1587#if __MigKernelSpecificCode
1588 OutP->registry_entry.disposition = 17;
1589#else
1590 OutP->registry_entry.disposition = 19;
1591#endif /* __MigKernelSpecificCode */
1592#if !(defined(KERNEL) && defined(__LP64__))
1593 OutP->registry_entry.pad1 = 0;
1594#endif
1595 OutP->registry_entry.pad2 = 0;
1596 OutP->registry_entry.type = MACH_MSG_PORT_DESCRIPTOR;
1597#if defined(KERNEL)
1598 OutP->registry_entry.pad_end = 0;
1599#endif
1600#endif /* UseStaticTemplates */
1601
1602
1603 RetCode = is_io_registry_entry_from_path(In0P->Head.msgh_request_port, In0P->path, &registry_entry);
1604 if (RetCode != KERN_SUCCESS) {
1605 MIG_RETURN_ERROR(OutP, RetCode);
1606 }
1607#if __MigKernelSpecificCode
1608#endif /* __MigKernelSpecificCode */
1609 OutP->registry_entry.name = (mach_port_t)iokit_make_object_port(registry_entry);
1610
1611
1612 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
1613 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
1614 OutP->msgh_body.msgh_descriptor_count = 1;
1615 __AfterRcvRpc(2809, "io_registry_entry_from_path")
1616}
1617
1618#if ( __MigTypeCheck )
1619#if __MIG_check__Request__iokit_subsystem__
1620#if !defined(__MIG_check__Request__io_registry_entry_get_name_t__defined)
1621#define __MIG_check__Request__io_registry_entry_get_name_t__defined
1622
1623mig_internal kern_return_t __MIG_check__Request__io_registry_entry_get_name_t(__attribute__((__unused__)) __Request__io_registry_entry_get_name_t *In0P)
1624{
1625
1626 typedef __Request__io_registry_entry_get_name_t __Request;
1627#if __MigTypeCheck
1628 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
1629 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
1630 return MIG_BAD_ARGUMENTS;
1631#endif /* __MigTypeCheck */
1632
1633 return MACH_MSG_SUCCESS;
1634}
1635#endif /* !defined(__MIG_check__Request__io_registry_entry_get_name_t__defined) */
1636#endif /* __MIG_check__Request__iokit_subsystem__ */
1637#endif /* ( __MigTypeCheck ) */
1638
1639
1640/* Routine io_registry_entry_get_name */
1641mig_internal novalue _Xio_registry_entry_get_name
1642 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
1643{
1644
1645#ifdef __MigPackStructs
1646#pragma pack(4)
1647#endif
1648 typedef struct {
1649 mach_msg_header_t Head;
1650 mach_msg_trailer_t trailer;
1651 } Request __attribute__((unused));
1652#ifdef __MigPackStructs
1653#pragma pack()
1654#endif
1655 typedef __Request__io_registry_entry_get_name_t __Request;
1656 typedef __Reply__io_registry_entry_get_name_t Reply __attribute__((unused));
1657
1658 /*
1659 * typedef struct {
1660 * mach_msg_header_t Head;
1661 * NDR_record_t NDR;
1662 * kern_return_t RetCode;
1663 * } mig_reply_error_t;
1664 */
1665
1666 Request *In0P = (Request *) InHeadP;
1667 Reply *OutP = (Reply *) OutHeadP;
1668#ifdef __MIG_check__Request__io_registry_entry_get_name_t__defined
1669 kern_return_t check_result;
1670#endif /* __MIG_check__Request__io_registry_entry_get_name_t__defined */
1671
1672#if __MigKernelSpecificCode
1673#else
1674#endif /* __MigKernelSpecificCode */
1675 io_object_t registry_entry;
1676
1677 __DeclareRcvRpc(2810, "io_registry_entry_get_name")
1678 __BeforeRcvRpc(2810, "io_registry_entry_get_name")
1679
1680#if defined(__MIG_check__Request__io_registry_entry_get_name_t__defined)
1681 check_result = __MIG_check__Request__io_registry_entry_get_name_t((__Request *)In0P);
1682 if (check_result != MACH_MSG_SUCCESS)
1683 { MIG_RETURN_ERROR(OutP, check_result); }
1684#endif /* defined(__MIG_check__Request__io_registry_entry_get_name_t__defined) */
1685
1686 registry_entry = iokit_lookup_object_port(In0P->Head.msgh_request_port);
1687
1688 OutP->RetCode = is_io_registry_entry_get_name(registry_entry, OutP->name);
1689 iokit_remove_reference(registry_entry);
1690 if (OutP->RetCode != KERN_SUCCESS) {
1691 MIG_RETURN_ERROR(OutP, OutP->RetCode);
1692 }
1693#if __MigKernelSpecificCode
1694#endif /* __MigKernelSpecificCode */
1695
1696 OutP->NDR = NDR_record;
1697
1698#ifdef __LP64__
1699 {
1700 size_t strLength = strlen(OutP->name) + 1;
1701 if (strLength > 0xffffffff)
1702 MIG_RETURN_ERROR(OutP, MIG_BAD_ARGUMENTS);
1703 OutP->nameCnt = (mach_msg_type_number_t) strLength;
1704 }
1705#else
1706 OutP->nameCnt = (mach_msg_type_number_t) strlen(OutP->name) + 1;
1707#endif /* __LP64__ */
1708 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 128) + (_WALIGN_((OutP->nameCnt + 3) & ~3));
1709
1710 __AfterRcvRpc(2810, "io_registry_entry_get_name")
1711}
1712
1713#if ( __MigTypeCheck )
1714#if __MIG_check__Request__iokit_subsystem__
1715#if !defined(__MIG_check__Request__io_registry_entry_get_properties_t__defined)
1716#define __MIG_check__Request__io_registry_entry_get_properties_t__defined
1717
1718mig_internal kern_return_t __MIG_check__Request__io_registry_entry_get_properties_t(__attribute__((__unused__)) __Request__io_registry_entry_get_properties_t *In0P)
1719{
1720
1721 typedef __Request__io_registry_entry_get_properties_t __Request;
1722#if __MigTypeCheck
1723 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
1724 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
1725 return MIG_BAD_ARGUMENTS;
1726#endif /* __MigTypeCheck */
1727
1728 return MACH_MSG_SUCCESS;
1729}
1730#endif /* !defined(__MIG_check__Request__io_registry_entry_get_properties_t__defined) */
1731#endif /* __MIG_check__Request__iokit_subsystem__ */
1732#endif /* ( __MigTypeCheck ) */
1733
1734
1735/* Routine io_registry_entry_get_properties */
1736mig_internal novalue _Xio_registry_entry_get_properties
1737 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
1738{
1739
1740#ifdef __MigPackStructs
1741#pragma pack(4)
1742#endif
1743 typedef struct {
1744 mach_msg_header_t Head;
1745 mach_msg_trailer_t trailer;
1746 } Request __attribute__((unused));
1747#ifdef __MigPackStructs
1748#pragma pack()
1749#endif
1750 typedef __Request__io_registry_entry_get_properties_t __Request;
1751 typedef __Reply__io_registry_entry_get_properties_t Reply __attribute__((unused));
1752
1753 /*
1754 * typedef struct {
1755 * mach_msg_header_t Head;
1756 * NDR_record_t NDR;
1757 * kern_return_t RetCode;
1758 * } mig_reply_error_t;
1759 */
1760
1761 Request *In0P = (Request *) InHeadP;
1762 Reply *OutP = (Reply *) OutHeadP;
1763#ifdef __MIG_check__Request__io_registry_entry_get_properties_t__defined
1764 kern_return_t check_result;
1765#endif /* __MIG_check__Request__io_registry_entry_get_properties_t__defined */
1766
1767#if __MigKernelSpecificCode
1768#if UseStaticTemplates
1769 const static mach_msg_ool_descriptor_t propertiesTemplate = {
1770 /* addr = */ (void *)0,
1771 /* size = */ 0,
1772 /* deal = */ FALSE,
1773 /* copy = */ MACH_MSG_PHYSICAL_COPY,
1774 /* pad2 = */ 0,
1775 /* type = */ MACH_MSG_OOL_DESCRIPTOR,
1776 };
1777#endif /* UseStaticTemplates */
1778
1779#else
1780#if UseStaticTemplates
1781 const static mach_msg_ool_descriptor_t propertiesTemplate = {
1782 /* addr = */ (void *)0,
1783 /* size = */ 0,
1784 /* deal = */ FALSE,
1785 /* copy = */ MACH_MSG_PHYSICAL_COPY,
1786 /* pad2 = */ 0,
1787 /* type = */ MACH_MSG_OOL_DESCRIPTOR,
1788 };
1789#endif /* UseStaticTemplates */
1790
1791#endif /* __MigKernelSpecificCode */
1792 kern_return_t RetCode;
1793 io_object_t registry_entry;
1794
1795 __DeclareRcvRpc(2811, "io_registry_entry_get_properties")
1796 __BeforeRcvRpc(2811, "io_registry_entry_get_properties")
1797
1798#if defined(__MIG_check__Request__io_registry_entry_get_properties_t__defined)
1799 check_result = __MIG_check__Request__io_registry_entry_get_properties_t((__Request *)In0P);
1800 if (check_result != MACH_MSG_SUCCESS)
1801 { MIG_RETURN_ERROR(OutP, check_result); }
1802#endif /* defined(__MIG_check__Request__io_registry_entry_get_properties_t__defined) */
1803
1804#if UseStaticTemplates
1805 OutP->properties = propertiesTemplate;
1806#else /* UseStaticTemplates */
1807 OutP->properties.deallocate = FALSE;
1808 OutP->properties.copy = MACH_MSG_PHYSICAL_COPY;
1809 OutP->properties.pad1 = 0;
1810 OutP->properties.type = MACH_MSG_OOL_DESCRIPTOR;
1811#if defined(KERNEL) && !defined(__LP64__)
1812 OutP->properties.pad_end = 0;
1813#endif
1814#endif /* UseStaticTemplates */
1815
1816
1817 registry_entry = iokit_lookup_object_port(In0P->Head.msgh_request_port);
1818
1819 RetCode = is_io_registry_entry_get_properties(registry_entry, (io_buf_ptr_t *)&(OutP->properties.address), &OutP->propertiesCnt);
1820 iokit_remove_reference(registry_entry);
1821 if (RetCode != KERN_SUCCESS) {
1822 MIG_RETURN_ERROR(OutP, RetCode);
1823 }
1824#if __MigKernelSpecificCode
1825#endif /* __MigKernelSpecificCode */
1826 OutP->properties.size = OutP->propertiesCnt;
1827
1828
1829 OutP->NDR = NDR_record;
1830
1831
1832 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
1833 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
1834 OutP->msgh_body.msgh_descriptor_count = 1;
1835 __AfterRcvRpc(2811, "io_registry_entry_get_properties")
1836}
1837
1838#if ( __MigTypeCheck )
1839#if __MIG_check__Request__iokit_subsystem__
1840#if !defined(__MIG_check__Request__io_registry_entry_get_property_bytes_t__defined)
1841#define __MIG_check__Request__io_registry_entry_get_property_bytes_t__defined
1842
1843mig_internal kern_return_t __MIG_check__Request__io_registry_entry_get_property_bytes_t(__attribute__((__unused__)) __Request__io_registry_entry_get_property_bytes_t *In0P, __attribute__((__unused__)) __Request__io_registry_entry_get_property_bytes_t **In1PP)
1844{
1845
1846 typedef __Request__io_registry_entry_get_property_bytes_t __Request;
1847 __Request *In1P;
1848#if __MigTypeCheck
1849 unsigned int msgh_size;
1850#endif /* __MigTypeCheck */
1851 unsigned int msgh_size_delta;
1852
1853#if __MigTypeCheck
1854 msgh_size = In0P->Head.msgh_size;
1855 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
1856 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 128)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
1857 return MIG_BAD_ARGUMENTS;
1858#endif /* __MigTypeCheck */
1859
1860#if defined(__NDR_convert__int_rep__Request__io_registry_entry_get_property_bytes_t__property_nameCnt__defined)
1861 if (In0P->NDR.int_rep != NDR_record.int_rep)
1862 __NDR_convert__int_rep__Request__io_registry_entry_get_property_bytes_t__property_nameCnt(&In0P->property_nameCnt, In0P->NDR.int_rep);
1863#endif /* __NDR_convert__int_rep__Request__io_registry_entry_get_property_bytes_t__property_nameCnt__defined */
1864 msgh_size_delta = _WALIGN_(In0P->property_nameCnt);
1865#if __MigTypeCheck
1866 if ( In0P->property_nameCnt > 128 )
1867 return MIG_BAD_ARGUMENTS;
1868 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 128)) < In0P->property_nameCnt) ||
1869 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 128) + _WALIGN_(In0P->property_nameCnt)))
1870 return MIG_BAD_ARGUMENTS;
1871#endif /* __MigTypeCheck */
1872
1873 *In1PP = In1P = (__Request *) ((pointer_t) In0P + msgh_size_delta - 128);
1874
1875#if __MigTypeCheck
1876 {
1877 char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
1878#if __MigKernelSpecificCode
1879 size_t strnlen_limit;
1880#else
1881 size_t memchr_limit;
1882#endif /* __MigKernelSpecificCode */
1883
1884#if __MigKernelSpecificCode
1885 strnlen_limit = min((msg_limit - In0P->property_name), 128);
1886 if (( strnlen(In0P->property_name, strnlen_limit) >= 128 + 1 ))
1887 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
1888#else
1889 memchr_limit = min((msg_limit - In0P->property_name), 128);
1890 if (( memchr(In0P->property_name, '\0', memchr_limit) == NULL ))
1891 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
1892#endif /* __MigKernelSpecificCode */
1893 }
1894#endif /* __MigTypeCheck */
1895
1896 return MACH_MSG_SUCCESS;
1897}
1898#endif /* !defined(__MIG_check__Request__io_registry_entry_get_property_bytes_t__defined) */
1899#endif /* __MIG_check__Request__iokit_subsystem__ */
1900#endif /* ( __MigTypeCheck ) */
1901
1902
1903/* Routine io_registry_entry_get_property_bytes */
1904mig_internal novalue _Xio_registry_entry_get_property_bytes
1905 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
1906{
1907
1908#ifdef __MigPackStructs
1909#pragma pack(4)
1910#endif
1911 typedef struct {
1912 mach_msg_header_t Head;
1913 NDR_record_t NDR;
1914 mach_msg_type_number_t property_nameOffset; /* MiG doesn't use it */
1915 mach_msg_type_number_t property_nameCnt;
1916 char property_name[128];
1917 mach_msg_type_number_t dataCnt;
1918 mach_msg_trailer_t trailer;
1919 } Request __attribute__((unused));
1920#ifdef __MigPackStructs
1921#pragma pack()
1922#endif
1923 typedef __Request__io_registry_entry_get_property_bytes_t __Request;
1924 typedef __Reply__io_registry_entry_get_property_bytes_t Reply __attribute__((unused));
1925
1926 /*
1927 * typedef struct {
1928 * mach_msg_header_t Head;
1929 * NDR_record_t NDR;
1930 * kern_return_t RetCode;
1931 * } mig_reply_error_t;
1932 */
1933
1934 Request *In0P = (Request *) InHeadP;
1935 Request *In1P;
1936 Reply *OutP = (Reply *) OutHeadP;
1937#ifdef __MIG_check__Request__io_registry_entry_get_property_bytes_t__defined
1938 kern_return_t check_result;
1939#endif /* __MIG_check__Request__io_registry_entry_get_property_bytes_t__defined */
1940
1941#if __MigKernelSpecificCode
1942#else
1943#endif /* __MigKernelSpecificCode */
1944 io_object_t registry_entry;
1945
1946 __DeclareRcvRpc(2812, "io_registry_entry_get_property_bytes")
1947 __BeforeRcvRpc(2812, "io_registry_entry_get_property_bytes")
1948
1949#if defined(__MIG_check__Request__io_registry_entry_get_property_bytes_t__defined)
1950 check_result = __MIG_check__Request__io_registry_entry_get_property_bytes_t((__Request *)In0P, (__Request **)&In1P);
1951 if (check_result != MACH_MSG_SUCCESS)
1952 { MIG_RETURN_ERROR(OutP, check_result); }
1953#endif /* defined(__MIG_check__Request__io_registry_entry_get_property_bytes_t__defined) */
1954
1955 registry_entry = iokit_lookup_object_port(In0P->Head.msgh_request_port);
1956
1957 OutP->dataCnt = 4096;
1958 if (In1P->dataCnt < OutP->dataCnt)
1959 OutP->dataCnt = In1P->dataCnt;
1960
1961 OutP->RetCode = is_io_registry_entry_get_property_bytes(registry_entry, In0P->property_name, OutP->data, &OutP->dataCnt);
1962 iokit_remove_reference(registry_entry);
1963 if (OutP->RetCode != KERN_SUCCESS) {
1964 MIG_RETURN_ERROR(OutP, OutP->RetCode);
1965 }
1966#if __MigKernelSpecificCode
1967#endif /* __MigKernelSpecificCode */
1968
1969 OutP->NDR = NDR_record;
1970
1971 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 4096) + (_WALIGN_((OutP->dataCnt + 3) & ~3));
1972
1973 __AfterRcvRpc(2812, "io_registry_entry_get_property_bytes")
1974}
1975
1976#if ( __MigTypeCheck )
1977#if __MIG_check__Request__iokit_subsystem__
1978#if !defined(__MIG_check__Request__io_registry_entry_get_child_iterator_t__defined)
1979#define __MIG_check__Request__io_registry_entry_get_child_iterator_t__defined
1980
1981mig_internal kern_return_t __MIG_check__Request__io_registry_entry_get_child_iterator_t(__attribute__((__unused__)) __Request__io_registry_entry_get_child_iterator_t *In0P)
1982{
1983
1984 typedef __Request__io_registry_entry_get_child_iterator_t __Request;
1985#if __MigTypeCheck
1986 unsigned int msgh_size;
1987#endif /* __MigTypeCheck */
1988
1989#if __MigTypeCheck
1990 msgh_size = In0P->Head.msgh_size;
1991 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
1992 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 128)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
1993 return MIG_BAD_ARGUMENTS;
1994#endif /* __MigTypeCheck */
1995
1996#if defined(__NDR_convert__int_rep__Request__io_registry_entry_get_child_iterator_t__planeCnt__defined)
1997 if (In0P->NDR.int_rep != NDR_record.int_rep)
1998 __NDR_convert__int_rep__Request__io_registry_entry_get_child_iterator_t__planeCnt(&In0P->planeCnt, In0P->NDR.int_rep);
1999#endif /* __NDR_convert__int_rep__Request__io_registry_entry_get_child_iterator_t__planeCnt__defined */
2000#if __MigTypeCheck
2001 if ( In0P->planeCnt > 128 )
2002 return MIG_BAD_ARGUMENTS;
2003 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 128)) < In0P->planeCnt) ||
2004 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 128) + _WALIGN_(In0P->planeCnt)))
2005 return MIG_BAD_ARGUMENTS;
2006#endif /* __MigTypeCheck */
2007
2008#if __MigTypeCheck
2009 {
2010 char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
2011#if __MigKernelSpecificCode
2012 size_t strnlen_limit;
2013#else
2014 size_t memchr_limit;
2015#endif /* __MigKernelSpecificCode */
2016
2017#if __MigKernelSpecificCode
2018 strnlen_limit = min((msg_limit - In0P->plane), 128);
2019 if (( strnlen(In0P->plane, strnlen_limit) >= 128 + 1 ))
2020 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
2021#else
2022 memchr_limit = min((msg_limit - In0P->plane), 128);
2023 if (( memchr(In0P->plane, '\0', memchr_limit) == NULL ))
2024 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
2025#endif /* __MigKernelSpecificCode */
2026 }
2027#endif /* __MigTypeCheck */
2028
2029 return MACH_MSG_SUCCESS;
2030}
2031#endif /* !defined(__MIG_check__Request__io_registry_entry_get_child_iterator_t__defined) */
2032#endif /* __MIG_check__Request__iokit_subsystem__ */
2033#endif /* ( __MigTypeCheck ) */
2034
2035
2036/* Routine io_registry_entry_get_child_iterator */
2037mig_internal novalue _Xio_registry_entry_get_child_iterator
2038 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
2039{
2040
2041#ifdef __MigPackStructs
2042#pragma pack(4)
2043#endif
2044 typedef struct {
2045 mach_msg_header_t Head;
2046 NDR_record_t NDR;
2047 mach_msg_type_number_t planeOffset; /* MiG doesn't use it */
2048 mach_msg_type_number_t planeCnt;
2049 char plane[128];
2050 mach_msg_trailer_t trailer;
2051 } Request __attribute__((unused));
2052#ifdef __MigPackStructs
2053#pragma pack()
2054#endif
2055 typedef __Request__io_registry_entry_get_child_iterator_t __Request;
2056 typedef __Reply__io_registry_entry_get_child_iterator_t Reply __attribute__((unused));
2057
2058 /*
2059 * typedef struct {
2060 * mach_msg_header_t Head;
2061 * NDR_record_t NDR;
2062 * kern_return_t RetCode;
2063 * } mig_reply_error_t;
2064 */
2065
2066 Request *In0P = (Request *) InHeadP;
2067 Reply *OutP = (Reply *) OutHeadP;
2068#ifdef __MIG_check__Request__io_registry_entry_get_child_iterator_t__defined
2069 kern_return_t check_result;
2070#endif /* __MIG_check__Request__io_registry_entry_get_child_iterator_t__defined */
2071
2072#if __MigKernelSpecificCode
2073#if UseStaticTemplates
2074 const static mach_msg_port_descriptor_t iteratorTemplate = {
2075 /* name = */ MACH_PORT_NULL,
2076 /* pad1 = */ 0,
2077 /* pad2 = */ 0,
2078 /* disp = */ 17,
2079 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
2080 };
2081#endif /* UseStaticTemplates */
2082
2083#else
2084#if UseStaticTemplates
2085 const static mach_msg_port_descriptor_t iteratorTemplate = {
2086 /* name = */ MACH_PORT_NULL,
2087 /* pad1 = */ 0,
2088 /* pad2 = */ 0,
2089 /* disp = */ 19,
2090 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
2091 };
2092#endif /* UseStaticTemplates */
2093
2094#endif /* __MigKernelSpecificCode */
2095 kern_return_t RetCode;
2096 io_object_t registry_entry;
2097 io_object_t iterator;
2098
2099 __DeclareRcvRpc(2813, "io_registry_entry_get_child_iterator")
2100 __BeforeRcvRpc(2813, "io_registry_entry_get_child_iterator")
2101
2102#if defined(__MIG_check__Request__io_registry_entry_get_child_iterator_t__defined)
2103 check_result = __MIG_check__Request__io_registry_entry_get_child_iterator_t((__Request *)In0P);
2104 if (check_result != MACH_MSG_SUCCESS)
2105 { MIG_RETURN_ERROR(OutP, check_result); }
2106#endif /* defined(__MIG_check__Request__io_registry_entry_get_child_iterator_t__defined) */
2107
2108#if UseStaticTemplates
2109 OutP->iterator = iteratorTemplate;
2110#else /* UseStaticTemplates */
2111#if __MigKernelSpecificCode
2112 OutP->iterator.disposition = 17;
2113#else
2114 OutP->iterator.disposition = 19;
2115#endif /* __MigKernelSpecificCode */
2116#if !(defined(KERNEL) && defined(__LP64__))
2117 OutP->iterator.pad1 = 0;
2118#endif
2119 OutP->iterator.pad2 = 0;
2120 OutP->iterator.type = MACH_MSG_PORT_DESCRIPTOR;
2121#if defined(KERNEL)
2122 OutP->iterator.pad_end = 0;
2123#endif
2124#endif /* UseStaticTemplates */
2125
2126
2127 registry_entry = iokit_lookup_object_port(In0P->Head.msgh_request_port);
2128
2129 RetCode = is_io_registry_entry_get_child_iterator(registry_entry, In0P->plane, &iterator);
2130 iokit_remove_reference(registry_entry);
2131 if (RetCode != KERN_SUCCESS) {
2132 MIG_RETURN_ERROR(OutP, RetCode);
2133 }
2134#if __MigKernelSpecificCode
2135#endif /* __MigKernelSpecificCode */
2136 OutP->iterator.name = (mach_port_t)iokit_make_object_port(iterator);
2137
2138
2139 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
2140 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
2141 OutP->msgh_body.msgh_descriptor_count = 1;
2142 __AfterRcvRpc(2813, "io_registry_entry_get_child_iterator")
2143}
2144
2145#if ( __MigTypeCheck )
2146#if __MIG_check__Request__iokit_subsystem__
2147#if !defined(__MIG_check__Request__io_registry_entry_get_parent_iterator_t__defined)
2148#define __MIG_check__Request__io_registry_entry_get_parent_iterator_t__defined
2149
2150mig_internal kern_return_t __MIG_check__Request__io_registry_entry_get_parent_iterator_t(__attribute__((__unused__)) __Request__io_registry_entry_get_parent_iterator_t *In0P)
2151{
2152
2153 typedef __Request__io_registry_entry_get_parent_iterator_t __Request;
2154#if __MigTypeCheck
2155 unsigned int msgh_size;
2156#endif /* __MigTypeCheck */
2157
2158#if __MigTypeCheck
2159 msgh_size = In0P->Head.msgh_size;
2160 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
2161 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 128)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
2162 return MIG_BAD_ARGUMENTS;
2163#endif /* __MigTypeCheck */
2164
2165#if defined(__NDR_convert__int_rep__Request__io_registry_entry_get_parent_iterator_t__planeCnt__defined)
2166 if (In0P->NDR.int_rep != NDR_record.int_rep)
2167 __NDR_convert__int_rep__Request__io_registry_entry_get_parent_iterator_t__planeCnt(&In0P->planeCnt, In0P->NDR.int_rep);
2168#endif /* __NDR_convert__int_rep__Request__io_registry_entry_get_parent_iterator_t__planeCnt__defined */
2169#if __MigTypeCheck
2170 if ( In0P->planeCnt > 128 )
2171 return MIG_BAD_ARGUMENTS;
2172 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 128)) < In0P->planeCnt) ||
2173 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 128) + _WALIGN_(In0P->planeCnt)))
2174 return MIG_BAD_ARGUMENTS;
2175#endif /* __MigTypeCheck */
2176
2177#if __MigTypeCheck
2178 {
2179 char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
2180#if __MigKernelSpecificCode
2181 size_t strnlen_limit;
2182#else
2183 size_t memchr_limit;
2184#endif /* __MigKernelSpecificCode */
2185
2186#if __MigKernelSpecificCode
2187 strnlen_limit = min((msg_limit - In0P->plane), 128);
2188 if (( strnlen(In0P->plane, strnlen_limit) >= 128 + 1 ))
2189 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
2190#else
2191 memchr_limit = min((msg_limit - In0P->plane), 128);
2192 if (( memchr(In0P->plane, '\0', memchr_limit) == NULL ))
2193 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
2194#endif /* __MigKernelSpecificCode */
2195 }
2196#endif /* __MigTypeCheck */
2197
2198 return MACH_MSG_SUCCESS;
2199}
2200#endif /* !defined(__MIG_check__Request__io_registry_entry_get_parent_iterator_t__defined) */
2201#endif /* __MIG_check__Request__iokit_subsystem__ */
2202#endif /* ( __MigTypeCheck ) */
2203
2204
2205/* Routine io_registry_entry_get_parent_iterator */
2206mig_internal novalue _Xio_registry_entry_get_parent_iterator
2207 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
2208{
2209
2210#ifdef __MigPackStructs
2211#pragma pack(4)
2212#endif
2213 typedef struct {
2214 mach_msg_header_t Head;
2215 NDR_record_t NDR;
2216 mach_msg_type_number_t planeOffset; /* MiG doesn't use it */
2217 mach_msg_type_number_t planeCnt;
2218 char plane[128];
2219 mach_msg_trailer_t trailer;
2220 } Request __attribute__((unused));
2221#ifdef __MigPackStructs
2222#pragma pack()
2223#endif
2224 typedef __Request__io_registry_entry_get_parent_iterator_t __Request;
2225 typedef __Reply__io_registry_entry_get_parent_iterator_t Reply __attribute__((unused));
2226
2227 /*
2228 * typedef struct {
2229 * mach_msg_header_t Head;
2230 * NDR_record_t NDR;
2231 * kern_return_t RetCode;
2232 * } mig_reply_error_t;
2233 */
2234
2235 Request *In0P = (Request *) InHeadP;
2236 Reply *OutP = (Reply *) OutHeadP;
2237#ifdef __MIG_check__Request__io_registry_entry_get_parent_iterator_t__defined
2238 kern_return_t check_result;
2239#endif /* __MIG_check__Request__io_registry_entry_get_parent_iterator_t__defined */
2240
2241#if __MigKernelSpecificCode
2242#if UseStaticTemplates
2243 const static mach_msg_port_descriptor_t iteratorTemplate = {
2244 /* name = */ MACH_PORT_NULL,
2245 /* pad1 = */ 0,
2246 /* pad2 = */ 0,
2247 /* disp = */ 17,
2248 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
2249 };
2250#endif /* UseStaticTemplates */
2251
2252#else
2253#if UseStaticTemplates
2254 const static mach_msg_port_descriptor_t iteratorTemplate = {
2255 /* name = */ MACH_PORT_NULL,
2256 /* pad1 = */ 0,
2257 /* pad2 = */ 0,
2258 /* disp = */ 19,
2259 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
2260 };
2261#endif /* UseStaticTemplates */
2262
2263#endif /* __MigKernelSpecificCode */
2264 kern_return_t RetCode;
2265 io_object_t registry_entry;
2266 io_object_t iterator;
2267
2268 __DeclareRcvRpc(2814, "io_registry_entry_get_parent_iterator")
2269 __BeforeRcvRpc(2814, "io_registry_entry_get_parent_iterator")
2270
2271#if defined(__MIG_check__Request__io_registry_entry_get_parent_iterator_t__defined)
2272 check_result = __MIG_check__Request__io_registry_entry_get_parent_iterator_t((__Request *)In0P);
2273 if (check_result != MACH_MSG_SUCCESS)
2274 { MIG_RETURN_ERROR(OutP, check_result); }
2275#endif /* defined(__MIG_check__Request__io_registry_entry_get_parent_iterator_t__defined) */
2276
2277#if UseStaticTemplates
2278 OutP->iterator = iteratorTemplate;
2279#else /* UseStaticTemplates */
2280#if __MigKernelSpecificCode
2281 OutP->iterator.disposition = 17;
2282#else
2283 OutP->iterator.disposition = 19;
2284#endif /* __MigKernelSpecificCode */
2285#if !(defined(KERNEL) && defined(__LP64__))
2286 OutP->iterator.pad1 = 0;
2287#endif
2288 OutP->iterator.pad2 = 0;
2289 OutP->iterator.type = MACH_MSG_PORT_DESCRIPTOR;
2290#if defined(KERNEL)
2291 OutP->iterator.pad_end = 0;
2292#endif
2293#endif /* UseStaticTemplates */
2294
2295
2296 registry_entry = iokit_lookup_object_port(In0P->Head.msgh_request_port);
2297
2298 RetCode = is_io_registry_entry_get_parent_iterator(registry_entry, In0P->plane, &iterator);
2299 iokit_remove_reference(registry_entry);
2300 if (RetCode != KERN_SUCCESS) {
2301 MIG_RETURN_ERROR(OutP, RetCode);
2302 }
2303#if __MigKernelSpecificCode
2304#endif /* __MigKernelSpecificCode */
2305 OutP->iterator.name = (mach_port_t)iokit_make_object_port(iterator);
2306
2307
2308 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
2309 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
2310 OutP->msgh_body.msgh_descriptor_count = 1;
2311 __AfterRcvRpc(2814, "io_registry_entry_get_parent_iterator")
2312}
2313
2314#if ( __MigTypeCheck )
2315#if __MIG_check__Request__iokit_subsystem__
2316#if !defined(__MIG_check__Request__io_service_close_t__defined)
2317#define __MIG_check__Request__io_service_close_t__defined
2318
2319mig_internal kern_return_t __MIG_check__Request__io_service_close_t(__attribute__((__unused__)) __Request__io_service_close_t *In0P)
2320{
2321
2322 typedef __Request__io_service_close_t __Request;
2323#if __MigTypeCheck
2324 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
2325 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
2326 return MIG_BAD_ARGUMENTS;
2327#endif /* __MigTypeCheck */
2328
2329 return MACH_MSG_SUCCESS;
2330}
2331#endif /* !defined(__MIG_check__Request__io_service_close_t__defined) */
2332#endif /* __MIG_check__Request__iokit_subsystem__ */
2333#endif /* ( __MigTypeCheck ) */
2334
2335
2336/* Routine io_service_close */
2337mig_internal novalue _Xio_service_close
2338 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
2339{
2340
2341#ifdef __MigPackStructs
2342#pragma pack(4)
2343#endif
2344 typedef struct {
2345 mach_msg_header_t Head;
2346 mach_msg_trailer_t trailer;
2347 } Request __attribute__((unused));
2348#ifdef __MigPackStructs
2349#pragma pack()
2350#endif
2351 typedef __Request__io_service_close_t __Request;
2352 typedef __Reply__io_service_close_t Reply __attribute__((unused));
2353
2354 /*
2355 * typedef struct {
2356 * mach_msg_header_t Head;
2357 * NDR_record_t NDR;
2358 * kern_return_t RetCode;
2359 * } mig_reply_error_t;
2360 */
2361
2362 Request *In0P = (Request *) InHeadP;
2363 Reply *OutP = (Reply *) OutHeadP;
2364#ifdef __MIG_check__Request__io_service_close_t__defined
2365 kern_return_t check_result;
2366#endif /* __MIG_check__Request__io_service_close_t__defined */
2367
2368#if __MigKernelSpecificCode
2369#else
2370#endif /* __MigKernelSpecificCode */
2371 io_connect_t connection;
2372
2373 __DeclareRcvRpc(2816, "io_service_close")
2374 __BeforeRcvRpc(2816, "io_service_close")
2375
2376#if defined(__MIG_check__Request__io_service_close_t__defined)
2377 check_result = __MIG_check__Request__io_service_close_t((__Request *)In0P);
2378 if (check_result != MACH_MSG_SUCCESS)
2379 { MIG_RETURN_ERROR(OutP, check_result); }
2380#endif /* defined(__MIG_check__Request__io_service_close_t__defined) */
2381
2382 connection = iokit_lookup_connect_port(In0P->Head.msgh_request_port);
2383
2384 OutP->RetCode = is_io_service_close(connection);
2385 iokit_remove_connect_reference(connection);
2386#if __MigKernelSpecificCode
2387#endif /* __MigKernelSpecificCode */
2388
2389 OutP->NDR = NDR_record;
2390
2391
2392 __AfterRcvRpc(2816, "io_service_close")
2393}
2394
2395#if ( __MigTypeCheck )
2396#if __MIG_check__Request__iokit_subsystem__
2397#if !defined(__MIG_check__Request__io_connect_get_service_t__defined)
2398#define __MIG_check__Request__io_connect_get_service_t__defined
2399
2400mig_internal kern_return_t __MIG_check__Request__io_connect_get_service_t(__attribute__((__unused__)) __Request__io_connect_get_service_t *In0P)
2401{
2402
2403 typedef __Request__io_connect_get_service_t __Request;
2404#if __MigTypeCheck
2405 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
2406 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
2407 return MIG_BAD_ARGUMENTS;
2408#endif /* __MigTypeCheck */
2409
2410 return MACH_MSG_SUCCESS;
2411}
2412#endif /* !defined(__MIG_check__Request__io_connect_get_service_t__defined) */
2413#endif /* __MIG_check__Request__iokit_subsystem__ */
2414#endif /* ( __MigTypeCheck ) */
2415
2416
2417/* Routine io_connect_get_service */
2418mig_internal novalue _Xio_connect_get_service
2419 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
2420{
2421
2422#ifdef __MigPackStructs
2423#pragma pack(4)
2424#endif
2425 typedef struct {
2426 mach_msg_header_t Head;
2427 mach_msg_trailer_t trailer;
2428 } Request __attribute__((unused));
2429#ifdef __MigPackStructs
2430#pragma pack()
2431#endif
2432 typedef __Request__io_connect_get_service_t __Request;
2433 typedef __Reply__io_connect_get_service_t Reply __attribute__((unused));
2434
2435 /*
2436 * typedef struct {
2437 * mach_msg_header_t Head;
2438 * NDR_record_t NDR;
2439 * kern_return_t RetCode;
2440 * } mig_reply_error_t;
2441 */
2442
2443 Request *In0P = (Request *) InHeadP;
2444 Reply *OutP = (Reply *) OutHeadP;
2445#ifdef __MIG_check__Request__io_connect_get_service_t__defined
2446 kern_return_t check_result;
2447#endif /* __MIG_check__Request__io_connect_get_service_t__defined */
2448
2449#if __MigKernelSpecificCode
2450#if UseStaticTemplates
2451 const static mach_msg_port_descriptor_t serviceTemplate = {
2452 /* name = */ MACH_PORT_NULL,
2453 /* pad1 = */ 0,
2454 /* pad2 = */ 0,
2455 /* disp = */ 17,
2456 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
2457 };
2458#endif /* UseStaticTemplates */
2459
2460#else
2461#if UseStaticTemplates
2462 const static mach_msg_port_descriptor_t serviceTemplate = {
2463 /* name = */ MACH_PORT_NULL,
2464 /* pad1 = */ 0,
2465 /* pad2 = */ 0,
2466 /* disp = */ 19,
2467 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
2468 };
2469#endif /* UseStaticTemplates */
2470
2471#endif /* __MigKernelSpecificCode */
2472 kern_return_t RetCode;
2473 io_connect_t connection;
2474 io_object_t service;
2475
2476 __DeclareRcvRpc(2817, "io_connect_get_service")
2477 __BeforeRcvRpc(2817, "io_connect_get_service")
2478
2479#if defined(__MIG_check__Request__io_connect_get_service_t__defined)
2480 check_result = __MIG_check__Request__io_connect_get_service_t((__Request *)In0P);
2481 if (check_result != MACH_MSG_SUCCESS)
2482 { MIG_RETURN_ERROR(OutP, check_result); }
2483#endif /* defined(__MIG_check__Request__io_connect_get_service_t__defined) */
2484
2485#if UseStaticTemplates
2486 OutP->service = serviceTemplate;
2487#else /* UseStaticTemplates */
2488#if __MigKernelSpecificCode
2489 OutP->service.disposition = 17;
2490#else
2491 OutP->service.disposition = 19;
2492#endif /* __MigKernelSpecificCode */
2493#if !(defined(KERNEL) && defined(__LP64__))
2494 OutP->service.pad1 = 0;
2495#endif
2496 OutP->service.pad2 = 0;
2497 OutP->service.type = MACH_MSG_PORT_DESCRIPTOR;
2498#if defined(KERNEL)
2499 OutP->service.pad_end = 0;
2500#endif
2501#endif /* UseStaticTemplates */
2502
2503
2504 connection = iokit_lookup_connect_port(In0P->Head.msgh_request_port);
2505
2506 RetCode = is_io_connect_get_service(connection, &service);
2507 iokit_remove_connect_reference(connection);
2508 if (RetCode != KERN_SUCCESS) {
2509 MIG_RETURN_ERROR(OutP, RetCode);
2510 }
2511#if __MigKernelSpecificCode
2512#endif /* __MigKernelSpecificCode */
2513 OutP->service.name = (mach_port_t)iokit_make_object_port(service);
2514
2515
2516 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
2517 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
2518 OutP->msgh_body.msgh_descriptor_count = 1;
2519 __AfterRcvRpc(2817, "io_connect_get_service")
2520}
2521
2522#if ( __MigTypeCheck )
2523#if __MIG_check__Request__iokit_subsystem__
2524#if !defined(__MIG_check__Request__io_connect_set_notification_port_t__defined)
2525#define __MIG_check__Request__io_connect_set_notification_port_t__defined
2526
2527mig_internal kern_return_t __MIG_check__Request__io_connect_set_notification_port_t(__attribute__((__unused__)) __Request__io_connect_set_notification_port_t *In0P)
2528{
2529
2530 typedef __Request__io_connect_set_notification_port_t __Request;
2531#if __MigTypeCheck
2532 if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
2533 (In0P->msgh_body.msgh_descriptor_count != 1) ||
2534 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
2535 return MIG_BAD_ARGUMENTS;
2536#endif /* __MigTypeCheck */
2537
2538#if __MigTypeCheck
2539 if (In0P->port.type != MACH_MSG_PORT_DESCRIPTOR ||
2540 In0P->port.disposition != 17)
2541 return MIG_TYPE_ERROR;
2542#endif /* __MigTypeCheck */
2543
2544 return MACH_MSG_SUCCESS;
2545}
2546#endif /* !defined(__MIG_check__Request__io_connect_set_notification_port_t__defined) */
2547#endif /* __MIG_check__Request__iokit_subsystem__ */
2548#endif /* ( __MigTypeCheck ) */
2549
2550
2551/* Routine io_connect_set_notification_port */
2552mig_internal novalue _Xio_connect_set_notification_port
2553 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
2554{
2555
2556#ifdef __MigPackStructs
2557#pragma pack(4)
2558#endif
2559 typedef struct {
2560 mach_msg_header_t Head;
2561 /* start of the kernel processed data */
2562 mach_msg_body_t msgh_body;
2563 mach_msg_port_descriptor_t port;
2564 /* end of the kernel processed data */
2565 NDR_record_t NDR;
2566 uint32_t notification_type;
2567 uint32_t reference;
2568 mach_msg_trailer_t trailer;
2569 } Request __attribute__((unused));
2570#ifdef __MigPackStructs
2571#pragma pack()
2572#endif
2573 typedef __Request__io_connect_set_notification_port_t __Request;
2574 typedef __Reply__io_connect_set_notification_port_t Reply __attribute__((unused));
2575
2576 /*
2577 * typedef struct {
2578 * mach_msg_header_t Head;
2579 * NDR_record_t NDR;
2580 * kern_return_t RetCode;
2581 * } mig_reply_error_t;
2582 */
2583
2584 Request *In0P = (Request *) InHeadP;
2585 Reply *OutP = (Reply *) OutHeadP;
2586#ifdef __MIG_check__Request__io_connect_set_notification_port_t__defined
2587 kern_return_t check_result;
2588#endif /* __MIG_check__Request__io_connect_set_notification_port_t__defined */
2589
2590#if __MigKernelSpecificCode
2591#else
2592#endif /* __MigKernelSpecificCode */
2593 io_connect_t connection;
2594
2595 __DeclareRcvRpc(2818, "io_connect_set_notification_port")
2596 __BeforeRcvRpc(2818, "io_connect_set_notification_port")
2597
2598#if defined(__MIG_check__Request__io_connect_set_notification_port_t__defined)
2599 check_result = __MIG_check__Request__io_connect_set_notification_port_t((__Request *)In0P);
2600 if (check_result != MACH_MSG_SUCCESS)
2601 { MIG_RETURN_ERROR(OutP, check_result); }
2602#endif /* defined(__MIG_check__Request__io_connect_set_notification_port_t__defined) */
2603
2604 connection = iokit_lookup_connect_port(In0P->Head.msgh_request_port);
2605
2606 OutP->RetCode = is_io_connect_set_notification_port(connection, In0P->notification_type, In0P->port.name, In0P->reference);
2607 iokit_remove_connect_reference(connection);
2608#if __MigKernelSpecificCode
2609#endif /* __MigKernelSpecificCode */
2610
2611 OutP->NDR = NDR_record;
2612
2613
2614 __AfterRcvRpc(2818, "io_connect_set_notification_port")
2615}
2616
2617#if ( __MigTypeCheck )
2618#if __MIG_check__Request__iokit_subsystem__
2619#if !defined(__MIG_check__Request__io_connect_map_memory_t__defined)
2620#define __MIG_check__Request__io_connect_map_memory_t__defined
2621
2622mig_internal kern_return_t __MIG_check__Request__io_connect_map_memory_t(__attribute__((__unused__)) __Request__io_connect_map_memory_t *In0P)
2623{
2624
2625 typedef __Request__io_connect_map_memory_t __Request;
2626#if __MigTypeCheck
2627 if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
2628 (In0P->msgh_body.msgh_descriptor_count != 1) ||
2629 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
2630 return MIG_BAD_ARGUMENTS;
2631#endif /* __MigTypeCheck */
2632
2633#if __MigTypeCheck
2634 if (In0P->into_task.type != MACH_MSG_PORT_DESCRIPTOR ||
2635 In0P->into_task.disposition != 17)
2636 return MIG_TYPE_ERROR;
2637#endif /* __MigTypeCheck */
2638
2639 return MACH_MSG_SUCCESS;
2640}
2641#endif /* !defined(__MIG_check__Request__io_connect_map_memory_t__defined) */
2642#endif /* __MIG_check__Request__iokit_subsystem__ */
2643#endif /* ( __MigTypeCheck ) */
2644
2645
2646/* Routine io_connect_map_memory */
2647mig_internal novalue _Xio_connect_map_memory
2648 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
2649{
2650
2651#ifdef __MigPackStructs
2652#pragma pack(4)
2653#endif
2654 typedef struct {
2655 mach_msg_header_t Head;
2656 /* start of the kernel processed data */
2657 mach_msg_body_t msgh_body;
2658 mach_msg_port_descriptor_t into_task;
2659 /* end of the kernel processed data */
2660 NDR_record_t NDR;
2661 uint32_t memory_type;
2662 uint32_t address;
2663 uint32_t size;
2664 uint32_t flags;
2665 mach_msg_trailer_t trailer;
2666 } Request __attribute__((unused));
2667#ifdef __MigPackStructs
2668#pragma pack()
2669#endif
2670 typedef __Request__io_connect_map_memory_t __Request;
2671 typedef __Reply__io_connect_map_memory_t Reply __attribute__((unused));
2672
2673 /*
2674 * typedef struct {
2675 * mach_msg_header_t Head;
2676 * NDR_record_t NDR;
2677 * kern_return_t RetCode;
2678 * } mig_reply_error_t;
2679 */
2680
2681 Request *In0P = (Request *) InHeadP;
2682 Reply *OutP = (Reply *) OutHeadP;
2683#ifdef __MIG_check__Request__io_connect_map_memory_t__defined
2684 kern_return_t check_result;
2685#endif /* __MIG_check__Request__io_connect_map_memory_t__defined */
2686
2687#if __MigKernelSpecificCode
2688#else
2689#endif /* __MigKernelSpecificCode */
2690 io_connect_t connection;
2691 task_t into_task;
2692
2693 __DeclareRcvRpc(2819, "io_connect_map_memory")
2694 __BeforeRcvRpc(2819, "io_connect_map_memory")
2695
2696#if defined(__MIG_check__Request__io_connect_map_memory_t__defined)
2697 check_result = __MIG_check__Request__io_connect_map_memory_t((__Request *)In0P);
2698 if (check_result != MACH_MSG_SUCCESS)
2699 { MIG_RETURN_ERROR(OutP, check_result); }
2700#endif /* defined(__MIG_check__Request__io_connect_map_memory_t__defined) */
2701
2702 connection = iokit_lookup_connect_port(In0P->Head.msgh_request_port);
2703
2704 into_task = convert_port_to_task(In0P->into_task.name);
2705
2706 OutP->RetCode = is_io_connect_map_memory(connection, In0P->memory_type, into_task, &In0P->address, &In0P->size, In0P->flags);
2707 task_deallocate(into_task);
2708 iokit_remove_connect_reference(connection);
2709 if (OutP->RetCode != KERN_SUCCESS) {
2710 MIG_RETURN_ERROR(OutP, OutP->RetCode);
2711 }
2712#if __MigKernelSpecificCode
2713
2714 if (IP_VALID((ipc_port_t)In0P->into_task.name))
2715 ipc_port_release_send((ipc_port_t)In0P->into_task.name);
2716#endif /* __MigKernelSpecificCode */
2717
2718 OutP->NDR = NDR_record;
2719
2720
2721 OutP->address = In0P->address;
2722
2723 OutP->size = In0P->size;
2724
2725 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
2726 __AfterRcvRpc(2819, "io_connect_map_memory")
2727}
2728
2729#if ( __MigTypeCheck )
2730#if __MIG_check__Request__iokit_subsystem__
2731#if !defined(__MIG_check__Request__io_connect_add_client_t__defined)
2732#define __MIG_check__Request__io_connect_add_client_t__defined
2733
2734mig_internal kern_return_t __MIG_check__Request__io_connect_add_client_t(__attribute__((__unused__)) __Request__io_connect_add_client_t *In0P)
2735{
2736
2737 typedef __Request__io_connect_add_client_t __Request;
2738#if __MigTypeCheck
2739 if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
2740 (In0P->msgh_body.msgh_descriptor_count != 1) ||
2741 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
2742 return MIG_BAD_ARGUMENTS;
2743#endif /* __MigTypeCheck */
2744
2745#if __MigTypeCheck
2746 if (In0P->connect_to.type != MACH_MSG_PORT_DESCRIPTOR ||
2747 In0P->connect_to.disposition != 17)
2748 return MIG_TYPE_ERROR;
2749#endif /* __MigTypeCheck */
2750
2751 return MACH_MSG_SUCCESS;
2752}
2753#endif /* !defined(__MIG_check__Request__io_connect_add_client_t__defined) */
2754#endif /* __MIG_check__Request__iokit_subsystem__ */
2755#endif /* ( __MigTypeCheck ) */
2756
2757
2758/* Routine io_connect_add_client */
2759mig_internal novalue _Xio_connect_add_client
2760 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
2761{
2762
2763#ifdef __MigPackStructs
2764#pragma pack(4)
2765#endif
2766 typedef struct {
2767 mach_msg_header_t Head;
2768 /* start of the kernel processed data */
2769 mach_msg_body_t msgh_body;
2770 mach_msg_port_descriptor_t connect_to;
2771 /* end of the kernel processed data */
2772 mach_msg_trailer_t trailer;
2773 } Request __attribute__((unused));
2774#ifdef __MigPackStructs
2775#pragma pack()
2776#endif
2777 typedef __Request__io_connect_add_client_t __Request;
2778 typedef __Reply__io_connect_add_client_t Reply __attribute__((unused));
2779
2780 /*
2781 * typedef struct {
2782 * mach_msg_header_t Head;
2783 * NDR_record_t NDR;
2784 * kern_return_t RetCode;
2785 * } mig_reply_error_t;
2786 */
2787
2788 Request *In0P = (Request *) InHeadP;
2789 Reply *OutP = (Reply *) OutHeadP;
2790#ifdef __MIG_check__Request__io_connect_add_client_t__defined
2791 kern_return_t check_result;
2792#endif /* __MIG_check__Request__io_connect_add_client_t__defined */
2793
2794#if __MigKernelSpecificCode
2795#else
2796#endif /* __MigKernelSpecificCode */
2797 io_connect_t connection;
2798 io_connect_t connect_to;
2799
2800 __DeclareRcvRpc(2820, "io_connect_add_client")
2801 __BeforeRcvRpc(2820, "io_connect_add_client")
2802
2803#if defined(__MIG_check__Request__io_connect_add_client_t__defined)
2804 check_result = __MIG_check__Request__io_connect_add_client_t((__Request *)In0P);
2805 if (check_result != MACH_MSG_SUCCESS)
2806 { MIG_RETURN_ERROR(OutP, check_result); }
2807#endif /* defined(__MIG_check__Request__io_connect_add_client_t__defined) */
2808
2809 connection = iokit_lookup_connect_port(In0P->Head.msgh_request_port);
2810
2811 connect_to = iokit_lookup_connect_port(In0P->connect_to.name);
2812
2813 OutP->RetCode = is_io_connect_add_client(connection, connect_to);
2814 iokit_remove_connect_reference(connect_to);
2815 iokit_remove_connect_reference(connection);
2816#if __MigKernelSpecificCode
2817 if (OutP->RetCode != KERN_SUCCESS) {
2818 MIG_RETURN_ERROR(OutP, OutP->RetCode);
2819 }
2820
2821 if (IP_VALID((ipc_port_t)In0P->connect_to.name))
2822 ipc_port_release_send((ipc_port_t)In0P->connect_to.name);
2823#endif /* __MigKernelSpecificCode */
2824
2825 OutP->NDR = NDR_record;
2826
2827
2828 __AfterRcvRpc(2820, "io_connect_add_client")
2829}
2830
2831#if ( __MigTypeCheck )
2832#if __MIG_check__Request__iokit_subsystem__
2833#if !defined(__MIG_check__Request__io_connect_set_properties_t__defined)
2834#define __MIG_check__Request__io_connect_set_properties_t__defined
2835
2836mig_internal kern_return_t __MIG_check__Request__io_connect_set_properties_t(__attribute__((__unused__)) __Request__io_connect_set_properties_t *In0P)
2837{
2838
2839 typedef __Request__io_connect_set_properties_t __Request;
2840#if __MigTypeCheck
2841 if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
2842 (In0P->msgh_body.msgh_descriptor_count != 1) ||
2843 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
2844 return MIG_BAD_ARGUMENTS;
2845#endif /* __MigTypeCheck */
2846
2847#if __MigTypeCheck
2848 if (In0P->properties.type != MACH_MSG_OOL_DESCRIPTOR)
2849 return MIG_TYPE_ERROR;
2850#endif /* __MigTypeCheck */
2851
2852#if __MigTypeCheck
2853 if (In0P->properties.size != In0P->propertiesCnt)
2854 return MIG_TYPE_ERROR;
2855#endif /* __MigTypeCheck */
2856
2857 return MACH_MSG_SUCCESS;
2858}
2859#endif /* !defined(__MIG_check__Request__io_connect_set_properties_t__defined) */
2860#endif /* __MIG_check__Request__iokit_subsystem__ */
2861#endif /* ( __MigTypeCheck ) */
2862
2863
2864/* Routine io_connect_set_properties */
2865mig_internal novalue _Xio_connect_set_properties
2866 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
2867{
2868
2869#ifdef __MigPackStructs
2870#pragma pack(4)
2871#endif
2872 typedef struct {
2873 mach_msg_header_t Head;
2874 /* start of the kernel processed data */
2875 mach_msg_body_t msgh_body;
2876 mach_msg_ool_descriptor_t properties;
2877 /* end of the kernel processed data */
2878 NDR_record_t NDR;
2879 mach_msg_type_number_t propertiesCnt;
2880 mach_msg_trailer_t trailer;
2881 } Request __attribute__((unused));
2882#ifdef __MigPackStructs
2883#pragma pack()
2884#endif
2885 typedef __Request__io_connect_set_properties_t __Request;
2886 typedef __Reply__io_connect_set_properties_t Reply __attribute__((unused));
2887
2888 /*
2889 * typedef struct {
2890 * mach_msg_header_t Head;
2891 * NDR_record_t NDR;
2892 * kern_return_t RetCode;
2893 * } mig_reply_error_t;
2894 */
2895
2896 Request *In0P = (Request *) InHeadP;
2897 Reply *OutP = (Reply *) OutHeadP;
2898#ifdef __MIG_check__Request__io_connect_set_properties_t__defined
2899 kern_return_t check_result;
2900#endif /* __MIG_check__Request__io_connect_set_properties_t__defined */
2901
2902#if __MigKernelSpecificCode
2903#else
2904#endif /* __MigKernelSpecificCode */
2905 io_connect_t connection;
2906
2907 __DeclareRcvRpc(2821, "io_connect_set_properties")
2908 __BeforeRcvRpc(2821, "io_connect_set_properties")
2909
2910#if defined(__MIG_check__Request__io_connect_set_properties_t__defined)
2911 check_result = __MIG_check__Request__io_connect_set_properties_t((__Request *)In0P);
2912 if (check_result != MACH_MSG_SUCCESS)
2913 { MIG_RETURN_ERROR(OutP, check_result); }
2914#endif /* defined(__MIG_check__Request__io_connect_set_properties_t__defined) */
2915
2916 connection = iokit_lookup_connect_port(In0P->Head.msgh_request_port);
2917
2918 OutP->RetCode = is_io_connect_set_properties(connection, (io_buf_ptr_t)(In0P->properties.address), In0P->properties.size, &OutP->result);
2919 iokit_remove_connect_reference(connection);
2920 if (OutP->RetCode != KERN_SUCCESS) {
2921 MIG_RETURN_ERROR(OutP, OutP->RetCode);
2922 }
2923#if __MigKernelSpecificCode
2924#endif /* __MigKernelSpecificCode */
2925
2926 OutP->NDR = NDR_record;
2927
2928
2929 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
2930 __AfterRcvRpc(2821, "io_connect_set_properties")
2931}
2932
2933#if ( __MigTypeCheck )
2934#if __MIG_check__Request__iokit_subsystem__
2935#if !defined(__MIG_check__Request__io_connect_method_scalarI_scalarO_t__defined)
2936#define __MIG_check__Request__io_connect_method_scalarI_scalarO_t__defined
2937
2938mig_internal kern_return_t __MIG_check__Request__io_connect_method_scalarI_scalarO_t(__attribute__((__unused__)) __Request__io_connect_method_scalarI_scalarO_t *In0P, __attribute__((__unused__)) __Request__io_connect_method_scalarI_scalarO_t **In1PP)
2939{
2940
2941 typedef __Request__io_connect_method_scalarI_scalarO_t __Request;
2942 __Request *In1P;
2943#if __MigTypeCheck
2944 unsigned int msgh_size;
2945#endif /* __MigTypeCheck */
2946 unsigned int msgh_size_delta;
2947
2948#if __MigTypeCheck
2949 msgh_size = In0P->Head.msgh_size;
2950 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
2951 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 64)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
2952 return MIG_BAD_ARGUMENTS;
2953#endif /* __MigTypeCheck */
2954
2955#if defined(__NDR_convert__int_rep__Request__io_connect_method_scalarI_scalarO_t__inputCnt__defined)
2956 if (In0P->NDR.int_rep != NDR_record.int_rep)
2957 __NDR_convert__int_rep__Request__io_connect_method_scalarI_scalarO_t__inputCnt(&In0P->inputCnt, In0P->NDR.int_rep);
2958#endif /* __NDR_convert__int_rep__Request__io_connect_method_scalarI_scalarO_t__inputCnt__defined */
2959 msgh_size_delta = (4 * In0P->inputCnt);
2960#if __MigTypeCheck
2961 if ( In0P->inputCnt > 16 )
2962 return MIG_BAD_ARGUMENTS;
2963 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 64)) / 4 < In0P->inputCnt) ||
2964 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 64) + (4 * In0P->inputCnt)))
2965 return MIG_BAD_ARGUMENTS;
2966#endif /* __MigTypeCheck */
2967
2968 *In1PP = In1P = (__Request *) ((pointer_t) In0P + msgh_size_delta - 64);
2969
2970 return MACH_MSG_SUCCESS;
2971}
2972#endif /* !defined(__MIG_check__Request__io_connect_method_scalarI_scalarO_t__defined) */
2973#endif /* __MIG_check__Request__iokit_subsystem__ */
2974#endif /* ( __MigTypeCheck ) */
2975
2976
2977/* Routine io_connect_method_scalarI_scalarO */
2978mig_internal novalue _Xio_connect_method_scalarI_scalarO
2979 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
2980{
2981
2982#ifdef __MigPackStructs
2983#pragma pack(4)
2984#endif
2985 typedef struct {
2986 mach_msg_header_t Head;
2987 NDR_record_t NDR;
2988 uint32_t selector;
2989 mach_msg_type_number_t inputCnt;
2990 int input[16];
2991 mach_msg_type_number_t outputCnt;
2992 mach_msg_trailer_t trailer;
2993 } Request __attribute__((unused));
2994#ifdef __MigPackStructs
2995#pragma pack()
2996#endif
2997 typedef __Request__io_connect_method_scalarI_scalarO_t __Request;
2998 typedef __Reply__io_connect_method_scalarI_scalarO_t Reply __attribute__((unused));
2999
3000 /*
3001 * typedef struct {
3002 * mach_msg_header_t Head;
3003 * NDR_record_t NDR;
3004 * kern_return_t RetCode;
3005 * } mig_reply_error_t;
3006 */
3007
3008 Request *In0P = (Request *) InHeadP;
3009 Request *In1P;
3010 Reply *OutP = (Reply *) OutHeadP;
3011#ifdef __MIG_check__Request__io_connect_method_scalarI_scalarO_t__defined
3012 kern_return_t check_result;
3013#endif /* __MIG_check__Request__io_connect_method_scalarI_scalarO_t__defined */
3014
3015#if __MigKernelSpecificCode
3016#else
3017#endif /* __MigKernelSpecificCode */
3018 io_connect_t connection;
3019
3020 __DeclareRcvRpc(2822, "io_connect_method_scalarI_scalarO")
3021 __BeforeRcvRpc(2822, "io_connect_method_scalarI_scalarO")
3022
3023#if defined(__MIG_check__Request__io_connect_method_scalarI_scalarO_t__defined)
3024 check_result = __MIG_check__Request__io_connect_method_scalarI_scalarO_t((__Request *)In0P, (__Request **)&In1P);
3025 if (check_result != MACH_MSG_SUCCESS)
3026 { MIG_RETURN_ERROR(OutP, check_result); }
3027#endif /* defined(__MIG_check__Request__io_connect_method_scalarI_scalarO_t__defined) */
3028
3029 connection = iokit_lookup_connect_port(In0P->Head.msgh_request_port);
3030
3031 OutP->outputCnt = 16;
3032 if (In1P->outputCnt < OutP->outputCnt)
3033 OutP->outputCnt = In1P->outputCnt;
3034
3035 OutP->RetCode = is_io_connect_method_scalarI_scalarO(connection, In0P->selector, In0P->input, In0P->inputCnt, OutP->output, &OutP->outputCnt);
3036 iokit_remove_connect_reference(connection);
3037 if (OutP->RetCode != KERN_SUCCESS) {
3038 MIG_RETURN_ERROR(OutP, OutP->RetCode);
3039 }
3040#if __MigKernelSpecificCode
3041#endif /* __MigKernelSpecificCode */
3042
3043 OutP->NDR = NDR_record;
3044
3045 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 64) + (((4 * OutP->outputCnt)));
3046
3047 __AfterRcvRpc(2822, "io_connect_method_scalarI_scalarO")
3048}
3049
3050#if ( __MigTypeCheck )
3051#if __MIG_check__Request__iokit_subsystem__
3052#if !defined(__MIG_check__Request__io_connect_method_scalarI_structureO_t__defined)
3053#define __MIG_check__Request__io_connect_method_scalarI_structureO_t__defined
3054
3055mig_internal kern_return_t __MIG_check__Request__io_connect_method_scalarI_structureO_t(__attribute__((__unused__)) __Request__io_connect_method_scalarI_structureO_t *In0P, __attribute__((__unused__)) __Request__io_connect_method_scalarI_structureO_t **In1PP)
3056{
3057
3058 typedef __Request__io_connect_method_scalarI_structureO_t __Request;
3059 __Request *In1P;
3060#if __MigTypeCheck
3061 unsigned int msgh_size;
3062#endif /* __MigTypeCheck */
3063 unsigned int msgh_size_delta;
3064
3065#if __MigTypeCheck
3066 msgh_size = In0P->Head.msgh_size;
3067 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
3068 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 64)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
3069 return MIG_BAD_ARGUMENTS;
3070#endif /* __MigTypeCheck */
3071
3072#if defined(__NDR_convert__int_rep__Request__io_connect_method_scalarI_structureO_t__inputCnt__defined)
3073 if (In0P->NDR.int_rep != NDR_record.int_rep)
3074 __NDR_convert__int_rep__Request__io_connect_method_scalarI_structureO_t__inputCnt(&In0P->inputCnt, In0P->NDR.int_rep);
3075#endif /* __NDR_convert__int_rep__Request__io_connect_method_scalarI_structureO_t__inputCnt__defined */
3076 msgh_size_delta = (4 * In0P->inputCnt);
3077#if __MigTypeCheck
3078 if ( In0P->inputCnt > 16 )
3079 return MIG_BAD_ARGUMENTS;
3080 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 64)) / 4 < In0P->inputCnt) ||
3081 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 64) + (4 * In0P->inputCnt)))
3082 return MIG_BAD_ARGUMENTS;
3083#endif /* __MigTypeCheck */
3084
3085 *In1PP = In1P = (__Request *) ((pointer_t) In0P + msgh_size_delta - 64);
3086
3087 return MACH_MSG_SUCCESS;
3088}
3089#endif /* !defined(__MIG_check__Request__io_connect_method_scalarI_structureO_t__defined) */
3090#endif /* __MIG_check__Request__iokit_subsystem__ */
3091#endif /* ( __MigTypeCheck ) */
3092
3093
3094/* Routine io_connect_method_scalarI_structureO */
3095mig_internal novalue _Xio_connect_method_scalarI_structureO
3096 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
3097{
3098
3099#ifdef __MigPackStructs
3100#pragma pack(4)
3101#endif
3102 typedef struct {
3103 mach_msg_header_t Head;
3104 NDR_record_t NDR;
3105 uint32_t selector;
3106 mach_msg_type_number_t inputCnt;
3107 int input[16];
3108 mach_msg_type_number_t outputCnt;
3109 mach_msg_trailer_t trailer;
3110 } Request __attribute__((unused));
3111#ifdef __MigPackStructs
3112#pragma pack()
3113#endif
3114 typedef __Request__io_connect_method_scalarI_structureO_t __Request;
3115 typedef __Reply__io_connect_method_scalarI_structureO_t Reply __attribute__((unused));
3116
3117 /*
3118 * typedef struct {
3119 * mach_msg_header_t Head;
3120 * NDR_record_t NDR;
3121 * kern_return_t RetCode;
3122 * } mig_reply_error_t;
3123 */
3124
3125 Request *In0P = (Request *) InHeadP;
3126 Request *In1P;
3127 Reply *OutP = (Reply *) OutHeadP;
3128#ifdef __MIG_check__Request__io_connect_method_scalarI_structureO_t__defined
3129 kern_return_t check_result;
3130#endif /* __MIG_check__Request__io_connect_method_scalarI_structureO_t__defined */
3131
3132#if __MigKernelSpecificCode
3133#else
3134#endif /* __MigKernelSpecificCode */
3135 io_connect_t connection;
3136
3137 __DeclareRcvRpc(2823, "io_connect_method_scalarI_structureO")
3138 __BeforeRcvRpc(2823, "io_connect_method_scalarI_structureO")
3139
3140#if defined(__MIG_check__Request__io_connect_method_scalarI_structureO_t__defined)
3141 check_result = __MIG_check__Request__io_connect_method_scalarI_structureO_t((__Request *)In0P, (__Request **)&In1P);
3142 if (check_result != MACH_MSG_SUCCESS)
3143 { MIG_RETURN_ERROR(OutP, check_result); }
3144#endif /* defined(__MIG_check__Request__io_connect_method_scalarI_structureO_t__defined) */
3145
3146 connection = iokit_lookup_connect_port(In0P->Head.msgh_request_port);
3147
3148 OutP->outputCnt = 4096;
3149 if (In1P->outputCnt < OutP->outputCnt)
3150 OutP->outputCnt = In1P->outputCnt;
3151
3152 OutP->RetCode = is_io_connect_method_scalarI_structureO(connection, In0P->selector, In0P->input, In0P->inputCnt, OutP->output, &OutP->outputCnt);
3153 iokit_remove_connect_reference(connection);
3154 if (OutP->RetCode != KERN_SUCCESS) {
3155 MIG_RETURN_ERROR(OutP, OutP->RetCode);
3156 }
3157#if __MigKernelSpecificCode
3158#endif /* __MigKernelSpecificCode */
3159
3160 OutP->NDR = NDR_record;
3161
3162 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 4096) + (_WALIGN_((OutP->outputCnt + 3) & ~3));
3163
3164 __AfterRcvRpc(2823, "io_connect_method_scalarI_structureO")
3165}
3166
3167#if ( __MigTypeCheck )
3168#if __MIG_check__Request__iokit_subsystem__
3169#if !defined(__MIG_check__Request__io_connect_method_scalarI_structureI_t__defined)
3170#define __MIG_check__Request__io_connect_method_scalarI_structureI_t__defined
3171
3172mig_internal kern_return_t __MIG_check__Request__io_connect_method_scalarI_structureI_t(__attribute__((__unused__)) __Request__io_connect_method_scalarI_structureI_t *In0P, __attribute__((__unused__)) __Request__io_connect_method_scalarI_structureI_t **In1PP)
3173{
3174
3175 typedef __Request__io_connect_method_scalarI_structureI_t __Request;
3176 __Request *In1P;
3177#if __MigTypeCheck
3178 unsigned int msgh_size;
3179#endif /* __MigTypeCheck */
3180 unsigned int msgh_size_delta;
3181
3182#if __MigTypeCheck
3183 msgh_size = In0P->Head.msgh_size;
3184 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
3185 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 4160)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
3186 return MIG_BAD_ARGUMENTS;
3187#endif /* __MigTypeCheck */
3188
3189#if defined(__NDR_convert__int_rep__Request__io_connect_method_scalarI_structureI_t__inputCnt__defined)
3190 if (In0P->NDR.int_rep != NDR_record.int_rep)
3191 __NDR_convert__int_rep__Request__io_connect_method_scalarI_structureI_t__inputCnt(&In0P->inputCnt, In0P->NDR.int_rep);
3192#endif /* __NDR_convert__int_rep__Request__io_connect_method_scalarI_structureI_t__inputCnt__defined */
3193 msgh_size_delta = (4 * In0P->inputCnt);
3194#if __MigTypeCheck
3195 if ( In0P->inputCnt > 16 )
3196 return MIG_BAD_ARGUMENTS;
3197 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 4160)) / 4 < In0P->inputCnt) ||
3198 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 4160) + (4 * In0P->inputCnt)))
3199 return MIG_BAD_ARGUMENTS;
3200 msgh_size -= msgh_size_delta;
3201#endif /* __MigTypeCheck */
3202
3203 *In1PP = In1P = (__Request *) ((pointer_t) In0P + msgh_size_delta - 64);
3204
3205#if defined(__NDR_convert__int_rep__Request__io_connect_method_scalarI_structureI_t__inputStructCnt__defined)
3206 if (In0P->NDR.int_rep != NDR_record.int_rep)
3207 __NDR_convert__int_rep__Request__io_connect_method_scalarI_structureI_t__inputStructCnt(&In1P->inputStructCnt, In1P->NDR.int_rep);
3208#endif /* __NDR_convert__int_rep__Request__io_connect_method_scalarI_structureI_t__inputStructCnt__defined */
3209#if __MigTypeCheck
3210 if ( In1P->inputStructCnt > 4096 )
3211 return MIG_BAD_ARGUMENTS;
3212 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 4160)) < In1P->inputStructCnt) ||
3213 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 4160) + _WALIGN_(In1P->inputStructCnt)))
3214 return MIG_BAD_ARGUMENTS;
3215#endif /* __MigTypeCheck */
3216
3217 return MACH_MSG_SUCCESS;
3218}
3219#endif /* !defined(__MIG_check__Request__io_connect_method_scalarI_structureI_t__defined) */
3220#endif /* __MIG_check__Request__iokit_subsystem__ */
3221#endif /* ( __MigTypeCheck ) */
3222
3223
3224/* Routine io_connect_method_scalarI_structureI */
3225mig_internal novalue _Xio_connect_method_scalarI_structureI
3226 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
3227{
3228
3229#ifdef __MigPackStructs
3230#pragma pack(4)
3231#endif
3232 typedef struct {
3233 mach_msg_header_t Head;
3234 NDR_record_t NDR;
3235 uint32_t selector;
3236 mach_msg_type_number_t inputCnt;
3237 int input[16];
3238 mach_msg_type_number_t inputStructCnt;
3239 char inputStruct[4096];
3240 mach_msg_trailer_t trailer;
3241 } Request __attribute__((unused));
3242#ifdef __MigPackStructs
3243#pragma pack()
3244#endif
3245 typedef __Request__io_connect_method_scalarI_structureI_t __Request;
3246 typedef __Reply__io_connect_method_scalarI_structureI_t Reply __attribute__((unused));
3247
3248 /*
3249 * typedef struct {
3250 * mach_msg_header_t Head;
3251 * NDR_record_t NDR;
3252 * kern_return_t RetCode;
3253 * } mig_reply_error_t;
3254 */
3255
3256 Request *In0P = (Request *) InHeadP;
3257 Request *In1P;
3258 Reply *OutP = (Reply *) OutHeadP;
3259#ifdef __MIG_check__Request__io_connect_method_scalarI_structureI_t__defined
3260 kern_return_t check_result;
3261#endif /* __MIG_check__Request__io_connect_method_scalarI_structureI_t__defined */
3262
3263#if __MigKernelSpecificCode
3264#else
3265#endif /* __MigKernelSpecificCode */
3266 io_connect_t connection;
3267
3268 __DeclareRcvRpc(2824, "io_connect_method_scalarI_structureI")
3269 __BeforeRcvRpc(2824, "io_connect_method_scalarI_structureI")
3270
3271#if defined(__MIG_check__Request__io_connect_method_scalarI_structureI_t__defined)
3272 check_result = __MIG_check__Request__io_connect_method_scalarI_structureI_t((__Request *)In0P, (__Request **)&In1P);
3273 if (check_result != MACH_MSG_SUCCESS)
3274 { MIG_RETURN_ERROR(OutP, check_result); }
3275#endif /* defined(__MIG_check__Request__io_connect_method_scalarI_structureI_t__defined) */
3276
3277 connection = iokit_lookup_connect_port(In0P->Head.msgh_request_port);
3278
3279 OutP->RetCode = is_io_connect_method_scalarI_structureI(connection, In0P->selector, In0P->input, In0P->inputCnt, In1P->inputStruct, In1P->inputStructCnt);
3280 iokit_remove_connect_reference(connection);
3281#if __MigKernelSpecificCode
3282#endif /* __MigKernelSpecificCode */
3283
3284 OutP->NDR = NDR_record;
3285
3286
3287 __AfterRcvRpc(2824, "io_connect_method_scalarI_structureI")
3288}
3289
3290#if ( __MigTypeCheck )
3291#if __MIG_check__Request__iokit_subsystem__
3292#if !defined(__MIG_check__Request__io_connect_method_structureI_structureO_t__defined)
3293#define __MIG_check__Request__io_connect_method_structureI_structureO_t__defined
3294
3295mig_internal kern_return_t __MIG_check__Request__io_connect_method_structureI_structureO_t(__attribute__((__unused__)) __Request__io_connect_method_structureI_structureO_t *In0P, __attribute__((__unused__)) __Request__io_connect_method_structureI_structureO_t **In1PP)
3296{
3297
3298 typedef __Request__io_connect_method_structureI_structureO_t __Request;
3299 __Request *In1P;
3300#if __MigTypeCheck
3301 unsigned int msgh_size;
3302#endif /* __MigTypeCheck */
3303 unsigned int msgh_size_delta;
3304
3305#if __MigTypeCheck
3306 msgh_size = In0P->Head.msgh_size;
3307 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
3308 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 4096)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
3309 return MIG_BAD_ARGUMENTS;
3310#endif /* __MigTypeCheck */
3311
3312#if defined(__NDR_convert__int_rep__Request__io_connect_method_structureI_structureO_t__inputCnt__defined)
3313 if (In0P->NDR.int_rep != NDR_record.int_rep)
3314 __NDR_convert__int_rep__Request__io_connect_method_structureI_structureO_t__inputCnt(&In0P->inputCnt, In0P->NDR.int_rep);
3315#endif /* __NDR_convert__int_rep__Request__io_connect_method_structureI_structureO_t__inputCnt__defined */
3316 msgh_size_delta = _WALIGN_(In0P->inputCnt);
3317#if __MigTypeCheck
3318 if ( In0P->inputCnt > 4096 )
3319 return MIG_BAD_ARGUMENTS;
3320 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 4096)) < In0P->inputCnt) ||
3321 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 4096) + _WALIGN_(In0P->inputCnt)))
3322 return MIG_BAD_ARGUMENTS;
3323#endif /* __MigTypeCheck */
3324
3325 *In1PP = In1P = (__Request *) ((pointer_t) In0P + msgh_size_delta - 4096);
3326
3327 return MACH_MSG_SUCCESS;
3328}
3329#endif /* !defined(__MIG_check__Request__io_connect_method_structureI_structureO_t__defined) */
3330#endif /* __MIG_check__Request__iokit_subsystem__ */
3331#endif /* ( __MigTypeCheck ) */
3332
3333
3334/* Routine io_connect_method_structureI_structureO */
3335mig_internal novalue _Xio_connect_method_structureI_structureO
3336 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
3337{
3338
3339#ifdef __MigPackStructs
3340#pragma pack(4)
3341#endif
3342 typedef struct {
3343 mach_msg_header_t Head;
3344 NDR_record_t NDR;
3345 uint32_t selector;
3346 mach_msg_type_number_t inputCnt;
3347 char input[4096];
3348 mach_msg_type_number_t outputCnt;
3349 mach_msg_trailer_t trailer;
3350 } Request __attribute__((unused));
3351#ifdef __MigPackStructs
3352#pragma pack()
3353#endif
3354 typedef __Request__io_connect_method_structureI_structureO_t __Request;
3355 typedef __Reply__io_connect_method_structureI_structureO_t Reply __attribute__((unused));
3356
3357 /*
3358 * typedef struct {
3359 * mach_msg_header_t Head;
3360 * NDR_record_t NDR;
3361 * kern_return_t RetCode;
3362 * } mig_reply_error_t;
3363 */
3364
3365 Request *In0P = (Request *) InHeadP;
3366 Request *In1P;
3367 Reply *OutP = (Reply *) OutHeadP;
3368#ifdef __MIG_check__Request__io_connect_method_structureI_structureO_t__defined
3369 kern_return_t check_result;
3370#endif /* __MIG_check__Request__io_connect_method_structureI_structureO_t__defined */
3371
3372#if __MigKernelSpecificCode
3373#else
3374#endif /* __MigKernelSpecificCode */
3375 io_connect_t connection;
3376
3377 __DeclareRcvRpc(2825, "io_connect_method_structureI_structureO")
3378 __BeforeRcvRpc(2825, "io_connect_method_structureI_structureO")
3379
3380#if defined(__MIG_check__Request__io_connect_method_structureI_structureO_t__defined)
3381 check_result = __MIG_check__Request__io_connect_method_structureI_structureO_t((__Request *)In0P, (__Request **)&In1P);
3382 if (check_result != MACH_MSG_SUCCESS)
3383 { MIG_RETURN_ERROR(OutP, check_result); }
3384#endif /* defined(__MIG_check__Request__io_connect_method_structureI_structureO_t__defined) */
3385
3386 connection = iokit_lookup_connect_port(In0P->Head.msgh_request_port);
3387
3388 OutP->outputCnt = 4096;
3389 if (In1P->outputCnt < OutP->outputCnt)
3390 OutP->outputCnt = In1P->outputCnt;
3391
3392 OutP->RetCode = is_io_connect_method_structureI_structureO(connection, In0P->selector, In0P->input, In0P->inputCnt, OutP->output, &OutP->outputCnt);
3393 iokit_remove_connect_reference(connection);
3394 if (OutP->RetCode != KERN_SUCCESS) {
3395 MIG_RETURN_ERROR(OutP, OutP->RetCode);
3396 }
3397#if __MigKernelSpecificCode
3398#endif /* __MigKernelSpecificCode */
3399
3400 OutP->NDR = NDR_record;
3401
3402 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 4096) + (_WALIGN_((OutP->outputCnt + 3) & ~3));
3403
3404 __AfterRcvRpc(2825, "io_connect_method_structureI_structureO")
3405}
3406
3407#if ( __MigTypeCheck )
3408#if __MIG_check__Request__iokit_subsystem__
3409#if !defined(__MIG_check__Request__io_registry_entry_get_path_t__defined)
3410#define __MIG_check__Request__io_registry_entry_get_path_t__defined
3411
3412mig_internal kern_return_t __MIG_check__Request__io_registry_entry_get_path_t(__attribute__((__unused__)) __Request__io_registry_entry_get_path_t *In0P)
3413{
3414
3415 typedef __Request__io_registry_entry_get_path_t __Request;
3416#if __MigTypeCheck
3417 unsigned int msgh_size;
3418#endif /* __MigTypeCheck */
3419
3420#if __MigTypeCheck
3421 msgh_size = In0P->Head.msgh_size;
3422 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
3423 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 128)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
3424 return MIG_BAD_ARGUMENTS;
3425#endif /* __MigTypeCheck */
3426
3427#if defined(__NDR_convert__int_rep__Request__io_registry_entry_get_path_t__planeCnt__defined)
3428 if (In0P->NDR.int_rep != NDR_record.int_rep)
3429 __NDR_convert__int_rep__Request__io_registry_entry_get_path_t__planeCnt(&In0P->planeCnt, In0P->NDR.int_rep);
3430#endif /* __NDR_convert__int_rep__Request__io_registry_entry_get_path_t__planeCnt__defined */
3431#if __MigTypeCheck
3432 if ( In0P->planeCnt > 128 )
3433 return MIG_BAD_ARGUMENTS;
3434 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 128)) < In0P->planeCnt) ||
3435 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 128) + _WALIGN_(In0P->planeCnt)))
3436 return MIG_BAD_ARGUMENTS;
3437#endif /* __MigTypeCheck */
3438
3439#if __MigTypeCheck
3440 {
3441 char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
3442#if __MigKernelSpecificCode
3443 size_t strnlen_limit;
3444#else
3445 size_t memchr_limit;
3446#endif /* __MigKernelSpecificCode */
3447
3448#if __MigKernelSpecificCode
3449 strnlen_limit = min((msg_limit - In0P->plane), 128);
3450 if (( strnlen(In0P->plane, strnlen_limit) >= 128 + 1 ))
3451 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
3452#else
3453 memchr_limit = min((msg_limit - In0P->plane), 128);
3454 if (( memchr(In0P->plane, '\0', memchr_limit) == NULL ))
3455 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
3456#endif /* __MigKernelSpecificCode */
3457 }
3458#endif /* __MigTypeCheck */
3459
3460 return MACH_MSG_SUCCESS;
3461}
3462#endif /* !defined(__MIG_check__Request__io_registry_entry_get_path_t__defined) */
3463#endif /* __MIG_check__Request__iokit_subsystem__ */
3464#endif /* ( __MigTypeCheck ) */
3465
3466
3467/* Routine io_registry_entry_get_path */
3468mig_internal novalue _Xio_registry_entry_get_path
3469 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
3470{
3471
3472#ifdef __MigPackStructs
3473#pragma pack(4)
3474#endif
3475 typedef struct {
3476 mach_msg_header_t Head;
3477 NDR_record_t NDR;
3478 mach_msg_type_number_t planeOffset; /* MiG doesn't use it */
3479 mach_msg_type_number_t planeCnt;
3480 char plane[128];
3481 mach_msg_trailer_t trailer;
3482 } Request __attribute__((unused));
3483#ifdef __MigPackStructs
3484#pragma pack()
3485#endif
3486 typedef __Request__io_registry_entry_get_path_t __Request;
3487 typedef __Reply__io_registry_entry_get_path_t Reply __attribute__((unused));
3488
3489 /*
3490 * typedef struct {
3491 * mach_msg_header_t Head;
3492 * NDR_record_t NDR;
3493 * kern_return_t RetCode;
3494 * } mig_reply_error_t;
3495 */
3496
3497 Request *In0P = (Request *) InHeadP;
3498 Reply *OutP = (Reply *) OutHeadP;
3499#ifdef __MIG_check__Request__io_registry_entry_get_path_t__defined
3500 kern_return_t check_result;
3501#endif /* __MIG_check__Request__io_registry_entry_get_path_t__defined */
3502
3503#if __MigKernelSpecificCode
3504#else
3505#endif /* __MigKernelSpecificCode */
3506 io_object_t registry_entry;
3507
3508 __DeclareRcvRpc(2826, "io_registry_entry_get_path")
3509 __BeforeRcvRpc(2826, "io_registry_entry_get_path")
3510
3511#if defined(__MIG_check__Request__io_registry_entry_get_path_t__defined)
3512 check_result = __MIG_check__Request__io_registry_entry_get_path_t((__Request *)In0P);
3513 if (check_result != MACH_MSG_SUCCESS)
3514 { MIG_RETURN_ERROR(OutP, check_result); }
3515#endif /* defined(__MIG_check__Request__io_registry_entry_get_path_t__defined) */
3516
3517 registry_entry = iokit_lookup_object_port(In0P->Head.msgh_request_port);
3518
3519 OutP->RetCode = is_io_registry_entry_get_path(registry_entry, In0P->plane, OutP->path);
3520 iokit_remove_reference(registry_entry);
3521 if (OutP->RetCode != KERN_SUCCESS) {
3522 MIG_RETURN_ERROR(OutP, OutP->RetCode);
3523 }
3524#if __MigKernelSpecificCode
3525#endif /* __MigKernelSpecificCode */
3526
3527 OutP->NDR = NDR_record;
3528
3529#ifdef __LP64__
3530 {
3531 size_t strLength = strlen(OutP->path) + 1;
3532 if (strLength > 0xffffffff)
3533 MIG_RETURN_ERROR(OutP, MIG_BAD_ARGUMENTS);
3534 OutP->pathCnt = (mach_msg_type_number_t) strLength;
3535 }
3536#else
3537 OutP->pathCnt = (mach_msg_type_number_t) strlen(OutP->path) + 1;
3538#endif /* __LP64__ */
3539 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 512) + (_WALIGN_((OutP->pathCnt + 3) & ~3));
3540
3541 __AfterRcvRpc(2826, "io_registry_entry_get_path")
3542}
3543
3544#if ( __MigTypeCheck )
3545#if __MIG_check__Request__iokit_subsystem__
3546#if !defined(__MIG_check__Request__io_registry_get_root_entry_t__defined)
3547#define __MIG_check__Request__io_registry_get_root_entry_t__defined
3548
3549mig_internal kern_return_t __MIG_check__Request__io_registry_get_root_entry_t(__attribute__((__unused__)) __Request__io_registry_get_root_entry_t *In0P)
3550{
3551
3552 typedef __Request__io_registry_get_root_entry_t __Request;
3553#if __MigTypeCheck
3554 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
3555 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
3556 return MIG_BAD_ARGUMENTS;
3557#endif /* __MigTypeCheck */
3558
3559 return MACH_MSG_SUCCESS;
3560}
3561#endif /* !defined(__MIG_check__Request__io_registry_get_root_entry_t__defined) */
3562#endif /* __MIG_check__Request__iokit_subsystem__ */
3563#endif /* ( __MigTypeCheck ) */
3564
3565
3566/* Routine io_registry_get_root_entry */
3567mig_internal novalue _Xio_registry_get_root_entry
3568 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
3569{
3570
3571#ifdef __MigPackStructs
3572#pragma pack(4)
3573#endif
3574 typedef struct {
3575 mach_msg_header_t Head;
3576 mach_msg_trailer_t trailer;
3577 } Request __attribute__((unused));
3578#ifdef __MigPackStructs
3579#pragma pack()
3580#endif
3581 typedef __Request__io_registry_get_root_entry_t __Request;
3582 typedef __Reply__io_registry_get_root_entry_t Reply __attribute__((unused));
3583
3584 /*
3585 * typedef struct {
3586 * mach_msg_header_t Head;
3587 * NDR_record_t NDR;
3588 * kern_return_t RetCode;
3589 * } mig_reply_error_t;
3590 */
3591
3592 Request *In0P = (Request *) InHeadP;
3593 Reply *OutP = (Reply *) OutHeadP;
3594#ifdef __MIG_check__Request__io_registry_get_root_entry_t__defined
3595 kern_return_t check_result;
3596#endif /* __MIG_check__Request__io_registry_get_root_entry_t__defined */
3597
3598#if __MigKernelSpecificCode
3599#if UseStaticTemplates
3600 const static mach_msg_port_descriptor_t rootTemplate = {
3601 /* name = */ MACH_PORT_NULL,
3602 /* pad1 = */ 0,
3603 /* pad2 = */ 0,
3604 /* disp = */ 17,
3605 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
3606 };
3607#endif /* UseStaticTemplates */
3608
3609#else
3610#if UseStaticTemplates
3611 const static mach_msg_port_descriptor_t rootTemplate = {
3612 /* name = */ MACH_PORT_NULL,
3613 /* pad1 = */ 0,
3614 /* pad2 = */ 0,
3615 /* disp = */ 19,
3616 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
3617 };
3618#endif /* UseStaticTemplates */
3619
3620#endif /* __MigKernelSpecificCode */
3621 kern_return_t RetCode;
3622 io_object_t root;
3623
3624 __DeclareRcvRpc(2827, "io_registry_get_root_entry")
3625 __BeforeRcvRpc(2827, "io_registry_get_root_entry")
3626
3627#if defined(__MIG_check__Request__io_registry_get_root_entry_t__defined)
3628 check_result = __MIG_check__Request__io_registry_get_root_entry_t((__Request *)In0P);
3629 if (check_result != MACH_MSG_SUCCESS)
3630 { MIG_RETURN_ERROR(OutP, check_result); }
3631#endif /* defined(__MIG_check__Request__io_registry_get_root_entry_t__defined) */
3632
3633#if UseStaticTemplates
3634 OutP->root = rootTemplate;
3635#else /* UseStaticTemplates */
3636#if __MigKernelSpecificCode
3637 OutP->root.disposition = 17;
3638#else
3639 OutP->root.disposition = 19;
3640#endif /* __MigKernelSpecificCode */
3641#if !(defined(KERNEL) && defined(__LP64__))
3642 OutP->root.pad1 = 0;
3643#endif
3644 OutP->root.pad2 = 0;
3645 OutP->root.type = MACH_MSG_PORT_DESCRIPTOR;
3646#if defined(KERNEL)
3647 OutP->root.pad_end = 0;
3648#endif
3649#endif /* UseStaticTemplates */
3650
3651
3652 RetCode = is_io_registry_get_root_entry(In0P->Head.msgh_request_port, &root);
3653 if (RetCode != KERN_SUCCESS) {
3654 MIG_RETURN_ERROR(OutP, RetCode);
3655 }
3656#if __MigKernelSpecificCode
3657#endif /* __MigKernelSpecificCode */
3658 OutP->root.name = (mach_port_t)iokit_make_object_port(root);
3659
3660
3661 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
3662 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
3663 OutP->msgh_body.msgh_descriptor_count = 1;
3664 __AfterRcvRpc(2827, "io_registry_get_root_entry")
3665}
3666
3667#if ( __MigTypeCheck )
3668#if __MIG_check__Request__iokit_subsystem__
3669#if !defined(__MIG_check__Request__io_registry_entry_set_properties_t__defined)
3670#define __MIG_check__Request__io_registry_entry_set_properties_t__defined
3671
3672mig_internal kern_return_t __MIG_check__Request__io_registry_entry_set_properties_t(__attribute__((__unused__)) __Request__io_registry_entry_set_properties_t *In0P)
3673{
3674
3675 typedef __Request__io_registry_entry_set_properties_t __Request;
3676#if __MigTypeCheck
3677 if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
3678 (In0P->msgh_body.msgh_descriptor_count != 1) ||
3679 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
3680 return MIG_BAD_ARGUMENTS;
3681#endif /* __MigTypeCheck */
3682
3683#if __MigTypeCheck
3684 if (In0P->properties.type != MACH_MSG_OOL_DESCRIPTOR)
3685 return MIG_TYPE_ERROR;
3686#endif /* __MigTypeCheck */
3687
3688#if __MigTypeCheck
3689 if (In0P->properties.size != In0P->propertiesCnt)
3690 return MIG_TYPE_ERROR;
3691#endif /* __MigTypeCheck */
3692
3693 return MACH_MSG_SUCCESS;
3694}
3695#endif /* !defined(__MIG_check__Request__io_registry_entry_set_properties_t__defined) */
3696#endif /* __MIG_check__Request__iokit_subsystem__ */
3697#endif /* ( __MigTypeCheck ) */
3698
3699
3700/* Routine io_registry_entry_set_properties */
3701mig_internal novalue _Xio_registry_entry_set_properties
3702 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
3703{
3704
3705#ifdef __MigPackStructs
3706#pragma pack(4)
3707#endif
3708 typedef struct {
3709 mach_msg_header_t Head;
3710 /* start of the kernel processed data */
3711 mach_msg_body_t msgh_body;
3712 mach_msg_ool_descriptor_t properties;
3713 /* end of the kernel processed data */
3714 NDR_record_t NDR;
3715 mach_msg_type_number_t propertiesCnt;
3716 mach_msg_trailer_t trailer;
3717 } Request __attribute__((unused));
3718#ifdef __MigPackStructs
3719#pragma pack()
3720#endif
3721 typedef __Request__io_registry_entry_set_properties_t __Request;
3722 typedef __Reply__io_registry_entry_set_properties_t Reply __attribute__((unused));
3723
3724 /*
3725 * typedef struct {
3726 * mach_msg_header_t Head;
3727 * NDR_record_t NDR;
3728 * kern_return_t RetCode;
3729 * } mig_reply_error_t;
3730 */
3731
3732 Request *In0P = (Request *) InHeadP;
3733 Reply *OutP = (Reply *) OutHeadP;
3734#ifdef __MIG_check__Request__io_registry_entry_set_properties_t__defined
3735 kern_return_t check_result;
3736#endif /* __MIG_check__Request__io_registry_entry_set_properties_t__defined */
3737
3738#if __MigKernelSpecificCode
3739#else
3740#endif /* __MigKernelSpecificCode */
3741 io_object_t registry_entry;
3742
3743 __DeclareRcvRpc(2828, "io_registry_entry_set_properties")
3744 __BeforeRcvRpc(2828, "io_registry_entry_set_properties")
3745
3746#if defined(__MIG_check__Request__io_registry_entry_set_properties_t__defined)
3747 check_result = __MIG_check__Request__io_registry_entry_set_properties_t((__Request *)In0P);
3748 if (check_result != MACH_MSG_SUCCESS)
3749 { MIG_RETURN_ERROR(OutP, check_result); }
3750#endif /* defined(__MIG_check__Request__io_registry_entry_set_properties_t__defined) */
3751
3752 registry_entry = iokit_lookup_object_port(In0P->Head.msgh_request_port);
3753
3754 OutP->RetCode = is_io_registry_entry_set_properties(registry_entry, (io_buf_ptr_t)(In0P->properties.address), In0P->properties.size, &OutP->result);
3755 iokit_remove_reference(registry_entry);
3756 if (OutP->RetCode != KERN_SUCCESS) {
3757 MIG_RETURN_ERROR(OutP, OutP->RetCode);
3758 }
3759#if __MigKernelSpecificCode
3760#endif /* __MigKernelSpecificCode */
3761
3762 OutP->NDR = NDR_record;
3763
3764
3765 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
3766 __AfterRcvRpc(2828, "io_registry_entry_set_properties")
3767}
3768
3769#if ( __MigTypeCheck )
3770#if __MIG_check__Request__iokit_subsystem__
3771#if !defined(__MIG_check__Request__io_registry_entry_in_plane_t__defined)
3772#define __MIG_check__Request__io_registry_entry_in_plane_t__defined
3773
3774mig_internal kern_return_t __MIG_check__Request__io_registry_entry_in_plane_t(__attribute__((__unused__)) __Request__io_registry_entry_in_plane_t *In0P)
3775{
3776
3777 typedef __Request__io_registry_entry_in_plane_t __Request;
3778#if __MigTypeCheck
3779 unsigned int msgh_size;
3780#endif /* __MigTypeCheck */
3781
3782#if __MigTypeCheck
3783 msgh_size = In0P->Head.msgh_size;
3784 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
3785 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 128)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
3786 return MIG_BAD_ARGUMENTS;
3787#endif /* __MigTypeCheck */
3788
3789#if defined(__NDR_convert__int_rep__Request__io_registry_entry_in_plane_t__planeCnt__defined)
3790 if (In0P->NDR.int_rep != NDR_record.int_rep)
3791 __NDR_convert__int_rep__Request__io_registry_entry_in_plane_t__planeCnt(&In0P->planeCnt, In0P->NDR.int_rep);
3792#endif /* __NDR_convert__int_rep__Request__io_registry_entry_in_plane_t__planeCnt__defined */
3793#if __MigTypeCheck
3794 if ( In0P->planeCnt > 128 )
3795 return MIG_BAD_ARGUMENTS;
3796 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 128)) < In0P->planeCnt) ||
3797 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 128) + _WALIGN_(In0P->planeCnt)))
3798 return MIG_BAD_ARGUMENTS;
3799#endif /* __MigTypeCheck */
3800
3801#if __MigTypeCheck
3802 {
3803 char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
3804#if __MigKernelSpecificCode
3805 size_t strnlen_limit;
3806#else
3807 size_t memchr_limit;
3808#endif /* __MigKernelSpecificCode */
3809
3810#if __MigKernelSpecificCode
3811 strnlen_limit = min((msg_limit - In0P->plane), 128);
3812 if (( strnlen(In0P->plane, strnlen_limit) >= 128 + 1 ))
3813 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
3814#else
3815 memchr_limit = min((msg_limit - In0P->plane), 128);
3816 if (( memchr(In0P->plane, '\0', memchr_limit) == NULL ))
3817 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
3818#endif /* __MigKernelSpecificCode */
3819 }
3820#endif /* __MigTypeCheck */
3821
3822 return MACH_MSG_SUCCESS;
3823}
3824#endif /* !defined(__MIG_check__Request__io_registry_entry_in_plane_t__defined) */
3825#endif /* __MIG_check__Request__iokit_subsystem__ */
3826#endif /* ( __MigTypeCheck ) */
3827
3828
3829/* Routine io_registry_entry_in_plane */
3830mig_internal novalue _Xio_registry_entry_in_plane
3831 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
3832{
3833
3834#ifdef __MigPackStructs
3835#pragma pack(4)
3836#endif
3837 typedef struct {
3838 mach_msg_header_t Head;
3839 NDR_record_t NDR;
3840 mach_msg_type_number_t planeOffset; /* MiG doesn't use it */
3841 mach_msg_type_number_t planeCnt;
3842 char plane[128];
3843 mach_msg_trailer_t trailer;
3844 } Request __attribute__((unused));
3845#ifdef __MigPackStructs
3846#pragma pack()
3847#endif
3848 typedef __Request__io_registry_entry_in_plane_t __Request;
3849 typedef __Reply__io_registry_entry_in_plane_t Reply __attribute__((unused));
3850
3851 /*
3852 * typedef struct {
3853 * mach_msg_header_t Head;
3854 * NDR_record_t NDR;
3855 * kern_return_t RetCode;
3856 * } mig_reply_error_t;
3857 */
3858
3859 Request *In0P = (Request *) InHeadP;
3860 Reply *OutP = (Reply *) OutHeadP;
3861#ifdef __MIG_check__Request__io_registry_entry_in_plane_t__defined
3862 kern_return_t check_result;
3863#endif /* __MIG_check__Request__io_registry_entry_in_plane_t__defined */
3864
3865#if __MigKernelSpecificCode
3866#else
3867#endif /* __MigKernelSpecificCode */
3868 io_object_t registry_entry;
3869
3870 __DeclareRcvRpc(2829, "io_registry_entry_in_plane")
3871 __BeforeRcvRpc(2829, "io_registry_entry_in_plane")
3872
3873#if defined(__MIG_check__Request__io_registry_entry_in_plane_t__defined)
3874 check_result = __MIG_check__Request__io_registry_entry_in_plane_t((__Request *)In0P);
3875 if (check_result != MACH_MSG_SUCCESS)
3876 { MIG_RETURN_ERROR(OutP, check_result); }
3877#endif /* defined(__MIG_check__Request__io_registry_entry_in_plane_t__defined) */
3878
3879 registry_entry = iokit_lookup_object_port(In0P->Head.msgh_request_port);
3880
3881 OutP->RetCode = is_io_registry_entry_in_plane(registry_entry, In0P->plane, &OutP->inPlane);
3882 iokit_remove_reference(registry_entry);
3883 if (OutP->RetCode != KERN_SUCCESS) {
3884 MIG_RETURN_ERROR(OutP, OutP->RetCode);
3885 }
3886#if __MigKernelSpecificCode
3887#endif /* __MigKernelSpecificCode */
3888
3889 OutP->NDR = NDR_record;
3890
3891
3892 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
3893 __AfterRcvRpc(2829, "io_registry_entry_in_plane")
3894}
3895
3896#if ( __MigTypeCheck )
3897#if __MIG_check__Request__iokit_subsystem__
3898#if !defined(__MIG_check__Request__io_object_get_retain_count_t__defined)
3899#define __MIG_check__Request__io_object_get_retain_count_t__defined
3900
3901mig_internal kern_return_t __MIG_check__Request__io_object_get_retain_count_t(__attribute__((__unused__)) __Request__io_object_get_retain_count_t *In0P)
3902{
3903
3904 typedef __Request__io_object_get_retain_count_t __Request;
3905#if __MigTypeCheck
3906 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
3907 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
3908 return MIG_BAD_ARGUMENTS;
3909#endif /* __MigTypeCheck */
3910
3911 return MACH_MSG_SUCCESS;
3912}
3913#endif /* !defined(__MIG_check__Request__io_object_get_retain_count_t__defined) */
3914#endif /* __MIG_check__Request__iokit_subsystem__ */
3915#endif /* ( __MigTypeCheck ) */
3916
3917
3918/* Routine io_object_get_retain_count */
3919mig_internal novalue _Xio_object_get_retain_count
3920 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
3921{
3922
3923#ifdef __MigPackStructs
3924#pragma pack(4)
3925#endif
3926 typedef struct {
3927 mach_msg_header_t Head;
3928 mach_msg_trailer_t trailer;
3929 } Request __attribute__((unused));
3930#ifdef __MigPackStructs
3931#pragma pack()
3932#endif
3933 typedef __Request__io_object_get_retain_count_t __Request;
3934 typedef __Reply__io_object_get_retain_count_t Reply __attribute__((unused));
3935
3936 /*
3937 * typedef struct {
3938 * mach_msg_header_t Head;
3939 * NDR_record_t NDR;
3940 * kern_return_t RetCode;
3941 * } mig_reply_error_t;
3942 */
3943
3944 Request *In0P = (Request *) InHeadP;
3945 Reply *OutP = (Reply *) OutHeadP;
3946#ifdef __MIG_check__Request__io_object_get_retain_count_t__defined
3947 kern_return_t check_result;
3948#endif /* __MIG_check__Request__io_object_get_retain_count_t__defined */
3949
3950#if __MigKernelSpecificCode
3951#else
3952#endif /* __MigKernelSpecificCode */
3953 io_object_t object;
3954
3955 __DeclareRcvRpc(2830, "io_object_get_retain_count")
3956 __BeforeRcvRpc(2830, "io_object_get_retain_count")
3957
3958#if defined(__MIG_check__Request__io_object_get_retain_count_t__defined)
3959 check_result = __MIG_check__Request__io_object_get_retain_count_t((__Request *)In0P);
3960 if (check_result != MACH_MSG_SUCCESS)
3961 { MIG_RETURN_ERROR(OutP, check_result); }
3962#endif /* defined(__MIG_check__Request__io_object_get_retain_count_t__defined) */
3963
3964 object = iokit_lookup_object_port(In0P->Head.msgh_request_port);
3965
3966 OutP->RetCode = is_io_object_get_retain_count(object, &OutP->retainCount);
3967 iokit_remove_reference(object);
3968 if (OutP->RetCode != KERN_SUCCESS) {
3969 MIG_RETURN_ERROR(OutP, OutP->RetCode);
3970 }
3971#if __MigKernelSpecificCode
3972#endif /* __MigKernelSpecificCode */
3973
3974 OutP->NDR = NDR_record;
3975
3976
3977 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
3978 __AfterRcvRpc(2830, "io_object_get_retain_count")
3979}
3980
3981#if ( __MigTypeCheck )
3982#if __MIG_check__Request__iokit_subsystem__
3983#if !defined(__MIG_check__Request__io_service_get_busy_state_t__defined)
3984#define __MIG_check__Request__io_service_get_busy_state_t__defined
3985
3986mig_internal kern_return_t __MIG_check__Request__io_service_get_busy_state_t(__attribute__((__unused__)) __Request__io_service_get_busy_state_t *In0P)
3987{
3988
3989 typedef __Request__io_service_get_busy_state_t __Request;
3990#if __MigTypeCheck
3991 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
3992 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
3993 return MIG_BAD_ARGUMENTS;
3994#endif /* __MigTypeCheck */
3995
3996 return MACH_MSG_SUCCESS;
3997}
3998#endif /* !defined(__MIG_check__Request__io_service_get_busy_state_t__defined) */
3999#endif /* __MIG_check__Request__iokit_subsystem__ */
4000#endif /* ( __MigTypeCheck ) */
4001
4002
4003/* Routine io_service_get_busy_state */
4004mig_internal novalue _Xio_service_get_busy_state
4005 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
4006{
4007
4008#ifdef __MigPackStructs
4009#pragma pack(4)
4010#endif
4011 typedef struct {
4012 mach_msg_header_t Head;
4013 mach_msg_trailer_t trailer;
4014 } Request __attribute__((unused));
4015#ifdef __MigPackStructs
4016#pragma pack()
4017#endif
4018 typedef __Request__io_service_get_busy_state_t __Request;
4019 typedef __Reply__io_service_get_busy_state_t Reply __attribute__((unused));
4020
4021 /*
4022 * typedef struct {
4023 * mach_msg_header_t Head;
4024 * NDR_record_t NDR;
4025 * kern_return_t RetCode;
4026 * } mig_reply_error_t;
4027 */
4028
4029 Request *In0P = (Request *) InHeadP;
4030 Reply *OutP = (Reply *) OutHeadP;
4031#ifdef __MIG_check__Request__io_service_get_busy_state_t__defined
4032 kern_return_t check_result;
4033#endif /* __MIG_check__Request__io_service_get_busy_state_t__defined */
4034
4035#if __MigKernelSpecificCode
4036#else
4037#endif /* __MigKernelSpecificCode */
4038 io_object_t service;
4039
4040 __DeclareRcvRpc(2831, "io_service_get_busy_state")
4041 __BeforeRcvRpc(2831, "io_service_get_busy_state")
4042
4043#if defined(__MIG_check__Request__io_service_get_busy_state_t__defined)
4044 check_result = __MIG_check__Request__io_service_get_busy_state_t((__Request *)In0P);
4045 if (check_result != MACH_MSG_SUCCESS)
4046 { MIG_RETURN_ERROR(OutP, check_result); }
4047#endif /* defined(__MIG_check__Request__io_service_get_busy_state_t__defined) */
4048
4049 service = iokit_lookup_object_port(In0P->Head.msgh_request_port);
4050
4051 OutP->RetCode = is_io_service_get_busy_state(service, &OutP->busyState);
4052 iokit_remove_reference(service);
4053 if (OutP->RetCode != KERN_SUCCESS) {
4054 MIG_RETURN_ERROR(OutP, OutP->RetCode);
4055 }
4056#if __MigKernelSpecificCode
4057#endif /* __MigKernelSpecificCode */
4058
4059 OutP->NDR = NDR_record;
4060
4061
4062 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
4063 __AfterRcvRpc(2831, "io_service_get_busy_state")
4064}
4065
4066#if ( __MigTypeCheck )
4067#if __MIG_check__Request__iokit_subsystem__
4068#if !defined(__MIG_check__Request__io_service_wait_quiet_t__defined)
4069#define __MIG_check__Request__io_service_wait_quiet_t__defined
4070
4071mig_internal kern_return_t __MIG_check__Request__io_service_wait_quiet_t(__attribute__((__unused__)) __Request__io_service_wait_quiet_t *In0P)
4072{
4073
4074 typedef __Request__io_service_wait_quiet_t __Request;
4075#if __MigTypeCheck
4076 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
4077 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
4078 return MIG_BAD_ARGUMENTS;
4079#endif /* __MigTypeCheck */
4080
4081 return MACH_MSG_SUCCESS;
4082}
4083#endif /* !defined(__MIG_check__Request__io_service_wait_quiet_t__defined) */
4084#endif /* __MIG_check__Request__iokit_subsystem__ */
4085#endif /* ( __MigTypeCheck ) */
4086
4087
4088/* Routine io_service_wait_quiet */
4089mig_internal novalue _Xio_service_wait_quiet
4090 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
4091{
4092
4093#ifdef __MigPackStructs
4094#pragma pack(4)
4095#endif
4096 typedef struct {
4097 mach_msg_header_t Head;
4098 NDR_record_t NDR;
4099 mach_timespec_t wait_time;
4100 mach_msg_trailer_t trailer;
4101 } Request __attribute__((unused));
4102#ifdef __MigPackStructs
4103#pragma pack()
4104#endif
4105 typedef __Request__io_service_wait_quiet_t __Request;
4106 typedef __Reply__io_service_wait_quiet_t Reply __attribute__((unused));
4107
4108 /*
4109 * typedef struct {
4110 * mach_msg_header_t Head;
4111 * NDR_record_t NDR;
4112 * kern_return_t RetCode;
4113 * } mig_reply_error_t;
4114 */
4115
4116 Request *In0P = (Request *) InHeadP;
4117 Reply *OutP = (Reply *) OutHeadP;
4118#ifdef __MIG_check__Request__io_service_wait_quiet_t__defined
4119 kern_return_t check_result;
4120#endif /* __MIG_check__Request__io_service_wait_quiet_t__defined */
4121
4122#if __MigKernelSpecificCode
4123#else
4124#endif /* __MigKernelSpecificCode */
4125 io_object_t service;
4126
4127 __DeclareRcvRpc(2832, "io_service_wait_quiet")
4128 __BeforeRcvRpc(2832, "io_service_wait_quiet")
4129
4130#if defined(__MIG_check__Request__io_service_wait_quiet_t__defined)
4131 check_result = __MIG_check__Request__io_service_wait_quiet_t((__Request *)In0P);
4132 if (check_result != MACH_MSG_SUCCESS)
4133 { MIG_RETURN_ERROR(OutP, check_result); }
4134#endif /* defined(__MIG_check__Request__io_service_wait_quiet_t__defined) */
4135
4136 service = iokit_lookup_object_port(In0P->Head.msgh_request_port);
4137
4138 OutP->RetCode = is_io_service_wait_quiet(service, In0P->wait_time);
4139 iokit_remove_reference(service);
4140#if __MigKernelSpecificCode
4141#endif /* __MigKernelSpecificCode */
4142
4143 OutP->NDR = NDR_record;
4144
4145
4146 __AfterRcvRpc(2832, "io_service_wait_quiet")
4147}
4148
4149#if ( __MigTypeCheck )
4150#if __MIG_check__Request__iokit_subsystem__
4151#if !defined(__MIG_check__Request__io_registry_entry_create_iterator_t__defined)
4152#define __MIG_check__Request__io_registry_entry_create_iterator_t__defined
4153
4154mig_internal kern_return_t __MIG_check__Request__io_registry_entry_create_iterator_t(__attribute__((__unused__)) __Request__io_registry_entry_create_iterator_t *In0P, __attribute__((__unused__)) __Request__io_registry_entry_create_iterator_t **In1PP)
4155{
4156
4157 typedef __Request__io_registry_entry_create_iterator_t __Request;
4158 __Request *In1P;
4159#if __MigTypeCheck
4160 unsigned int msgh_size;
4161#endif /* __MigTypeCheck */
4162 unsigned int msgh_size_delta;
4163
4164#if __MigTypeCheck
4165 msgh_size = In0P->Head.msgh_size;
4166 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
4167 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 128)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
4168 return MIG_BAD_ARGUMENTS;
4169#endif /* __MigTypeCheck */
4170
4171#if defined(__NDR_convert__int_rep__Request__io_registry_entry_create_iterator_t__planeCnt__defined)
4172 if (In0P->NDR.int_rep != NDR_record.int_rep)
4173 __NDR_convert__int_rep__Request__io_registry_entry_create_iterator_t__planeCnt(&In0P->planeCnt, In0P->NDR.int_rep);
4174#endif /* __NDR_convert__int_rep__Request__io_registry_entry_create_iterator_t__planeCnt__defined */
4175 msgh_size_delta = _WALIGN_(In0P->planeCnt);
4176#if __MigTypeCheck
4177 if ( In0P->planeCnt > 128 )
4178 return MIG_BAD_ARGUMENTS;
4179 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 128)) < In0P->planeCnt) ||
4180 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 128) + _WALIGN_(In0P->planeCnt)))
4181 return MIG_BAD_ARGUMENTS;
4182#endif /* __MigTypeCheck */
4183
4184 *In1PP = In1P = (__Request *) ((pointer_t) In0P + msgh_size_delta - 128);
4185
4186#if __MigTypeCheck
4187 {
4188 char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
4189#if __MigKernelSpecificCode
4190 size_t strnlen_limit;
4191#else
4192 size_t memchr_limit;
4193#endif /* __MigKernelSpecificCode */
4194
4195#if __MigKernelSpecificCode
4196 strnlen_limit = min((msg_limit - In0P->plane), 128);
4197 if (( strnlen(In0P->plane, strnlen_limit) >= 128 + 1 ))
4198 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
4199#else
4200 memchr_limit = min((msg_limit - In0P->plane), 128);
4201 if (( memchr(In0P->plane, '\0', memchr_limit) == NULL ))
4202 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
4203#endif /* __MigKernelSpecificCode */
4204 }
4205#endif /* __MigTypeCheck */
4206
4207 return MACH_MSG_SUCCESS;
4208}
4209#endif /* !defined(__MIG_check__Request__io_registry_entry_create_iterator_t__defined) */
4210#endif /* __MIG_check__Request__iokit_subsystem__ */
4211#endif /* ( __MigTypeCheck ) */
4212
4213
4214/* Routine io_registry_entry_create_iterator */
4215mig_internal novalue _Xio_registry_entry_create_iterator
4216 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
4217{
4218
4219#ifdef __MigPackStructs
4220#pragma pack(4)
4221#endif
4222 typedef struct {
4223 mach_msg_header_t Head;
4224 NDR_record_t NDR;
4225 mach_msg_type_number_t planeOffset; /* MiG doesn't use it */
4226 mach_msg_type_number_t planeCnt;
4227 char plane[128];
4228 uint32_t options;
4229 mach_msg_trailer_t trailer;
4230 } Request __attribute__((unused));
4231#ifdef __MigPackStructs
4232#pragma pack()
4233#endif
4234 typedef __Request__io_registry_entry_create_iterator_t __Request;
4235 typedef __Reply__io_registry_entry_create_iterator_t Reply __attribute__((unused));
4236
4237 /*
4238 * typedef struct {
4239 * mach_msg_header_t Head;
4240 * NDR_record_t NDR;
4241 * kern_return_t RetCode;
4242 * } mig_reply_error_t;
4243 */
4244
4245 Request *In0P = (Request *) InHeadP;
4246 Request *In1P;
4247 Reply *OutP = (Reply *) OutHeadP;
4248#ifdef __MIG_check__Request__io_registry_entry_create_iterator_t__defined
4249 kern_return_t check_result;
4250#endif /* __MIG_check__Request__io_registry_entry_create_iterator_t__defined */
4251
4252#if __MigKernelSpecificCode
4253#if UseStaticTemplates
4254 const static mach_msg_port_descriptor_t iteratorTemplate = {
4255 /* name = */ MACH_PORT_NULL,
4256 /* pad1 = */ 0,
4257 /* pad2 = */ 0,
4258 /* disp = */ 17,
4259 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
4260 };
4261#endif /* UseStaticTemplates */
4262
4263#else
4264#if UseStaticTemplates
4265 const static mach_msg_port_descriptor_t iteratorTemplate = {
4266 /* name = */ MACH_PORT_NULL,
4267 /* pad1 = */ 0,
4268 /* pad2 = */ 0,
4269 /* disp = */ 19,
4270 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
4271 };
4272#endif /* UseStaticTemplates */
4273
4274#endif /* __MigKernelSpecificCode */
4275 kern_return_t RetCode;
4276 io_object_t registry_entry;
4277 io_object_t iterator;
4278
4279 __DeclareRcvRpc(2833, "io_registry_entry_create_iterator")
4280 __BeforeRcvRpc(2833, "io_registry_entry_create_iterator")
4281
4282#if defined(__MIG_check__Request__io_registry_entry_create_iterator_t__defined)
4283 check_result = __MIG_check__Request__io_registry_entry_create_iterator_t((__Request *)In0P, (__Request **)&In1P);
4284 if (check_result != MACH_MSG_SUCCESS)
4285 { MIG_RETURN_ERROR(OutP, check_result); }
4286#endif /* defined(__MIG_check__Request__io_registry_entry_create_iterator_t__defined) */
4287
4288#if UseStaticTemplates
4289 OutP->iterator = iteratorTemplate;
4290#else /* UseStaticTemplates */
4291#if __MigKernelSpecificCode
4292 OutP->iterator.disposition = 17;
4293#else
4294 OutP->iterator.disposition = 19;
4295#endif /* __MigKernelSpecificCode */
4296#if !(defined(KERNEL) && defined(__LP64__))
4297 OutP->iterator.pad1 = 0;
4298#endif
4299 OutP->iterator.pad2 = 0;
4300 OutP->iterator.type = MACH_MSG_PORT_DESCRIPTOR;
4301#if defined(KERNEL)
4302 OutP->iterator.pad_end = 0;
4303#endif
4304#endif /* UseStaticTemplates */
4305
4306
4307 registry_entry = iokit_lookup_object_port(In0P->Head.msgh_request_port);
4308
4309 RetCode = is_io_registry_entry_create_iterator(registry_entry, In0P->plane, In1P->options, &iterator);
4310 iokit_remove_reference(registry_entry);
4311 if (RetCode != KERN_SUCCESS) {
4312 MIG_RETURN_ERROR(OutP, RetCode);
4313 }
4314#if __MigKernelSpecificCode
4315#endif /* __MigKernelSpecificCode */
4316 OutP->iterator.name = (mach_port_t)iokit_make_object_port(iterator);
4317
4318
4319 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
4320 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
4321 OutP->msgh_body.msgh_descriptor_count = 1;
4322 __AfterRcvRpc(2833, "io_registry_entry_create_iterator")
4323}
4324
4325#if ( __MigTypeCheck )
4326#if __MIG_check__Request__iokit_subsystem__
4327#if !defined(__MIG_check__Request__io_iterator_is_valid_t__defined)
4328#define __MIG_check__Request__io_iterator_is_valid_t__defined
4329
4330mig_internal kern_return_t __MIG_check__Request__io_iterator_is_valid_t(__attribute__((__unused__)) __Request__io_iterator_is_valid_t *In0P)
4331{
4332
4333 typedef __Request__io_iterator_is_valid_t __Request;
4334#if __MigTypeCheck
4335 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
4336 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
4337 return MIG_BAD_ARGUMENTS;
4338#endif /* __MigTypeCheck */
4339
4340 return MACH_MSG_SUCCESS;
4341}
4342#endif /* !defined(__MIG_check__Request__io_iterator_is_valid_t__defined) */
4343#endif /* __MIG_check__Request__iokit_subsystem__ */
4344#endif /* ( __MigTypeCheck ) */
4345
4346
4347/* Routine io_iterator_is_valid */
4348mig_internal novalue _Xio_iterator_is_valid
4349 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
4350{
4351
4352#ifdef __MigPackStructs
4353#pragma pack(4)
4354#endif
4355 typedef struct {
4356 mach_msg_header_t Head;
4357 mach_msg_trailer_t trailer;
4358 } Request __attribute__((unused));
4359#ifdef __MigPackStructs
4360#pragma pack()
4361#endif
4362 typedef __Request__io_iterator_is_valid_t __Request;
4363 typedef __Reply__io_iterator_is_valid_t Reply __attribute__((unused));
4364
4365 /*
4366 * typedef struct {
4367 * mach_msg_header_t Head;
4368 * NDR_record_t NDR;
4369 * kern_return_t RetCode;
4370 * } mig_reply_error_t;
4371 */
4372
4373 Request *In0P = (Request *) InHeadP;
4374 Reply *OutP = (Reply *) OutHeadP;
4375#ifdef __MIG_check__Request__io_iterator_is_valid_t__defined
4376 kern_return_t check_result;
4377#endif /* __MIG_check__Request__io_iterator_is_valid_t__defined */
4378
4379#if __MigKernelSpecificCode
4380#else
4381#endif /* __MigKernelSpecificCode */
4382 io_object_t iterator;
4383
4384 __DeclareRcvRpc(2834, "io_iterator_is_valid")
4385 __BeforeRcvRpc(2834, "io_iterator_is_valid")
4386
4387#if defined(__MIG_check__Request__io_iterator_is_valid_t__defined)
4388 check_result = __MIG_check__Request__io_iterator_is_valid_t((__Request *)In0P);
4389 if (check_result != MACH_MSG_SUCCESS)
4390 { MIG_RETURN_ERROR(OutP, check_result); }
4391#endif /* defined(__MIG_check__Request__io_iterator_is_valid_t__defined) */
4392
4393 iterator = iokit_lookup_object_port(In0P->Head.msgh_request_port);
4394
4395 OutP->RetCode = is_io_iterator_is_valid(iterator, &OutP->is_valid);
4396 iokit_remove_reference(iterator);
4397 if (OutP->RetCode != KERN_SUCCESS) {
4398 MIG_RETURN_ERROR(OutP, OutP->RetCode);
4399 }
4400#if __MigKernelSpecificCode
4401#endif /* __MigKernelSpecificCode */
4402
4403 OutP->NDR = NDR_record;
4404
4405
4406 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
4407 __AfterRcvRpc(2834, "io_iterator_is_valid")
4408}
4409
4410#if ( __MigTypeCheck )
4411#if __MIG_check__Request__iokit_subsystem__
4412#if !defined(__MIG_check__Request__io_catalog_send_data_t__defined)
4413#define __MIG_check__Request__io_catalog_send_data_t__defined
4414
4415mig_internal kern_return_t __MIG_check__Request__io_catalog_send_data_t(__attribute__((__unused__)) __Request__io_catalog_send_data_t *In0P)
4416{
4417
4418 typedef __Request__io_catalog_send_data_t __Request;
4419#if __MigTypeCheck
4420 if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
4421 (In0P->msgh_body.msgh_descriptor_count != 1) ||
4422 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
4423 return MIG_BAD_ARGUMENTS;
4424#endif /* __MigTypeCheck */
4425
4426#if __MigTypeCheck
4427 if (In0P->inData.type != MACH_MSG_OOL_DESCRIPTOR)
4428 return MIG_TYPE_ERROR;
4429#endif /* __MigTypeCheck */
4430
4431#if __MigTypeCheck
4432 if (In0P->inData.size != In0P->inDataCnt)
4433 return MIG_TYPE_ERROR;
4434#endif /* __MigTypeCheck */
4435
4436 return MACH_MSG_SUCCESS;
4437}
4438#endif /* !defined(__MIG_check__Request__io_catalog_send_data_t__defined) */
4439#endif /* __MIG_check__Request__iokit_subsystem__ */
4440#endif /* ( __MigTypeCheck ) */
4441
4442
4443/* Routine io_catalog_send_data */
4444mig_internal novalue _Xio_catalog_send_data
4445 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
4446{
4447
4448#ifdef __MigPackStructs
4449#pragma pack(4)
4450#endif
4451 typedef struct {
4452 mach_msg_header_t Head;
4453 /* start of the kernel processed data */
4454 mach_msg_body_t msgh_body;
4455 mach_msg_ool_descriptor_t inData;
4456 /* end of the kernel processed data */
4457 NDR_record_t NDR;
4458 uint32_t flag;
4459 mach_msg_type_number_t inDataCnt;
4460 mach_msg_trailer_t trailer;
4461 } Request __attribute__((unused));
4462#ifdef __MigPackStructs
4463#pragma pack()
4464#endif
4465 typedef __Request__io_catalog_send_data_t __Request;
4466 typedef __Reply__io_catalog_send_data_t Reply __attribute__((unused));
4467
4468 /*
4469 * typedef struct {
4470 * mach_msg_header_t Head;
4471 * NDR_record_t NDR;
4472 * kern_return_t RetCode;
4473 * } mig_reply_error_t;
4474 */
4475
4476 Request *In0P = (Request *) InHeadP;
4477 Reply *OutP = (Reply *) OutHeadP;
4478#ifdef __MIG_check__Request__io_catalog_send_data_t__defined
4479 kern_return_t check_result;
4480#endif /* __MIG_check__Request__io_catalog_send_data_t__defined */
4481
4482#if __MigKernelSpecificCode
4483#else
4484#endif /* __MigKernelSpecificCode */
4485 __DeclareRcvRpc(2836, "io_catalog_send_data")
4486 __BeforeRcvRpc(2836, "io_catalog_send_data")
4487
4488#if defined(__MIG_check__Request__io_catalog_send_data_t__defined)
4489 check_result = __MIG_check__Request__io_catalog_send_data_t((__Request *)In0P);
4490 if (check_result != MACH_MSG_SUCCESS)
4491 { MIG_RETURN_ERROR(OutP, check_result); }
4492#endif /* defined(__MIG_check__Request__io_catalog_send_data_t__defined) */
4493
4494 OutP->RetCode = is_io_catalog_send_data(In0P->Head.msgh_request_port, In0P->flag, (io_buf_ptr_t)(In0P->inData.address), In0P->inData.size, &OutP->result);
4495 if (OutP->RetCode != KERN_SUCCESS) {
4496 MIG_RETURN_ERROR(OutP, OutP->RetCode);
4497 }
4498#if __MigKernelSpecificCode
4499#endif /* __MigKernelSpecificCode */
4500
4501 OutP->NDR = NDR_record;
4502
4503
4504 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
4505 __AfterRcvRpc(2836, "io_catalog_send_data")
4506}
4507
4508#if ( __MigTypeCheck )
4509#if __MIG_check__Request__iokit_subsystem__
4510#if !defined(__MIG_check__Request__io_catalog_terminate_t__defined)
4511#define __MIG_check__Request__io_catalog_terminate_t__defined
4512
4513mig_internal kern_return_t __MIG_check__Request__io_catalog_terminate_t(__attribute__((__unused__)) __Request__io_catalog_terminate_t *In0P)
4514{
4515
4516 typedef __Request__io_catalog_terminate_t __Request;
4517#if __MigTypeCheck
4518 unsigned int msgh_size;
4519#endif /* __MigTypeCheck */
4520
4521#if __MigTypeCheck
4522 msgh_size = In0P->Head.msgh_size;
4523 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
4524 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 128)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
4525 return MIG_BAD_ARGUMENTS;
4526#endif /* __MigTypeCheck */
4527
4528#if defined(__NDR_convert__int_rep__Request__io_catalog_terminate_t__nameCnt__defined)
4529 if (In0P->NDR.int_rep != NDR_record.int_rep)
4530 __NDR_convert__int_rep__Request__io_catalog_terminate_t__nameCnt(&In0P->nameCnt, In0P->NDR.int_rep);
4531#endif /* __NDR_convert__int_rep__Request__io_catalog_terminate_t__nameCnt__defined */
4532#if __MigTypeCheck
4533 if ( In0P->nameCnt > 128 )
4534 return MIG_BAD_ARGUMENTS;
4535 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 128)) < In0P->nameCnt) ||
4536 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 128) + _WALIGN_(In0P->nameCnt)))
4537 return MIG_BAD_ARGUMENTS;
4538#endif /* __MigTypeCheck */
4539
4540#if __MigTypeCheck
4541 {
4542 char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
4543#if __MigKernelSpecificCode
4544 size_t strnlen_limit;
4545#else
4546 size_t memchr_limit;
4547#endif /* __MigKernelSpecificCode */
4548
4549#if __MigKernelSpecificCode
4550 strnlen_limit = min((msg_limit - In0P->name), 128);
4551 if (( strnlen(In0P->name, strnlen_limit) >= 128 + 1 ))
4552 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
4553#else
4554 memchr_limit = min((msg_limit - In0P->name), 128);
4555 if (( memchr(In0P->name, '\0', memchr_limit) == NULL ))
4556 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
4557#endif /* __MigKernelSpecificCode */
4558 }
4559#endif /* __MigTypeCheck */
4560
4561 return MACH_MSG_SUCCESS;
4562}
4563#endif /* !defined(__MIG_check__Request__io_catalog_terminate_t__defined) */
4564#endif /* __MIG_check__Request__iokit_subsystem__ */
4565#endif /* ( __MigTypeCheck ) */
4566
4567
4568/* Routine io_catalog_terminate */
4569mig_internal novalue _Xio_catalog_terminate
4570 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
4571{
4572
4573#ifdef __MigPackStructs
4574#pragma pack(4)
4575#endif
4576 typedef struct {
4577 mach_msg_header_t Head;
4578 NDR_record_t NDR;
4579 uint32_t flag;
4580 mach_msg_type_number_t nameOffset; /* MiG doesn't use it */
4581 mach_msg_type_number_t nameCnt;
4582 char name[128];
4583 mach_msg_trailer_t trailer;
4584 } Request __attribute__((unused));
4585#ifdef __MigPackStructs
4586#pragma pack()
4587#endif
4588 typedef __Request__io_catalog_terminate_t __Request;
4589 typedef __Reply__io_catalog_terminate_t Reply __attribute__((unused));
4590
4591 /*
4592 * typedef struct {
4593 * mach_msg_header_t Head;
4594 * NDR_record_t NDR;
4595 * kern_return_t RetCode;
4596 * } mig_reply_error_t;
4597 */
4598
4599 Request *In0P = (Request *) InHeadP;
4600 Reply *OutP = (Reply *) OutHeadP;
4601#ifdef __MIG_check__Request__io_catalog_terminate_t__defined
4602 kern_return_t check_result;
4603#endif /* __MIG_check__Request__io_catalog_terminate_t__defined */
4604
4605#if __MigKernelSpecificCode
4606#else
4607#endif /* __MigKernelSpecificCode */
4608 __DeclareRcvRpc(2837, "io_catalog_terminate")
4609 __BeforeRcvRpc(2837, "io_catalog_terminate")
4610
4611#if defined(__MIG_check__Request__io_catalog_terminate_t__defined)
4612 check_result = __MIG_check__Request__io_catalog_terminate_t((__Request *)In0P);
4613 if (check_result != MACH_MSG_SUCCESS)
4614 { MIG_RETURN_ERROR(OutP, check_result); }
4615#endif /* defined(__MIG_check__Request__io_catalog_terminate_t__defined) */
4616
4617 OutP->RetCode = is_io_catalog_terminate(In0P->Head.msgh_request_port, In0P->flag, In0P->name);
4618#if __MigKernelSpecificCode
4619#endif /* __MigKernelSpecificCode */
4620
4621 OutP->NDR = NDR_record;
4622
4623
4624 __AfterRcvRpc(2837, "io_catalog_terminate")
4625}
4626
4627#if ( __MigTypeCheck )
4628#if __MIG_check__Request__iokit_subsystem__
4629#if !defined(__MIG_check__Request__io_catalog_get_data_t__defined)
4630#define __MIG_check__Request__io_catalog_get_data_t__defined
4631
4632mig_internal kern_return_t __MIG_check__Request__io_catalog_get_data_t(__attribute__((__unused__)) __Request__io_catalog_get_data_t *In0P)
4633{
4634
4635 typedef __Request__io_catalog_get_data_t __Request;
4636#if __MigTypeCheck
4637 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
4638 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
4639 return MIG_BAD_ARGUMENTS;
4640#endif /* __MigTypeCheck */
4641
4642 return MACH_MSG_SUCCESS;
4643}
4644#endif /* !defined(__MIG_check__Request__io_catalog_get_data_t__defined) */
4645#endif /* __MIG_check__Request__iokit_subsystem__ */
4646#endif /* ( __MigTypeCheck ) */
4647
4648
4649/* Routine io_catalog_get_data */
4650mig_internal novalue _Xio_catalog_get_data
4651 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
4652{
4653
4654#ifdef __MigPackStructs
4655#pragma pack(4)
4656#endif
4657 typedef struct {
4658 mach_msg_header_t Head;
4659 NDR_record_t NDR;
4660 uint32_t flag;
4661 mach_msg_trailer_t trailer;
4662 } Request __attribute__((unused));
4663#ifdef __MigPackStructs
4664#pragma pack()
4665#endif
4666 typedef __Request__io_catalog_get_data_t __Request;
4667 typedef __Reply__io_catalog_get_data_t Reply __attribute__((unused));
4668
4669 /*
4670 * typedef struct {
4671 * mach_msg_header_t Head;
4672 * NDR_record_t NDR;
4673 * kern_return_t RetCode;
4674 * } mig_reply_error_t;
4675 */
4676
4677 Request *In0P = (Request *) InHeadP;
4678 Reply *OutP = (Reply *) OutHeadP;
4679#ifdef __MIG_check__Request__io_catalog_get_data_t__defined
4680 kern_return_t check_result;
4681#endif /* __MIG_check__Request__io_catalog_get_data_t__defined */
4682
4683#if __MigKernelSpecificCode
4684#if UseStaticTemplates
4685 const static mach_msg_ool_descriptor_t outDataTemplate = {
4686 /* addr = */ (void *)0,
4687 /* size = */ 0,
4688 /* deal = */ FALSE,
4689 /* copy = */ MACH_MSG_VIRTUAL_COPY,
4690 /* pad2 = */ 0,
4691 /* type = */ MACH_MSG_OOL_DESCRIPTOR,
4692 };
4693#endif /* UseStaticTemplates */
4694
4695#else
4696#if UseStaticTemplates
4697 const static mach_msg_ool_descriptor_t outDataTemplate = {
4698 /* addr = */ (void *)0,
4699 /* size = */ 0,
4700 /* deal = */ FALSE,
4701 /* copy = */ MACH_MSG_VIRTUAL_COPY,
4702 /* pad2 = */ 0,
4703 /* type = */ MACH_MSG_OOL_DESCRIPTOR,
4704 };
4705#endif /* UseStaticTemplates */
4706
4707#endif /* __MigKernelSpecificCode */
4708 kern_return_t RetCode;
4709 __DeclareRcvRpc(2838, "io_catalog_get_data")
4710 __BeforeRcvRpc(2838, "io_catalog_get_data")
4711
4712#if defined(__MIG_check__Request__io_catalog_get_data_t__defined)
4713 check_result = __MIG_check__Request__io_catalog_get_data_t((__Request *)In0P);
4714 if (check_result != MACH_MSG_SUCCESS)
4715 { MIG_RETURN_ERROR(OutP, check_result); }
4716#endif /* defined(__MIG_check__Request__io_catalog_get_data_t__defined) */
4717
4718#if UseStaticTemplates
4719 OutP->outData = outDataTemplate;
4720#else /* UseStaticTemplates */
4721 OutP->outData.deallocate = FALSE;
4722 OutP->outData.copy = MACH_MSG_VIRTUAL_COPY;
4723 OutP->outData.pad1 = 0;
4724 OutP->outData.type = MACH_MSG_OOL_DESCRIPTOR;
4725#if defined(KERNEL) && !defined(__LP64__)
4726 OutP->outData.pad_end = 0;
4727#endif
4728#endif /* UseStaticTemplates */
4729
4730
4731 RetCode = is_io_catalog_get_data(In0P->Head.msgh_request_port, In0P->flag, (io_buf_ptr_t *)&(OutP->outData.address), &OutP->outDataCnt);
4732 if (RetCode != KERN_SUCCESS) {
4733 MIG_RETURN_ERROR(OutP, RetCode);
4734 }
4735#if __MigKernelSpecificCode
4736#endif /* __MigKernelSpecificCode */
4737 OutP->outData.size = OutP->outDataCnt;
4738
4739
4740 OutP->NDR = NDR_record;
4741
4742
4743 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
4744 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
4745 OutP->msgh_body.msgh_descriptor_count = 1;
4746 __AfterRcvRpc(2838, "io_catalog_get_data")
4747}
4748
4749#if ( __MigTypeCheck )
4750#if __MIG_check__Request__iokit_subsystem__
4751#if !defined(__MIG_check__Request__io_catalog_get_gen_count_t__defined)
4752#define __MIG_check__Request__io_catalog_get_gen_count_t__defined
4753
4754mig_internal kern_return_t __MIG_check__Request__io_catalog_get_gen_count_t(__attribute__((__unused__)) __Request__io_catalog_get_gen_count_t *In0P)
4755{
4756
4757 typedef __Request__io_catalog_get_gen_count_t __Request;
4758#if __MigTypeCheck
4759 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
4760 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
4761 return MIG_BAD_ARGUMENTS;
4762#endif /* __MigTypeCheck */
4763
4764 return MACH_MSG_SUCCESS;
4765}
4766#endif /* !defined(__MIG_check__Request__io_catalog_get_gen_count_t__defined) */
4767#endif /* __MIG_check__Request__iokit_subsystem__ */
4768#endif /* ( __MigTypeCheck ) */
4769
4770
4771/* Routine io_catalog_get_gen_count */
4772mig_internal novalue _Xio_catalog_get_gen_count
4773 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
4774{
4775
4776#ifdef __MigPackStructs
4777#pragma pack(4)
4778#endif
4779 typedef struct {
4780 mach_msg_header_t Head;
4781 mach_msg_trailer_t trailer;
4782 } Request __attribute__((unused));
4783#ifdef __MigPackStructs
4784#pragma pack()
4785#endif
4786 typedef __Request__io_catalog_get_gen_count_t __Request;
4787 typedef __Reply__io_catalog_get_gen_count_t Reply __attribute__((unused));
4788
4789 /*
4790 * typedef struct {
4791 * mach_msg_header_t Head;
4792 * NDR_record_t NDR;
4793 * kern_return_t RetCode;
4794 * } mig_reply_error_t;
4795 */
4796
4797 Request *In0P = (Request *) InHeadP;
4798 Reply *OutP = (Reply *) OutHeadP;
4799#ifdef __MIG_check__Request__io_catalog_get_gen_count_t__defined
4800 kern_return_t check_result;
4801#endif /* __MIG_check__Request__io_catalog_get_gen_count_t__defined */
4802
4803#if __MigKernelSpecificCode
4804#else
4805#endif /* __MigKernelSpecificCode */
4806 __DeclareRcvRpc(2839, "io_catalog_get_gen_count")
4807 __BeforeRcvRpc(2839, "io_catalog_get_gen_count")
4808
4809#if defined(__MIG_check__Request__io_catalog_get_gen_count_t__defined)
4810 check_result = __MIG_check__Request__io_catalog_get_gen_count_t((__Request *)In0P);
4811 if (check_result != MACH_MSG_SUCCESS)
4812 { MIG_RETURN_ERROR(OutP, check_result); }
4813#endif /* defined(__MIG_check__Request__io_catalog_get_gen_count_t__defined) */
4814
4815 OutP->RetCode = is_io_catalog_get_gen_count(In0P->Head.msgh_request_port, &OutP->genCount);
4816 if (OutP->RetCode != KERN_SUCCESS) {
4817 MIG_RETURN_ERROR(OutP, OutP->RetCode);
4818 }
4819#if __MigKernelSpecificCode
4820#endif /* __MigKernelSpecificCode */
4821
4822 OutP->NDR = NDR_record;
4823
4824
4825 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
4826 __AfterRcvRpc(2839, "io_catalog_get_gen_count")
4827}
4828
4829#if ( __MigTypeCheck )
4830#if __MIG_check__Request__iokit_subsystem__
4831#if !defined(__MIG_check__Request__io_catalog_module_loaded_t__defined)
4832#define __MIG_check__Request__io_catalog_module_loaded_t__defined
4833
4834mig_internal kern_return_t __MIG_check__Request__io_catalog_module_loaded_t(__attribute__((__unused__)) __Request__io_catalog_module_loaded_t *In0P)
4835{
4836
4837 typedef __Request__io_catalog_module_loaded_t __Request;
4838#if __MigTypeCheck
4839 unsigned int msgh_size;
4840#endif /* __MigTypeCheck */
4841
4842#if __MigTypeCheck
4843 msgh_size = In0P->Head.msgh_size;
4844 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
4845 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 128)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
4846 return MIG_BAD_ARGUMENTS;
4847#endif /* __MigTypeCheck */
4848
4849#if defined(__NDR_convert__int_rep__Request__io_catalog_module_loaded_t__nameCnt__defined)
4850 if (In0P->NDR.int_rep != NDR_record.int_rep)
4851 __NDR_convert__int_rep__Request__io_catalog_module_loaded_t__nameCnt(&In0P->nameCnt, In0P->NDR.int_rep);
4852#endif /* __NDR_convert__int_rep__Request__io_catalog_module_loaded_t__nameCnt__defined */
4853#if __MigTypeCheck
4854 if ( In0P->nameCnt > 128 )
4855 return MIG_BAD_ARGUMENTS;
4856 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 128)) < In0P->nameCnt) ||
4857 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 128) + _WALIGN_(In0P->nameCnt)))
4858 return MIG_BAD_ARGUMENTS;
4859#endif /* __MigTypeCheck */
4860
4861#if __MigTypeCheck
4862 {
4863 char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
4864#if __MigKernelSpecificCode
4865 size_t strnlen_limit;
4866#else
4867 size_t memchr_limit;
4868#endif /* __MigKernelSpecificCode */
4869
4870#if __MigKernelSpecificCode
4871 strnlen_limit = min((msg_limit - In0P->name), 128);
4872 if (( strnlen(In0P->name, strnlen_limit) >= 128 + 1 ))
4873 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
4874#else
4875 memchr_limit = min((msg_limit - In0P->name), 128);
4876 if (( memchr(In0P->name, '\0', memchr_limit) == NULL ))
4877 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
4878#endif /* __MigKernelSpecificCode */
4879 }
4880#endif /* __MigTypeCheck */
4881
4882 return MACH_MSG_SUCCESS;
4883}
4884#endif /* !defined(__MIG_check__Request__io_catalog_module_loaded_t__defined) */
4885#endif /* __MIG_check__Request__iokit_subsystem__ */
4886#endif /* ( __MigTypeCheck ) */
4887
4888
4889/* Routine io_catalog_module_loaded */
4890mig_internal novalue _Xio_catalog_module_loaded
4891 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
4892{
4893
4894#ifdef __MigPackStructs
4895#pragma pack(4)
4896#endif
4897 typedef struct {
4898 mach_msg_header_t Head;
4899 NDR_record_t NDR;
4900 mach_msg_type_number_t nameOffset; /* MiG doesn't use it */
4901 mach_msg_type_number_t nameCnt;
4902 char name[128];
4903 mach_msg_trailer_t trailer;
4904 } Request __attribute__((unused));
4905#ifdef __MigPackStructs
4906#pragma pack()
4907#endif
4908 typedef __Request__io_catalog_module_loaded_t __Request;
4909 typedef __Reply__io_catalog_module_loaded_t Reply __attribute__((unused));
4910
4911 /*
4912 * typedef struct {
4913 * mach_msg_header_t Head;
4914 * NDR_record_t NDR;
4915 * kern_return_t RetCode;
4916 * } mig_reply_error_t;
4917 */
4918
4919 Request *In0P = (Request *) InHeadP;
4920 Reply *OutP = (Reply *) OutHeadP;
4921#ifdef __MIG_check__Request__io_catalog_module_loaded_t__defined
4922 kern_return_t check_result;
4923#endif /* __MIG_check__Request__io_catalog_module_loaded_t__defined */
4924
4925#if __MigKernelSpecificCode
4926#else
4927#endif /* __MigKernelSpecificCode */
4928 __DeclareRcvRpc(2840, "io_catalog_module_loaded")
4929 __BeforeRcvRpc(2840, "io_catalog_module_loaded")
4930
4931#if defined(__MIG_check__Request__io_catalog_module_loaded_t__defined)
4932 check_result = __MIG_check__Request__io_catalog_module_loaded_t((__Request *)In0P);
4933 if (check_result != MACH_MSG_SUCCESS)
4934 { MIG_RETURN_ERROR(OutP, check_result); }
4935#endif /* defined(__MIG_check__Request__io_catalog_module_loaded_t__defined) */
4936
4937 OutP->RetCode = is_io_catalog_module_loaded(In0P->Head.msgh_request_port, In0P->name);
4938#if __MigKernelSpecificCode
4939#endif /* __MigKernelSpecificCode */
4940
4941 OutP->NDR = NDR_record;
4942
4943
4944 __AfterRcvRpc(2840, "io_catalog_module_loaded")
4945}
4946
4947#if ( __MigTypeCheck )
4948#if __MIG_check__Request__iokit_subsystem__
4949#if !defined(__MIG_check__Request__io_catalog_reset_t__defined)
4950#define __MIG_check__Request__io_catalog_reset_t__defined
4951
4952mig_internal kern_return_t __MIG_check__Request__io_catalog_reset_t(__attribute__((__unused__)) __Request__io_catalog_reset_t *In0P)
4953{
4954
4955 typedef __Request__io_catalog_reset_t __Request;
4956#if __MigTypeCheck
4957 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
4958 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
4959 return MIG_BAD_ARGUMENTS;
4960#endif /* __MigTypeCheck */
4961
4962 return MACH_MSG_SUCCESS;
4963}
4964#endif /* !defined(__MIG_check__Request__io_catalog_reset_t__defined) */
4965#endif /* __MIG_check__Request__iokit_subsystem__ */
4966#endif /* ( __MigTypeCheck ) */
4967
4968
4969/* Routine io_catalog_reset */
4970mig_internal novalue _Xio_catalog_reset
4971 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
4972{
4973
4974#ifdef __MigPackStructs
4975#pragma pack(4)
4976#endif
4977 typedef struct {
4978 mach_msg_header_t Head;
4979 NDR_record_t NDR;
4980 uint32_t flag;
4981 mach_msg_trailer_t trailer;
4982 } Request __attribute__((unused));
4983#ifdef __MigPackStructs
4984#pragma pack()
4985#endif
4986 typedef __Request__io_catalog_reset_t __Request;
4987 typedef __Reply__io_catalog_reset_t Reply __attribute__((unused));
4988
4989 /*
4990 * typedef struct {
4991 * mach_msg_header_t Head;
4992 * NDR_record_t NDR;
4993 * kern_return_t RetCode;
4994 * } mig_reply_error_t;
4995 */
4996
4997 Request *In0P = (Request *) InHeadP;
4998 Reply *OutP = (Reply *) OutHeadP;
4999#ifdef __MIG_check__Request__io_catalog_reset_t__defined
5000 kern_return_t check_result;
5001#endif /* __MIG_check__Request__io_catalog_reset_t__defined */
5002
5003#if __MigKernelSpecificCode
5004#else
5005#endif /* __MigKernelSpecificCode */
5006 __DeclareRcvRpc(2841, "io_catalog_reset")
5007 __BeforeRcvRpc(2841, "io_catalog_reset")
5008
5009#if defined(__MIG_check__Request__io_catalog_reset_t__defined)
5010 check_result = __MIG_check__Request__io_catalog_reset_t((__Request *)In0P);
5011 if (check_result != MACH_MSG_SUCCESS)
5012 { MIG_RETURN_ERROR(OutP, check_result); }
5013#endif /* defined(__MIG_check__Request__io_catalog_reset_t__defined) */
5014
5015 OutP->RetCode = is_io_catalog_reset(In0P->Head.msgh_request_port, In0P->flag);
5016#if __MigKernelSpecificCode
5017#endif /* __MigKernelSpecificCode */
5018
5019 OutP->NDR = NDR_record;
5020
5021
5022 __AfterRcvRpc(2841, "io_catalog_reset")
5023}
5024
5025#if ( __MigTypeCheck )
5026#if __MIG_check__Request__iokit_subsystem__
5027#if !defined(__MIG_check__Request__io_service_request_probe_t__defined)
5028#define __MIG_check__Request__io_service_request_probe_t__defined
5029
5030mig_internal kern_return_t __MIG_check__Request__io_service_request_probe_t(__attribute__((__unused__)) __Request__io_service_request_probe_t *In0P)
5031{
5032
5033 typedef __Request__io_service_request_probe_t __Request;
5034#if __MigTypeCheck
5035 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
5036 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
5037 return MIG_BAD_ARGUMENTS;
5038#endif /* __MigTypeCheck */
5039
5040 return MACH_MSG_SUCCESS;
5041}
5042#endif /* !defined(__MIG_check__Request__io_service_request_probe_t__defined) */
5043#endif /* __MIG_check__Request__iokit_subsystem__ */
5044#endif /* ( __MigTypeCheck ) */
5045
5046
5047/* Routine io_service_request_probe */
5048mig_internal novalue _Xio_service_request_probe
5049 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
5050{
5051
5052#ifdef __MigPackStructs
5053#pragma pack(4)
5054#endif
5055 typedef struct {
5056 mach_msg_header_t Head;
5057 NDR_record_t NDR;
5058 uint32_t options;
5059 mach_msg_trailer_t trailer;
5060 } Request __attribute__((unused));
5061#ifdef __MigPackStructs
5062#pragma pack()
5063#endif
5064 typedef __Request__io_service_request_probe_t __Request;
5065 typedef __Reply__io_service_request_probe_t Reply __attribute__((unused));
5066
5067 /*
5068 * typedef struct {
5069 * mach_msg_header_t Head;
5070 * NDR_record_t NDR;
5071 * kern_return_t RetCode;
5072 * } mig_reply_error_t;
5073 */
5074
5075 Request *In0P = (Request *) InHeadP;
5076 Reply *OutP = (Reply *) OutHeadP;
5077#ifdef __MIG_check__Request__io_service_request_probe_t__defined
5078 kern_return_t check_result;
5079#endif /* __MIG_check__Request__io_service_request_probe_t__defined */
5080
5081#if __MigKernelSpecificCode
5082#else
5083#endif /* __MigKernelSpecificCode */
5084 io_object_t service;
5085
5086 __DeclareRcvRpc(2842, "io_service_request_probe")
5087 __BeforeRcvRpc(2842, "io_service_request_probe")
5088
5089#if defined(__MIG_check__Request__io_service_request_probe_t__defined)
5090 check_result = __MIG_check__Request__io_service_request_probe_t((__Request *)In0P);
5091 if (check_result != MACH_MSG_SUCCESS)
5092 { MIG_RETURN_ERROR(OutP, check_result); }
5093#endif /* defined(__MIG_check__Request__io_service_request_probe_t__defined) */
5094
5095 service = iokit_lookup_object_port(In0P->Head.msgh_request_port);
5096
5097 OutP->RetCode = is_io_service_request_probe(service, In0P->options);
5098 iokit_remove_reference(service);
5099#if __MigKernelSpecificCode
5100#endif /* __MigKernelSpecificCode */
5101
5102 OutP->NDR = NDR_record;
5103
5104
5105 __AfterRcvRpc(2842, "io_service_request_probe")
5106}
5107
5108#if ( __MigTypeCheck )
5109#if __MIG_check__Request__iokit_subsystem__
5110#if !defined(__MIG_check__Request__io_registry_entry_get_name_in_plane_t__defined)
5111#define __MIG_check__Request__io_registry_entry_get_name_in_plane_t__defined
5112
5113mig_internal kern_return_t __MIG_check__Request__io_registry_entry_get_name_in_plane_t(__attribute__((__unused__)) __Request__io_registry_entry_get_name_in_plane_t *In0P)
5114{
5115
5116 typedef __Request__io_registry_entry_get_name_in_plane_t __Request;
5117#if __MigTypeCheck
5118 unsigned int msgh_size;
5119#endif /* __MigTypeCheck */
5120
5121#if __MigTypeCheck
5122 msgh_size = In0P->Head.msgh_size;
5123 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
5124 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 128)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
5125 return MIG_BAD_ARGUMENTS;
5126#endif /* __MigTypeCheck */
5127
5128#if defined(__NDR_convert__int_rep__Request__io_registry_entry_get_name_in_plane_t__planeCnt__defined)
5129 if (In0P->NDR.int_rep != NDR_record.int_rep)
5130 __NDR_convert__int_rep__Request__io_registry_entry_get_name_in_plane_t__planeCnt(&In0P->planeCnt, In0P->NDR.int_rep);
5131#endif /* __NDR_convert__int_rep__Request__io_registry_entry_get_name_in_plane_t__planeCnt__defined */
5132#if __MigTypeCheck
5133 if ( In0P->planeCnt > 128 )
5134 return MIG_BAD_ARGUMENTS;
5135 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 128)) < In0P->planeCnt) ||
5136 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 128) + _WALIGN_(In0P->planeCnt)))
5137 return MIG_BAD_ARGUMENTS;
5138#endif /* __MigTypeCheck */
5139
5140#if __MigTypeCheck
5141 {
5142 char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
5143#if __MigKernelSpecificCode
5144 size_t strnlen_limit;
5145#else
5146 size_t memchr_limit;
5147#endif /* __MigKernelSpecificCode */
5148
5149#if __MigKernelSpecificCode
5150 strnlen_limit = min((msg_limit - In0P->plane), 128);
5151 if (( strnlen(In0P->plane, strnlen_limit) >= 128 + 1 ))
5152 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
5153#else
5154 memchr_limit = min((msg_limit - In0P->plane), 128);
5155 if (( memchr(In0P->plane, '\0', memchr_limit) == NULL ))
5156 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
5157#endif /* __MigKernelSpecificCode */
5158 }
5159#endif /* __MigTypeCheck */
5160
5161 return MACH_MSG_SUCCESS;
5162}
5163#endif /* !defined(__MIG_check__Request__io_registry_entry_get_name_in_plane_t__defined) */
5164#endif /* __MIG_check__Request__iokit_subsystem__ */
5165#endif /* ( __MigTypeCheck ) */
5166
5167
5168/* Routine io_registry_entry_get_name_in_plane */
5169mig_internal novalue _Xio_registry_entry_get_name_in_plane
5170 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
5171{
5172
5173#ifdef __MigPackStructs
5174#pragma pack(4)
5175#endif
5176 typedef struct {
5177 mach_msg_header_t Head;
5178 NDR_record_t NDR;
5179 mach_msg_type_number_t planeOffset; /* MiG doesn't use it */
5180 mach_msg_type_number_t planeCnt;
5181 char plane[128];
5182 mach_msg_trailer_t trailer;
5183 } Request __attribute__((unused));
5184#ifdef __MigPackStructs
5185#pragma pack()
5186#endif
5187 typedef __Request__io_registry_entry_get_name_in_plane_t __Request;
5188 typedef __Reply__io_registry_entry_get_name_in_plane_t Reply __attribute__((unused));
5189
5190 /*
5191 * typedef struct {
5192 * mach_msg_header_t Head;
5193 * NDR_record_t NDR;
5194 * kern_return_t RetCode;
5195 * } mig_reply_error_t;
5196 */
5197
5198 Request *In0P = (Request *) InHeadP;
5199 Reply *OutP = (Reply *) OutHeadP;
5200#ifdef __MIG_check__Request__io_registry_entry_get_name_in_plane_t__defined
5201 kern_return_t check_result;
5202#endif /* __MIG_check__Request__io_registry_entry_get_name_in_plane_t__defined */
5203
5204#if __MigKernelSpecificCode
5205#else
5206#endif /* __MigKernelSpecificCode */
5207 io_object_t registry_entry;
5208
5209 __DeclareRcvRpc(2843, "io_registry_entry_get_name_in_plane")
5210 __BeforeRcvRpc(2843, "io_registry_entry_get_name_in_plane")
5211
5212#if defined(__MIG_check__Request__io_registry_entry_get_name_in_plane_t__defined)
5213 check_result = __MIG_check__Request__io_registry_entry_get_name_in_plane_t((__Request *)In0P);
5214 if (check_result != MACH_MSG_SUCCESS)
5215 { MIG_RETURN_ERROR(OutP, check_result); }
5216#endif /* defined(__MIG_check__Request__io_registry_entry_get_name_in_plane_t__defined) */
5217
5218 registry_entry = iokit_lookup_object_port(In0P->Head.msgh_request_port);
5219
5220 OutP->RetCode = is_io_registry_entry_get_name_in_plane(registry_entry, In0P->plane, OutP->name);
5221 iokit_remove_reference(registry_entry);
5222 if (OutP->RetCode != KERN_SUCCESS) {
5223 MIG_RETURN_ERROR(OutP, OutP->RetCode);
5224 }
5225#if __MigKernelSpecificCode
5226#endif /* __MigKernelSpecificCode */
5227
5228 OutP->NDR = NDR_record;
5229
5230#ifdef __LP64__
5231 {
5232 size_t strLength = strlen(OutP->name) + 1;
5233 if (strLength > 0xffffffff)
5234 MIG_RETURN_ERROR(OutP, MIG_BAD_ARGUMENTS);
5235 OutP->nameCnt = (mach_msg_type_number_t) strLength;
5236 }
5237#else
5238 OutP->nameCnt = (mach_msg_type_number_t) strlen(OutP->name) + 1;
5239#endif /* __LP64__ */
5240 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 128) + (_WALIGN_((OutP->nameCnt + 3) & ~3));
5241
5242 __AfterRcvRpc(2843, "io_registry_entry_get_name_in_plane")
5243}
5244
5245#if ( __MigTypeCheck )
5246#if __MIG_check__Request__iokit_subsystem__
5247#if !defined(__MIG_check__Request__io_service_match_property_table_t__defined)
5248#define __MIG_check__Request__io_service_match_property_table_t__defined
5249
5250mig_internal kern_return_t __MIG_check__Request__io_service_match_property_table_t(__attribute__((__unused__)) __Request__io_service_match_property_table_t *In0P)
5251{
5252
5253 typedef __Request__io_service_match_property_table_t __Request;
5254#if __MigTypeCheck
5255 unsigned int msgh_size;
5256#endif /* __MigTypeCheck */
5257
5258#if __MigTypeCheck
5259 msgh_size = In0P->Head.msgh_size;
5260 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
5261 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 512)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
5262 return MIG_BAD_ARGUMENTS;
5263#endif /* __MigTypeCheck */
5264
5265#if defined(__NDR_convert__int_rep__Request__io_service_match_property_table_t__matchingCnt__defined)
5266 if (In0P->NDR.int_rep != NDR_record.int_rep)
5267 __NDR_convert__int_rep__Request__io_service_match_property_table_t__matchingCnt(&In0P->matchingCnt, In0P->NDR.int_rep);
5268#endif /* __NDR_convert__int_rep__Request__io_service_match_property_table_t__matchingCnt__defined */
5269#if __MigTypeCheck
5270 if ( In0P->matchingCnt > 512 )
5271 return MIG_BAD_ARGUMENTS;
5272 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 512)) < In0P->matchingCnt) ||
5273 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 512) + _WALIGN_(In0P->matchingCnt)))
5274 return MIG_BAD_ARGUMENTS;
5275#endif /* __MigTypeCheck */
5276
5277#if __MigTypeCheck
5278 {
5279 char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
5280#if __MigKernelSpecificCode
5281 size_t strnlen_limit;
5282#else
5283 size_t memchr_limit;
5284#endif /* __MigKernelSpecificCode */
5285
5286#if __MigKernelSpecificCode
5287 strnlen_limit = min((msg_limit - In0P->matching), 512);
5288 if (( strnlen(In0P->matching, strnlen_limit) >= 512 + 1 ))
5289 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
5290#else
5291 memchr_limit = min((msg_limit - In0P->matching), 512);
5292 if (( memchr(In0P->matching, '\0', memchr_limit) == NULL ))
5293 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
5294#endif /* __MigKernelSpecificCode */
5295 }
5296#endif /* __MigTypeCheck */
5297
5298 return MACH_MSG_SUCCESS;
5299}
5300#endif /* !defined(__MIG_check__Request__io_service_match_property_table_t__defined) */
5301#endif /* __MIG_check__Request__iokit_subsystem__ */
5302#endif /* ( __MigTypeCheck ) */
5303
5304
5305/* Routine io_service_match_property_table */
5306mig_internal novalue _Xio_service_match_property_table
5307 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
5308{
5309
5310#ifdef __MigPackStructs
5311#pragma pack(4)
5312#endif
5313 typedef struct {
5314 mach_msg_header_t Head;
5315 NDR_record_t NDR;
5316 mach_msg_type_number_t matchingOffset; /* MiG doesn't use it */
5317 mach_msg_type_number_t matchingCnt;
5318 char matching[512];
5319 mach_msg_trailer_t trailer;
5320 } Request __attribute__((unused));
5321#ifdef __MigPackStructs
5322#pragma pack()
5323#endif
5324 typedef __Request__io_service_match_property_table_t __Request;
5325 typedef __Reply__io_service_match_property_table_t Reply __attribute__((unused));
5326
5327 /*
5328 * typedef struct {
5329 * mach_msg_header_t Head;
5330 * NDR_record_t NDR;
5331 * kern_return_t RetCode;
5332 * } mig_reply_error_t;
5333 */
5334
5335 Request *In0P = (Request *) InHeadP;
5336 Reply *OutP = (Reply *) OutHeadP;
5337#ifdef __MIG_check__Request__io_service_match_property_table_t__defined
5338 kern_return_t check_result;
5339#endif /* __MIG_check__Request__io_service_match_property_table_t__defined */
5340
5341#if __MigKernelSpecificCode
5342#else
5343#endif /* __MigKernelSpecificCode */
5344 io_object_t service;
5345
5346 __DeclareRcvRpc(2844, "io_service_match_property_table")
5347 __BeforeRcvRpc(2844, "io_service_match_property_table")
5348
5349#if defined(__MIG_check__Request__io_service_match_property_table_t__defined)
5350 check_result = __MIG_check__Request__io_service_match_property_table_t((__Request *)In0P);
5351 if (check_result != MACH_MSG_SUCCESS)
5352 { MIG_RETURN_ERROR(OutP, check_result); }
5353#endif /* defined(__MIG_check__Request__io_service_match_property_table_t__defined) */
5354
5355 service = iokit_lookup_object_port(In0P->Head.msgh_request_port);
5356
5357 OutP->RetCode = is_io_service_match_property_table(service, In0P->matching, &OutP->matches);
5358 iokit_remove_reference(service);
5359 if (OutP->RetCode != KERN_SUCCESS) {
5360 MIG_RETURN_ERROR(OutP, OutP->RetCode);
5361 }
5362#if __MigKernelSpecificCode
5363#endif /* __MigKernelSpecificCode */
5364
5365 OutP->NDR = NDR_record;
5366
5367
5368 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
5369 __AfterRcvRpc(2844, "io_service_match_property_table")
5370}
5371
5372#if ( __MigTypeCheck )
5373#if __MIG_check__Request__iokit_subsystem__
5374#if !defined(__MIG_check__Request__io_async_method_scalarI_scalarO_t__defined)
5375#define __MIG_check__Request__io_async_method_scalarI_scalarO_t__defined
5376
5377mig_internal kern_return_t __MIG_check__Request__io_async_method_scalarI_scalarO_t(__attribute__((__unused__)) __Request__io_async_method_scalarI_scalarO_t *In0P, __attribute__((__unused__)) __Request__io_async_method_scalarI_scalarO_t **In1PP, __attribute__((__unused__)) __Request__io_async_method_scalarI_scalarO_t **In2PP)
5378{
5379
5380 typedef __Request__io_async_method_scalarI_scalarO_t __Request;
5381 __Request *In1P;
5382 __Request *In2P;
5383#if __MigTypeCheck
5384 unsigned int msgh_size;
5385#endif /* __MigTypeCheck */
5386 unsigned int msgh_size_delta;
5387
5388#if __MigTypeCheck
5389 msgh_size = In0P->Head.msgh_size;
5390 if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
5391 (In0P->msgh_body.msgh_descriptor_count != 1) ||
5392 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 96)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
5393 return MIG_BAD_ARGUMENTS;
5394#endif /* __MigTypeCheck */
5395
5396#if __MigTypeCheck
5397 if (In0P->wake_port.type != MACH_MSG_PORT_DESCRIPTOR ||
5398 In0P->wake_port.disposition != 17)
5399 return MIG_TYPE_ERROR;
5400#endif /* __MigTypeCheck */
5401
5402#if defined(__NDR_convert__int_rep__Request__io_async_method_scalarI_scalarO_t__referenceCnt__defined)
5403 if (In0P->NDR.int_rep != NDR_record.int_rep)
5404 __NDR_convert__int_rep__Request__io_async_method_scalarI_scalarO_t__referenceCnt(&In0P->referenceCnt, In0P->NDR.int_rep);
5405#endif /* __NDR_convert__int_rep__Request__io_async_method_scalarI_scalarO_t__referenceCnt__defined */
5406 msgh_size_delta = (4 * In0P->referenceCnt);
5407#if __MigTypeCheck
5408 if ( In0P->referenceCnt > 8 )
5409 return MIG_BAD_ARGUMENTS;
5410 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 96)) / 4 < In0P->referenceCnt) ||
5411 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 96) + (4 * In0P->referenceCnt)))
5412 return MIG_BAD_ARGUMENTS;
5413 msgh_size -= msgh_size_delta;
5414#endif /* __MigTypeCheck */
5415
5416 *In1PP = In1P = (__Request *) ((pointer_t) In0P + msgh_size_delta - 32);
5417
5418#if defined(__NDR_convert__int_rep__Request__io_async_method_scalarI_scalarO_t__inputCnt__defined)
5419 if (In0P->NDR.int_rep != NDR_record.int_rep)
5420 __NDR_convert__int_rep__Request__io_async_method_scalarI_scalarO_t__inputCnt(&In1P->inputCnt, In1P->NDR.int_rep);
5421#endif /* __NDR_convert__int_rep__Request__io_async_method_scalarI_scalarO_t__inputCnt__defined */
5422 msgh_size_delta = (4 * In1P->inputCnt);
5423#if __MigTypeCheck
5424 if ( In1P->inputCnt > 16 )
5425 return MIG_BAD_ARGUMENTS;
5426 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 96)) / 4 < In1P->inputCnt) ||
5427 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 96) + (4 * In1P->inputCnt)))
5428 return MIG_BAD_ARGUMENTS;
5429#endif /* __MigTypeCheck */
5430
5431 *In2PP = In2P = (__Request *) ((pointer_t) In1P + msgh_size_delta - 64);
5432
5433 return MACH_MSG_SUCCESS;
5434}
5435#endif /* !defined(__MIG_check__Request__io_async_method_scalarI_scalarO_t__defined) */
5436#endif /* __MIG_check__Request__iokit_subsystem__ */
5437#endif /* ( __MigTypeCheck ) */
5438
5439
5440/* Routine io_async_method_scalarI_scalarO */
5441mig_internal novalue _Xio_async_method_scalarI_scalarO
5442 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
5443{
5444
5445#ifdef __MigPackStructs
5446#pragma pack(4)
5447#endif
5448 typedef struct {
5449 mach_msg_header_t Head;
5450 /* start of the kernel processed data */
5451 mach_msg_body_t msgh_body;
5452 mach_msg_port_descriptor_t wake_port;
5453 /* end of the kernel processed data */
5454 NDR_record_t NDR;
5455 mach_msg_type_number_t referenceCnt;
5456 natural_t reference[8];
5457 uint32_t selector;
5458 mach_msg_type_number_t inputCnt;
5459 int input[16];
5460 mach_msg_type_number_t outputCnt;
5461 mach_msg_trailer_t trailer;
5462 } Request __attribute__((unused));
5463#ifdef __MigPackStructs
5464#pragma pack()
5465#endif
5466 typedef __Request__io_async_method_scalarI_scalarO_t __Request;
5467 typedef __Reply__io_async_method_scalarI_scalarO_t Reply __attribute__((unused));
5468
5469 /*
5470 * typedef struct {
5471 * mach_msg_header_t Head;
5472 * NDR_record_t NDR;
5473 * kern_return_t RetCode;
5474 * } mig_reply_error_t;
5475 */
5476
5477 Request *In0P = (Request *) InHeadP;
5478 Request *In1P;
5479 Request *In2P;
5480 Reply *OutP = (Reply *) OutHeadP;
5481#ifdef __MIG_check__Request__io_async_method_scalarI_scalarO_t__defined
5482 kern_return_t check_result;
5483#endif /* __MIG_check__Request__io_async_method_scalarI_scalarO_t__defined */
5484
5485#if __MigKernelSpecificCode
5486#else
5487#endif /* __MigKernelSpecificCode */
5488 io_connect_t connection;
5489
5490 __DeclareRcvRpc(2845, "io_async_method_scalarI_scalarO")
5491 __BeforeRcvRpc(2845, "io_async_method_scalarI_scalarO")
5492
5493#if defined(__MIG_check__Request__io_async_method_scalarI_scalarO_t__defined)
5494 check_result = __MIG_check__Request__io_async_method_scalarI_scalarO_t((__Request *)In0P, (__Request **)&In1P, (__Request **)&In2P);
5495 if (check_result != MACH_MSG_SUCCESS)
5496 { MIG_RETURN_ERROR(OutP, check_result); }
5497#endif /* defined(__MIG_check__Request__io_async_method_scalarI_scalarO_t__defined) */
5498
5499 connection = iokit_lookup_connect_port(In0P->Head.msgh_request_port);
5500
5501 OutP->outputCnt = 16;
5502 if (In2P->outputCnt < OutP->outputCnt)
5503 OutP->outputCnt = In2P->outputCnt;
5504
5505 OutP->RetCode = is_io_async_method_scalarI_scalarO(connection, In0P->wake_port.name, In0P->reference, In0P->referenceCnt, In1P->selector, In1P->input, In1P->inputCnt, OutP->output, &OutP->outputCnt);
5506 iokit_remove_connect_reference(connection);
5507 if (OutP->RetCode != KERN_SUCCESS) {
5508 MIG_RETURN_ERROR(OutP, OutP->RetCode);
5509 }
5510#if __MigKernelSpecificCode
5511#endif /* __MigKernelSpecificCode */
5512
5513 OutP->NDR = NDR_record;
5514
5515 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 64) + (((4 * OutP->outputCnt)));
5516
5517 __AfterRcvRpc(2845, "io_async_method_scalarI_scalarO")
5518}
5519
5520#if ( __MigTypeCheck )
5521#if __MIG_check__Request__iokit_subsystem__
5522#if !defined(__MIG_check__Request__io_async_method_scalarI_structureO_t__defined)
5523#define __MIG_check__Request__io_async_method_scalarI_structureO_t__defined
5524
5525mig_internal kern_return_t __MIG_check__Request__io_async_method_scalarI_structureO_t(__attribute__((__unused__)) __Request__io_async_method_scalarI_structureO_t *In0P, __attribute__((__unused__)) __Request__io_async_method_scalarI_structureO_t **In1PP, __attribute__((__unused__)) __Request__io_async_method_scalarI_structureO_t **In2PP)
5526{
5527
5528 typedef __Request__io_async_method_scalarI_structureO_t __Request;
5529 __Request *In1P;
5530 __Request *In2P;
5531#if __MigTypeCheck
5532 unsigned int msgh_size;
5533#endif /* __MigTypeCheck */
5534 unsigned int msgh_size_delta;
5535
5536#if __MigTypeCheck
5537 msgh_size = In0P->Head.msgh_size;
5538 if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
5539 (In0P->msgh_body.msgh_descriptor_count != 1) ||
5540 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 96)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
5541 return MIG_BAD_ARGUMENTS;
5542#endif /* __MigTypeCheck */
5543
5544#if __MigTypeCheck
5545 if (In0P->wake_port.type != MACH_MSG_PORT_DESCRIPTOR ||
5546 In0P->wake_port.disposition != 17)
5547 return MIG_TYPE_ERROR;
5548#endif /* __MigTypeCheck */
5549
5550#if defined(__NDR_convert__int_rep__Request__io_async_method_scalarI_structureO_t__referenceCnt__defined)
5551 if (In0P->NDR.int_rep != NDR_record.int_rep)
5552 __NDR_convert__int_rep__Request__io_async_method_scalarI_structureO_t__referenceCnt(&In0P->referenceCnt, In0P->NDR.int_rep);
5553#endif /* __NDR_convert__int_rep__Request__io_async_method_scalarI_structureO_t__referenceCnt__defined */
5554 msgh_size_delta = (4 * In0P->referenceCnt);
5555#if __MigTypeCheck
5556 if ( In0P->referenceCnt > 8 )
5557 return MIG_BAD_ARGUMENTS;
5558 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 96)) / 4 < In0P->referenceCnt) ||
5559 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 96) + (4 * In0P->referenceCnt)))
5560 return MIG_BAD_ARGUMENTS;
5561 msgh_size -= msgh_size_delta;
5562#endif /* __MigTypeCheck */
5563
5564 *In1PP = In1P = (__Request *) ((pointer_t) In0P + msgh_size_delta - 32);
5565
5566#if defined(__NDR_convert__int_rep__Request__io_async_method_scalarI_structureO_t__inputCnt__defined)
5567 if (In0P->NDR.int_rep != NDR_record.int_rep)
5568 __NDR_convert__int_rep__Request__io_async_method_scalarI_structureO_t__inputCnt(&In1P->inputCnt, In1P->NDR.int_rep);
5569#endif /* __NDR_convert__int_rep__Request__io_async_method_scalarI_structureO_t__inputCnt__defined */
5570 msgh_size_delta = (4 * In1P->inputCnt);
5571#if __MigTypeCheck
5572 if ( In1P->inputCnt > 16 )
5573 return MIG_BAD_ARGUMENTS;
5574 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 96)) / 4 < In1P->inputCnt) ||
5575 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 96) + (4 * In1P->inputCnt)))
5576 return MIG_BAD_ARGUMENTS;
5577#endif /* __MigTypeCheck */
5578
5579 *In2PP = In2P = (__Request *) ((pointer_t) In1P + msgh_size_delta - 64);
5580
5581 return MACH_MSG_SUCCESS;
5582}
5583#endif /* !defined(__MIG_check__Request__io_async_method_scalarI_structureO_t__defined) */
5584#endif /* __MIG_check__Request__iokit_subsystem__ */
5585#endif /* ( __MigTypeCheck ) */
5586
5587
5588/* Routine io_async_method_scalarI_structureO */
5589mig_internal novalue _Xio_async_method_scalarI_structureO
5590 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
5591{
5592
5593#ifdef __MigPackStructs
5594#pragma pack(4)
5595#endif
5596 typedef struct {
5597 mach_msg_header_t Head;
5598 /* start of the kernel processed data */
5599 mach_msg_body_t msgh_body;
5600 mach_msg_port_descriptor_t wake_port;
5601 /* end of the kernel processed data */
5602 NDR_record_t NDR;
5603 mach_msg_type_number_t referenceCnt;
5604 natural_t reference[8];
5605 uint32_t selector;
5606 mach_msg_type_number_t inputCnt;
5607 int input[16];
5608 mach_msg_type_number_t outputCnt;
5609 mach_msg_trailer_t trailer;
5610 } Request __attribute__((unused));
5611#ifdef __MigPackStructs
5612#pragma pack()
5613#endif
5614 typedef __Request__io_async_method_scalarI_structureO_t __Request;
5615 typedef __Reply__io_async_method_scalarI_structureO_t Reply __attribute__((unused));
5616
5617 /*
5618 * typedef struct {
5619 * mach_msg_header_t Head;
5620 * NDR_record_t NDR;
5621 * kern_return_t RetCode;
5622 * } mig_reply_error_t;
5623 */
5624
5625 Request *In0P = (Request *) InHeadP;
5626 Request *In1P;
5627 Request *In2P;
5628 Reply *OutP = (Reply *) OutHeadP;
5629#ifdef __MIG_check__Request__io_async_method_scalarI_structureO_t__defined
5630 kern_return_t check_result;
5631#endif /* __MIG_check__Request__io_async_method_scalarI_structureO_t__defined */
5632
5633#if __MigKernelSpecificCode
5634#else
5635#endif /* __MigKernelSpecificCode */
5636 io_connect_t connection;
5637
5638 __DeclareRcvRpc(2846, "io_async_method_scalarI_structureO")
5639 __BeforeRcvRpc(2846, "io_async_method_scalarI_structureO")
5640
5641#if defined(__MIG_check__Request__io_async_method_scalarI_structureO_t__defined)
5642 check_result = __MIG_check__Request__io_async_method_scalarI_structureO_t((__Request *)In0P, (__Request **)&In1P, (__Request **)&In2P);
5643 if (check_result != MACH_MSG_SUCCESS)
5644 { MIG_RETURN_ERROR(OutP, check_result); }
5645#endif /* defined(__MIG_check__Request__io_async_method_scalarI_structureO_t__defined) */
5646
5647 connection = iokit_lookup_connect_port(In0P->Head.msgh_request_port);
5648
5649 OutP->outputCnt = 4096;
5650 if (In2P->outputCnt < OutP->outputCnt)
5651 OutP->outputCnt = In2P->outputCnt;
5652
5653 OutP->RetCode = is_io_async_method_scalarI_structureO(connection, In0P->wake_port.name, In0P->reference, In0P->referenceCnt, In1P->selector, In1P->input, In1P->inputCnt, OutP->output, &OutP->outputCnt);
5654 iokit_remove_connect_reference(connection);
5655 if (OutP->RetCode != KERN_SUCCESS) {
5656 MIG_RETURN_ERROR(OutP, OutP->RetCode);
5657 }
5658#if __MigKernelSpecificCode
5659#endif /* __MigKernelSpecificCode */
5660
5661 OutP->NDR = NDR_record;
5662
5663 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 4096) + (_WALIGN_((OutP->outputCnt + 3) & ~3));
5664
5665 __AfterRcvRpc(2846, "io_async_method_scalarI_structureO")
5666}
5667
5668#if ( __MigTypeCheck )
5669#if __MIG_check__Request__iokit_subsystem__
5670#if !defined(__MIG_check__Request__io_async_method_scalarI_structureI_t__defined)
5671#define __MIG_check__Request__io_async_method_scalarI_structureI_t__defined
5672
5673mig_internal kern_return_t __MIG_check__Request__io_async_method_scalarI_structureI_t(__attribute__((__unused__)) __Request__io_async_method_scalarI_structureI_t *In0P, __attribute__((__unused__)) __Request__io_async_method_scalarI_structureI_t **In1PP, __attribute__((__unused__)) __Request__io_async_method_scalarI_structureI_t **In2PP)
5674{
5675
5676 typedef __Request__io_async_method_scalarI_structureI_t __Request;
5677 __Request *In1P;
5678 __Request *In2P;
5679#if __MigTypeCheck
5680 unsigned int msgh_size;
5681#endif /* __MigTypeCheck */
5682 unsigned int msgh_size_delta;
5683
5684#if __MigTypeCheck
5685 msgh_size = In0P->Head.msgh_size;
5686 if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
5687 (In0P->msgh_body.msgh_descriptor_count != 1) ||
5688 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 4192)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
5689 return MIG_BAD_ARGUMENTS;
5690#endif /* __MigTypeCheck */
5691
5692#if __MigTypeCheck
5693 if (In0P->wake_port.type != MACH_MSG_PORT_DESCRIPTOR ||
5694 In0P->wake_port.disposition != 17)
5695 return MIG_TYPE_ERROR;
5696#endif /* __MigTypeCheck */
5697
5698#if defined(__NDR_convert__int_rep__Request__io_async_method_scalarI_structureI_t__referenceCnt__defined)
5699 if (In0P->NDR.int_rep != NDR_record.int_rep)
5700 __NDR_convert__int_rep__Request__io_async_method_scalarI_structureI_t__referenceCnt(&In0P->referenceCnt, In0P->NDR.int_rep);
5701#endif /* __NDR_convert__int_rep__Request__io_async_method_scalarI_structureI_t__referenceCnt__defined */
5702 msgh_size_delta = (4 * In0P->referenceCnt);
5703#if __MigTypeCheck
5704 if ( In0P->referenceCnt > 8 )
5705 return MIG_BAD_ARGUMENTS;
5706 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 4192)) / 4 < In0P->referenceCnt) ||
5707 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 4192) + (4 * In0P->referenceCnt)))
5708 return MIG_BAD_ARGUMENTS;
5709 msgh_size -= msgh_size_delta;
5710#endif /* __MigTypeCheck */
5711
5712 *In1PP = In1P = (__Request *) ((pointer_t) In0P + msgh_size_delta - 32);
5713
5714#if defined(__NDR_convert__int_rep__Request__io_async_method_scalarI_structureI_t__inputCnt__defined)
5715 if (In0P->NDR.int_rep != NDR_record.int_rep)
5716 __NDR_convert__int_rep__Request__io_async_method_scalarI_structureI_t__inputCnt(&In1P->inputCnt, In1P->NDR.int_rep);
5717#endif /* __NDR_convert__int_rep__Request__io_async_method_scalarI_structureI_t__inputCnt__defined */
5718 msgh_size_delta = (4 * In1P->inputCnt);
5719#if __MigTypeCheck
5720 if ( In1P->inputCnt > 16 )
5721 return MIG_BAD_ARGUMENTS;
5722 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 4192)) / 4 < In1P->inputCnt) ||
5723 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 4192) + (4 * In1P->inputCnt)))
5724 return MIG_BAD_ARGUMENTS;
5725 msgh_size -= msgh_size_delta;
5726#endif /* __MigTypeCheck */
5727
5728 *In2PP = In2P = (__Request *) ((pointer_t) In1P + msgh_size_delta - 64);
5729
5730#if defined(__NDR_convert__int_rep__Request__io_async_method_scalarI_structureI_t__inputStructCnt__defined)
5731 if (In0P->NDR.int_rep != NDR_record.int_rep)
5732 __NDR_convert__int_rep__Request__io_async_method_scalarI_structureI_t__inputStructCnt(&In2P->inputStructCnt, In2P->NDR.int_rep);
5733#endif /* __NDR_convert__int_rep__Request__io_async_method_scalarI_structureI_t__inputStructCnt__defined */
5734#if __MigTypeCheck
5735 if ( In2P->inputStructCnt > 4096 )
5736 return MIG_BAD_ARGUMENTS;
5737 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 4192)) < In2P->inputStructCnt) ||
5738 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 4192) + _WALIGN_(In2P->inputStructCnt)))
5739 return MIG_BAD_ARGUMENTS;
5740#endif /* __MigTypeCheck */
5741
5742 return MACH_MSG_SUCCESS;
5743}
5744#endif /* !defined(__MIG_check__Request__io_async_method_scalarI_structureI_t__defined) */
5745#endif /* __MIG_check__Request__iokit_subsystem__ */
5746#endif /* ( __MigTypeCheck ) */
5747
5748
5749/* Routine io_async_method_scalarI_structureI */
5750mig_internal novalue _Xio_async_method_scalarI_structureI
5751 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
5752{
5753
5754#ifdef __MigPackStructs
5755#pragma pack(4)
5756#endif
5757 typedef struct {
5758 mach_msg_header_t Head;
5759 /* start of the kernel processed data */
5760 mach_msg_body_t msgh_body;
5761 mach_msg_port_descriptor_t wake_port;
5762 /* end of the kernel processed data */
5763 NDR_record_t NDR;
5764 mach_msg_type_number_t referenceCnt;
5765 natural_t reference[8];
5766 uint32_t selector;
5767 mach_msg_type_number_t inputCnt;
5768 int input[16];
5769 mach_msg_type_number_t inputStructCnt;
5770 char inputStruct[4096];
5771 mach_msg_trailer_t trailer;
5772 } Request __attribute__((unused));
5773#ifdef __MigPackStructs
5774#pragma pack()
5775#endif
5776 typedef __Request__io_async_method_scalarI_structureI_t __Request;
5777 typedef __Reply__io_async_method_scalarI_structureI_t Reply __attribute__((unused));
5778
5779 /*
5780 * typedef struct {
5781 * mach_msg_header_t Head;
5782 * NDR_record_t NDR;
5783 * kern_return_t RetCode;
5784 * } mig_reply_error_t;
5785 */
5786
5787 Request *In0P = (Request *) InHeadP;
5788 Request *In1P;
5789 Request *In2P;
5790 Reply *OutP = (Reply *) OutHeadP;
5791#ifdef __MIG_check__Request__io_async_method_scalarI_structureI_t__defined
5792 kern_return_t check_result;
5793#endif /* __MIG_check__Request__io_async_method_scalarI_structureI_t__defined */
5794
5795#if __MigKernelSpecificCode
5796#else
5797#endif /* __MigKernelSpecificCode */
5798 io_connect_t connection;
5799
5800 __DeclareRcvRpc(2847, "io_async_method_scalarI_structureI")
5801 __BeforeRcvRpc(2847, "io_async_method_scalarI_structureI")
5802
5803#if defined(__MIG_check__Request__io_async_method_scalarI_structureI_t__defined)
5804 check_result = __MIG_check__Request__io_async_method_scalarI_structureI_t((__Request *)In0P, (__Request **)&In1P, (__Request **)&In2P);
5805 if (check_result != MACH_MSG_SUCCESS)
5806 { MIG_RETURN_ERROR(OutP, check_result); }
5807#endif /* defined(__MIG_check__Request__io_async_method_scalarI_structureI_t__defined) */
5808
5809 connection = iokit_lookup_connect_port(In0P->Head.msgh_request_port);
5810
5811 OutP->RetCode = is_io_async_method_scalarI_structureI(connection, In0P->wake_port.name, In0P->reference, In0P->referenceCnt, In1P->selector, In1P->input, In1P->inputCnt, In2P->inputStruct, In2P->inputStructCnt);
5812 iokit_remove_connect_reference(connection);
5813#if __MigKernelSpecificCode
5814#endif /* __MigKernelSpecificCode */
5815
5816 OutP->NDR = NDR_record;
5817
5818
5819 __AfterRcvRpc(2847, "io_async_method_scalarI_structureI")
5820}
5821
5822#if ( __MigTypeCheck )
5823#if __MIG_check__Request__iokit_subsystem__
5824#if !defined(__MIG_check__Request__io_async_method_structureI_structureO_t__defined)
5825#define __MIG_check__Request__io_async_method_structureI_structureO_t__defined
5826
5827mig_internal kern_return_t __MIG_check__Request__io_async_method_structureI_structureO_t(__attribute__((__unused__)) __Request__io_async_method_structureI_structureO_t *In0P, __attribute__((__unused__)) __Request__io_async_method_structureI_structureO_t **In1PP, __attribute__((__unused__)) __Request__io_async_method_structureI_structureO_t **In2PP)
5828{
5829
5830 typedef __Request__io_async_method_structureI_structureO_t __Request;
5831 __Request *In1P;
5832 __Request *In2P;
5833#if __MigTypeCheck
5834 unsigned int msgh_size;
5835#endif /* __MigTypeCheck */
5836 unsigned int msgh_size_delta;
5837
5838#if __MigTypeCheck
5839 msgh_size = In0P->Head.msgh_size;
5840 if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
5841 (In0P->msgh_body.msgh_descriptor_count != 1) ||
5842 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 4128)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
5843 return MIG_BAD_ARGUMENTS;
5844#endif /* __MigTypeCheck */
5845
5846#if __MigTypeCheck
5847 if (In0P->wake_port.type != MACH_MSG_PORT_DESCRIPTOR ||
5848 In0P->wake_port.disposition != 17)
5849 return MIG_TYPE_ERROR;
5850#endif /* __MigTypeCheck */
5851
5852#if defined(__NDR_convert__int_rep__Request__io_async_method_structureI_structureO_t__referenceCnt__defined)
5853 if (In0P->NDR.int_rep != NDR_record.int_rep)
5854 __NDR_convert__int_rep__Request__io_async_method_structureI_structureO_t__referenceCnt(&In0P->referenceCnt, In0P->NDR.int_rep);
5855#endif /* __NDR_convert__int_rep__Request__io_async_method_structureI_structureO_t__referenceCnt__defined */
5856 msgh_size_delta = (4 * In0P->referenceCnt);
5857#if __MigTypeCheck
5858 if ( In0P->referenceCnt > 8 )
5859 return MIG_BAD_ARGUMENTS;
5860 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 4128)) / 4 < In0P->referenceCnt) ||
5861 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 4128) + (4 * In0P->referenceCnt)))
5862 return MIG_BAD_ARGUMENTS;
5863 msgh_size -= msgh_size_delta;
5864#endif /* __MigTypeCheck */
5865
5866 *In1PP = In1P = (__Request *) ((pointer_t) In0P + msgh_size_delta - 32);
5867
5868#if defined(__NDR_convert__int_rep__Request__io_async_method_structureI_structureO_t__inputCnt__defined)
5869 if (In0P->NDR.int_rep != NDR_record.int_rep)
5870 __NDR_convert__int_rep__Request__io_async_method_structureI_structureO_t__inputCnt(&In1P->inputCnt, In1P->NDR.int_rep);
5871#endif /* __NDR_convert__int_rep__Request__io_async_method_structureI_structureO_t__inputCnt__defined */
5872 msgh_size_delta = _WALIGN_(In1P->inputCnt);
5873#if __MigTypeCheck
5874 if ( In1P->inputCnt > 4096 )
5875 return MIG_BAD_ARGUMENTS;
5876 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 4128)) < In1P->inputCnt) ||
5877 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 4128) + _WALIGN_(In1P->inputCnt)))
5878 return MIG_BAD_ARGUMENTS;
5879#endif /* __MigTypeCheck */
5880
5881 *In2PP = In2P = (__Request *) ((pointer_t) In1P + msgh_size_delta - 4096);
5882
5883 return MACH_MSG_SUCCESS;
5884}
5885#endif /* !defined(__MIG_check__Request__io_async_method_structureI_structureO_t__defined) */
5886#endif /* __MIG_check__Request__iokit_subsystem__ */
5887#endif /* ( __MigTypeCheck ) */
5888
5889
5890/* Routine io_async_method_structureI_structureO */
5891mig_internal novalue _Xio_async_method_structureI_structureO
5892 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
5893{
5894
5895#ifdef __MigPackStructs
5896#pragma pack(4)
5897#endif
5898 typedef struct {
5899 mach_msg_header_t Head;
5900 /* start of the kernel processed data */
5901 mach_msg_body_t msgh_body;
5902 mach_msg_port_descriptor_t wake_port;
5903 /* end of the kernel processed data */
5904 NDR_record_t NDR;
5905 mach_msg_type_number_t referenceCnt;
5906 natural_t reference[8];
5907 uint32_t selector;
5908 mach_msg_type_number_t inputCnt;
5909 char input[4096];
5910 mach_msg_type_number_t outputCnt;
5911 mach_msg_trailer_t trailer;
5912 } Request __attribute__((unused));
5913#ifdef __MigPackStructs
5914#pragma pack()
5915#endif
5916 typedef __Request__io_async_method_structureI_structureO_t __Request;
5917 typedef __Reply__io_async_method_structureI_structureO_t Reply __attribute__((unused));
5918
5919 /*
5920 * typedef struct {
5921 * mach_msg_header_t Head;
5922 * NDR_record_t NDR;
5923 * kern_return_t RetCode;
5924 * } mig_reply_error_t;
5925 */
5926
5927 Request *In0P = (Request *) InHeadP;
5928 Request *In1P;
5929 Request *In2P;
5930 Reply *OutP = (Reply *) OutHeadP;
5931#ifdef __MIG_check__Request__io_async_method_structureI_structureO_t__defined
5932 kern_return_t check_result;
5933#endif /* __MIG_check__Request__io_async_method_structureI_structureO_t__defined */
5934
5935#if __MigKernelSpecificCode
5936#else
5937#endif /* __MigKernelSpecificCode */
5938 io_connect_t connection;
5939
5940 __DeclareRcvRpc(2848, "io_async_method_structureI_structureO")
5941 __BeforeRcvRpc(2848, "io_async_method_structureI_structureO")
5942
5943#if defined(__MIG_check__Request__io_async_method_structureI_structureO_t__defined)
5944 check_result = __MIG_check__Request__io_async_method_structureI_structureO_t((__Request *)In0P, (__Request **)&In1P, (__Request **)&In2P);
5945 if (check_result != MACH_MSG_SUCCESS)
5946 { MIG_RETURN_ERROR(OutP, check_result); }
5947#endif /* defined(__MIG_check__Request__io_async_method_structureI_structureO_t__defined) */
5948
5949 connection = iokit_lookup_connect_port(In0P->Head.msgh_request_port);
5950
5951 OutP->outputCnt = 4096;
5952 if (In2P->outputCnt < OutP->outputCnt)
5953 OutP->outputCnt = In2P->outputCnt;
5954
5955 OutP->RetCode = is_io_async_method_structureI_structureO(connection, In0P->wake_port.name, In0P->reference, In0P->referenceCnt, In1P->selector, In1P->input, In1P->inputCnt, OutP->output, &OutP->outputCnt);
5956 iokit_remove_connect_reference(connection);
5957 if (OutP->RetCode != KERN_SUCCESS) {
5958 MIG_RETURN_ERROR(OutP, OutP->RetCode);
5959 }
5960#if __MigKernelSpecificCode
5961#endif /* __MigKernelSpecificCode */
5962
5963 OutP->NDR = NDR_record;
5964
5965 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 4096) + (_WALIGN_((OutP->outputCnt + 3) & ~3));
5966
5967 __AfterRcvRpc(2848, "io_async_method_structureI_structureO")
5968}
5969
5970#if ( __MigTypeCheck )
5971#if __MIG_check__Request__iokit_subsystem__
5972#if !defined(__MIG_check__Request__io_service_add_notification_t__defined)
5973#define __MIG_check__Request__io_service_add_notification_t__defined
5974
5975mig_internal kern_return_t __MIG_check__Request__io_service_add_notification_t(__attribute__((__unused__)) __Request__io_service_add_notification_t *In0P, __attribute__((__unused__)) __Request__io_service_add_notification_t **In1PP, __attribute__((__unused__)) __Request__io_service_add_notification_t **In2PP)
5976{
5977
5978 typedef __Request__io_service_add_notification_t __Request;
5979 __Request *In1P;
5980 __Request *In2P;
5981#if __MigTypeCheck
5982 unsigned int msgh_size;
5983#endif /* __MigTypeCheck */
5984 unsigned int msgh_size_delta;
5985
5986#if __MigTypeCheck
5987 msgh_size = In0P->Head.msgh_size;
5988 if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
5989 (In0P->msgh_body.msgh_descriptor_count != 1) ||
5990 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 672)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
5991 return MIG_BAD_ARGUMENTS;
5992#endif /* __MigTypeCheck */
5993
5994#if __MigTypeCheck
5995 if (In0P->wake_port.type != MACH_MSG_PORT_DESCRIPTOR ||
5996 In0P->wake_port.disposition != 17)
5997 return MIG_TYPE_ERROR;
5998#endif /* __MigTypeCheck */
5999
6000#if defined(__NDR_convert__int_rep__Request__io_service_add_notification_t__notification_typeCnt__defined)
6001 if (In0P->NDR.int_rep != NDR_record.int_rep)
6002 __NDR_convert__int_rep__Request__io_service_add_notification_t__notification_typeCnt(&In0P->notification_typeCnt, In0P->NDR.int_rep);
6003#endif /* __NDR_convert__int_rep__Request__io_service_add_notification_t__notification_typeCnt__defined */
6004 msgh_size_delta = _WALIGN_(In0P->notification_typeCnt);
6005#if __MigTypeCheck
6006 if ( In0P->notification_typeCnt > 128 )
6007 return MIG_BAD_ARGUMENTS;
6008 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 672)) < In0P->notification_typeCnt) ||
6009 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 672) + _WALIGN_(In0P->notification_typeCnt)))
6010 return MIG_BAD_ARGUMENTS;
6011 msgh_size -= msgh_size_delta;
6012#endif /* __MigTypeCheck */
6013
6014 *In1PP = In1P = (__Request *) ((pointer_t) In0P + msgh_size_delta - 128);
6015
6016#if defined(__NDR_convert__int_rep__Request__io_service_add_notification_t__matchingCnt__defined)
6017 if (In0P->NDR.int_rep != NDR_record.int_rep)
6018 __NDR_convert__int_rep__Request__io_service_add_notification_t__matchingCnt(&In1P->matchingCnt, In1P->NDR.int_rep);
6019#endif /* __NDR_convert__int_rep__Request__io_service_add_notification_t__matchingCnt__defined */
6020 msgh_size_delta = _WALIGN_(In1P->matchingCnt);
6021#if __MigTypeCheck
6022 if ( In1P->matchingCnt > 512 )
6023 return MIG_BAD_ARGUMENTS;
6024 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 672)) < In1P->matchingCnt) ||
6025 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 672) + _WALIGN_(In1P->matchingCnt)))
6026 return MIG_BAD_ARGUMENTS;
6027 msgh_size -= msgh_size_delta;
6028#endif /* __MigTypeCheck */
6029
6030 *In2PP = In2P = (__Request *) ((pointer_t) In1P + msgh_size_delta - 512);
6031
6032#if defined(__NDR_convert__int_rep__Request__io_service_add_notification_t__referenceCnt__defined)
6033 if (In0P->NDR.int_rep != NDR_record.int_rep)
6034 __NDR_convert__int_rep__Request__io_service_add_notification_t__referenceCnt(&In2P->referenceCnt, In2P->NDR.int_rep);
6035#endif /* __NDR_convert__int_rep__Request__io_service_add_notification_t__referenceCnt__defined */
6036#if __MigTypeCheck
6037 if ( In2P->referenceCnt > 8 )
6038 return MIG_BAD_ARGUMENTS;
6039 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 672)) / 4 < In2P->referenceCnt) ||
6040 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 672) + (4 * In2P->referenceCnt)))
6041 return MIG_BAD_ARGUMENTS;
6042#endif /* __MigTypeCheck */
6043
6044#if __MigTypeCheck
6045 {
6046 char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
6047#if __MigKernelSpecificCode
6048 size_t strnlen_limit;
6049#else
6050 size_t memchr_limit;
6051#endif /* __MigKernelSpecificCode */
6052
6053#if __MigKernelSpecificCode
6054 strnlen_limit = min((msg_limit - In0P->notification_type), 128);
6055 if (( strnlen(In0P->notification_type, strnlen_limit) >= 128 + 1 ))
6056 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
6057#else
6058 memchr_limit = min((msg_limit - In0P->notification_type), 128);
6059 if (( memchr(In0P->notification_type, '\0', memchr_limit) == NULL ))
6060 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
6061#endif /* __MigKernelSpecificCode */
6062#if __MigKernelSpecificCode
6063 strnlen_limit = min((msg_limit - In1P->matching), 512);
6064 if (( strnlen(In1P->matching, strnlen_limit) >= 512 + 1 ))
6065 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
6066#else
6067 memchr_limit = min((msg_limit - In1P->matching), 512);
6068 if (( memchr(In1P->matching, '\0', memchr_limit) == NULL ))
6069 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
6070#endif /* __MigKernelSpecificCode */
6071 }
6072#endif /* __MigTypeCheck */
6073
6074 return MACH_MSG_SUCCESS;
6075}
6076#endif /* !defined(__MIG_check__Request__io_service_add_notification_t__defined) */
6077#endif /* __MIG_check__Request__iokit_subsystem__ */
6078#endif /* ( __MigTypeCheck ) */
6079
6080
6081/* Routine io_service_add_notification */
6082mig_internal novalue _Xio_service_add_notification
6083 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
6084{
6085
6086#ifdef __MigPackStructs
6087#pragma pack(4)
6088#endif
6089 typedef struct {
6090 mach_msg_header_t Head;
6091 /* start of the kernel processed data */
6092 mach_msg_body_t msgh_body;
6093 mach_msg_port_descriptor_t wake_port;
6094 /* end of the kernel processed data */
6095 NDR_record_t NDR;
6096 mach_msg_type_number_t notification_typeOffset; /* MiG doesn't use it */
6097 mach_msg_type_number_t notification_typeCnt;
6098 char notification_type[128];
6099 mach_msg_type_number_t matchingOffset; /* MiG doesn't use it */
6100 mach_msg_type_number_t matchingCnt;
6101 char matching[512];
6102 mach_msg_type_number_t referenceCnt;
6103 natural_t reference[8];
6104 mach_msg_trailer_t trailer;
6105 } Request __attribute__((unused));
6106#ifdef __MigPackStructs
6107#pragma pack()
6108#endif
6109 typedef __Request__io_service_add_notification_t __Request;
6110 typedef __Reply__io_service_add_notification_t Reply __attribute__((unused));
6111
6112 /*
6113 * typedef struct {
6114 * mach_msg_header_t Head;
6115 * NDR_record_t NDR;
6116 * kern_return_t RetCode;
6117 * } mig_reply_error_t;
6118 */
6119
6120 Request *In0P = (Request *) InHeadP;
6121 Request *In1P;
6122 Request *In2P;
6123 Reply *OutP = (Reply *) OutHeadP;
6124#ifdef __MIG_check__Request__io_service_add_notification_t__defined
6125 kern_return_t check_result;
6126#endif /* __MIG_check__Request__io_service_add_notification_t__defined */
6127
6128#if __MigKernelSpecificCode
6129#if UseStaticTemplates
6130 const static mach_msg_port_descriptor_t notificationTemplate = {
6131 /* name = */ MACH_PORT_NULL,
6132 /* pad1 = */ 0,
6133 /* pad2 = */ 0,
6134 /* disp = */ 17,
6135 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
6136 };
6137#endif /* UseStaticTemplates */
6138
6139#else
6140#if UseStaticTemplates
6141 const static mach_msg_port_descriptor_t notificationTemplate = {
6142 /* name = */ MACH_PORT_NULL,
6143 /* pad1 = */ 0,
6144 /* pad2 = */ 0,
6145 /* disp = */ 19,
6146 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
6147 };
6148#endif /* UseStaticTemplates */
6149
6150#endif /* __MigKernelSpecificCode */
6151 kern_return_t RetCode;
6152 io_object_t notification;
6153
6154 __DeclareRcvRpc(2849, "io_service_add_notification")
6155 __BeforeRcvRpc(2849, "io_service_add_notification")
6156
6157#if defined(__MIG_check__Request__io_service_add_notification_t__defined)
6158 check_result = __MIG_check__Request__io_service_add_notification_t((__Request *)In0P, (__Request **)&In1P, (__Request **)&In2P);
6159 if (check_result != MACH_MSG_SUCCESS)
6160 { MIG_RETURN_ERROR(OutP, check_result); }
6161#endif /* defined(__MIG_check__Request__io_service_add_notification_t__defined) */
6162
6163#if UseStaticTemplates
6164 OutP->notification = notificationTemplate;
6165#else /* UseStaticTemplates */
6166#if __MigKernelSpecificCode
6167 OutP->notification.disposition = 17;
6168#else
6169 OutP->notification.disposition = 19;
6170#endif /* __MigKernelSpecificCode */
6171#if !(defined(KERNEL) && defined(__LP64__))
6172 OutP->notification.pad1 = 0;
6173#endif
6174 OutP->notification.pad2 = 0;
6175 OutP->notification.type = MACH_MSG_PORT_DESCRIPTOR;
6176#if defined(KERNEL)
6177 OutP->notification.pad_end = 0;
6178#endif
6179#endif /* UseStaticTemplates */
6180
6181
6182 RetCode = is_io_service_add_notification(In0P->Head.msgh_request_port, In0P->notification_type, In1P->matching, In0P->wake_port.name, In2P->reference, In2P->referenceCnt, &notification);
6183 if (RetCode != KERN_SUCCESS) {
6184 MIG_RETURN_ERROR(OutP, RetCode);
6185 }
6186#if __MigKernelSpecificCode
6187#endif /* __MigKernelSpecificCode */
6188 OutP->notification.name = (mach_port_t)iokit_make_object_port(notification);
6189
6190
6191 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
6192 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
6193 OutP->msgh_body.msgh_descriptor_count = 1;
6194 __AfterRcvRpc(2849, "io_service_add_notification")
6195}
6196
6197#if ( __MigTypeCheck )
6198#if __MIG_check__Request__iokit_subsystem__
6199#if !defined(__MIG_check__Request__io_service_add_interest_notification_t__defined)
6200#define __MIG_check__Request__io_service_add_interest_notification_t__defined
6201
6202mig_internal kern_return_t __MIG_check__Request__io_service_add_interest_notification_t(__attribute__((__unused__)) __Request__io_service_add_interest_notification_t *In0P, __attribute__((__unused__)) __Request__io_service_add_interest_notification_t **In1PP)
6203{
6204
6205 typedef __Request__io_service_add_interest_notification_t __Request;
6206 __Request *In1P;
6207#if __MigTypeCheck
6208 unsigned int msgh_size;
6209#endif /* __MigTypeCheck */
6210 unsigned int msgh_size_delta;
6211
6212#if __MigTypeCheck
6213 msgh_size = In0P->Head.msgh_size;
6214 if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
6215 (In0P->msgh_body.msgh_descriptor_count != 1) ||
6216 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 160)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
6217 return MIG_BAD_ARGUMENTS;
6218#endif /* __MigTypeCheck */
6219
6220#if __MigTypeCheck
6221 if (In0P->wake_port.type != MACH_MSG_PORT_DESCRIPTOR ||
6222 In0P->wake_port.disposition != 17)
6223 return MIG_TYPE_ERROR;
6224#endif /* __MigTypeCheck */
6225
6226#if defined(__NDR_convert__int_rep__Request__io_service_add_interest_notification_t__type_of_interestCnt__defined)
6227 if (In0P->NDR.int_rep != NDR_record.int_rep)
6228 __NDR_convert__int_rep__Request__io_service_add_interest_notification_t__type_of_interestCnt(&In0P->type_of_interestCnt, In0P->NDR.int_rep);
6229#endif /* __NDR_convert__int_rep__Request__io_service_add_interest_notification_t__type_of_interestCnt__defined */
6230 msgh_size_delta = _WALIGN_(In0P->type_of_interestCnt);
6231#if __MigTypeCheck
6232 if ( In0P->type_of_interestCnt > 128 )
6233 return MIG_BAD_ARGUMENTS;
6234 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 160)) < In0P->type_of_interestCnt) ||
6235 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 160) + _WALIGN_(In0P->type_of_interestCnt)))
6236 return MIG_BAD_ARGUMENTS;
6237 msgh_size -= msgh_size_delta;
6238#endif /* __MigTypeCheck */
6239
6240 *In1PP = In1P = (__Request *) ((pointer_t) In0P + msgh_size_delta - 128);
6241
6242#if defined(__NDR_convert__int_rep__Request__io_service_add_interest_notification_t__referenceCnt__defined)
6243 if (In0P->NDR.int_rep != NDR_record.int_rep)
6244 __NDR_convert__int_rep__Request__io_service_add_interest_notification_t__referenceCnt(&In1P->referenceCnt, In1P->NDR.int_rep);
6245#endif /* __NDR_convert__int_rep__Request__io_service_add_interest_notification_t__referenceCnt__defined */
6246#if __MigTypeCheck
6247 if ( In1P->referenceCnt > 8 )
6248 return MIG_BAD_ARGUMENTS;
6249 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 160)) / 4 < In1P->referenceCnt) ||
6250 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 160) + (4 * In1P->referenceCnt)))
6251 return MIG_BAD_ARGUMENTS;
6252#endif /* __MigTypeCheck */
6253
6254#if __MigTypeCheck
6255 {
6256 char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
6257#if __MigKernelSpecificCode
6258 size_t strnlen_limit;
6259#else
6260 size_t memchr_limit;
6261#endif /* __MigKernelSpecificCode */
6262
6263#if __MigKernelSpecificCode
6264 strnlen_limit = min((msg_limit - In0P->type_of_interest), 128);
6265 if (( strnlen(In0P->type_of_interest, strnlen_limit) >= 128 + 1 ))
6266 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
6267#else
6268 memchr_limit = min((msg_limit - In0P->type_of_interest), 128);
6269 if (( memchr(In0P->type_of_interest, '\0', memchr_limit) == NULL ))
6270 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
6271#endif /* __MigKernelSpecificCode */
6272 }
6273#endif /* __MigTypeCheck */
6274
6275 return MACH_MSG_SUCCESS;
6276}
6277#endif /* !defined(__MIG_check__Request__io_service_add_interest_notification_t__defined) */
6278#endif /* __MIG_check__Request__iokit_subsystem__ */
6279#endif /* ( __MigTypeCheck ) */
6280
6281
6282/* Routine io_service_add_interest_notification */
6283mig_internal novalue _Xio_service_add_interest_notification
6284 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
6285{
6286
6287#ifdef __MigPackStructs
6288#pragma pack(4)
6289#endif
6290 typedef struct {
6291 mach_msg_header_t Head;
6292 /* start of the kernel processed data */
6293 mach_msg_body_t msgh_body;
6294 mach_msg_port_descriptor_t wake_port;
6295 /* end of the kernel processed data */
6296 NDR_record_t NDR;
6297 mach_msg_type_number_t type_of_interestOffset; /* MiG doesn't use it */
6298 mach_msg_type_number_t type_of_interestCnt;
6299 char type_of_interest[128];
6300 mach_msg_type_number_t referenceCnt;
6301 natural_t reference[8];
6302 mach_msg_trailer_t trailer;
6303 } Request __attribute__((unused));
6304#ifdef __MigPackStructs
6305#pragma pack()
6306#endif
6307 typedef __Request__io_service_add_interest_notification_t __Request;
6308 typedef __Reply__io_service_add_interest_notification_t Reply __attribute__((unused));
6309
6310 /*
6311 * typedef struct {
6312 * mach_msg_header_t Head;
6313 * NDR_record_t NDR;
6314 * kern_return_t RetCode;
6315 * } mig_reply_error_t;
6316 */
6317
6318 Request *In0P = (Request *) InHeadP;
6319 Request *In1P;
6320 Reply *OutP = (Reply *) OutHeadP;
6321#ifdef __MIG_check__Request__io_service_add_interest_notification_t__defined
6322 kern_return_t check_result;
6323#endif /* __MIG_check__Request__io_service_add_interest_notification_t__defined */
6324
6325#if __MigKernelSpecificCode
6326#if UseStaticTemplates
6327 const static mach_msg_port_descriptor_t notificationTemplate = {
6328 /* name = */ MACH_PORT_NULL,
6329 /* pad1 = */ 0,
6330 /* pad2 = */ 0,
6331 /* disp = */ 17,
6332 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
6333 };
6334#endif /* UseStaticTemplates */
6335
6336#else
6337#if UseStaticTemplates
6338 const static mach_msg_port_descriptor_t notificationTemplate = {
6339 /* name = */ MACH_PORT_NULL,
6340 /* pad1 = */ 0,
6341 /* pad2 = */ 0,
6342 /* disp = */ 19,
6343 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
6344 };
6345#endif /* UseStaticTemplates */
6346
6347#endif /* __MigKernelSpecificCode */
6348 kern_return_t RetCode;
6349 io_object_t service;
6350 io_object_t notification;
6351
6352 __DeclareRcvRpc(2850, "io_service_add_interest_notification")
6353 __BeforeRcvRpc(2850, "io_service_add_interest_notification")
6354
6355#if defined(__MIG_check__Request__io_service_add_interest_notification_t__defined)
6356 check_result = __MIG_check__Request__io_service_add_interest_notification_t((__Request *)In0P, (__Request **)&In1P);
6357 if (check_result != MACH_MSG_SUCCESS)
6358 { MIG_RETURN_ERROR(OutP, check_result); }
6359#endif /* defined(__MIG_check__Request__io_service_add_interest_notification_t__defined) */
6360
6361#if UseStaticTemplates
6362 OutP->notification = notificationTemplate;
6363#else /* UseStaticTemplates */
6364#if __MigKernelSpecificCode
6365 OutP->notification.disposition = 17;
6366#else
6367 OutP->notification.disposition = 19;
6368#endif /* __MigKernelSpecificCode */
6369#if !(defined(KERNEL) && defined(__LP64__))
6370 OutP->notification.pad1 = 0;
6371#endif
6372 OutP->notification.pad2 = 0;
6373 OutP->notification.type = MACH_MSG_PORT_DESCRIPTOR;
6374#if defined(KERNEL)
6375 OutP->notification.pad_end = 0;
6376#endif
6377#endif /* UseStaticTemplates */
6378
6379
6380 service = iokit_lookup_object_port(In0P->Head.msgh_request_port);
6381
6382 RetCode = is_io_service_add_interest_notification(service, In0P->type_of_interest, In0P->wake_port.name, In1P->reference, In1P->referenceCnt, &notification);
6383 iokit_remove_reference(service);
6384 if (RetCode != KERN_SUCCESS) {
6385 MIG_RETURN_ERROR(OutP, RetCode);
6386 }
6387#if __MigKernelSpecificCode
6388#endif /* __MigKernelSpecificCode */
6389 OutP->notification.name = (mach_port_t)iokit_make_object_port(notification);
6390
6391
6392 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
6393 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
6394 OutP->msgh_body.msgh_descriptor_count = 1;
6395 __AfterRcvRpc(2850, "io_service_add_interest_notification")
6396}
6397
6398#if ( __MigTypeCheck )
6399#if __MIG_check__Request__iokit_subsystem__
6400#if !defined(__MIG_check__Request__io_service_acknowledge_notification_t__defined)
6401#define __MIG_check__Request__io_service_acknowledge_notification_t__defined
6402
6403mig_internal kern_return_t __MIG_check__Request__io_service_acknowledge_notification_t(__attribute__((__unused__)) __Request__io_service_acknowledge_notification_t *In0P)
6404{
6405
6406 typedef __Request__io_service_acknowledge_notification_t __Request;
6407#if __MigTypeCheck
6408 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
6409 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
6410 return MIG_BAD_ARGUMENTS;
6411#endif /* __MigTypeCheck */
6412
6413 return MACH_MSG_SUCCESS;
6414}
6415#endif /* !defined(__MIG_check__Request__io_service_acknowledge_notification_t__defined) */
6416#endif /* __MIG_check__Request__iokit_subsystem__ */
6417#endif /* ( __MigTypeCheck ) */
6418
6419
6420/* Routine io_service_acknowledge_notification */
6421mig_internal novalue _Xio_service_acknowledge_notification
6422 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
6423{
6424
6425#ifdef __MigPackStructs
6426#pragma pack(4)
6427#endif
6428 typedef struct {
6429 mach_msg_header_t Head;
6430 NDR_record_t NDR;
6431 natural_t notify_ref;
6432 natural_t response;
6433 mach_msg_trailer_t trailer;
6434 } Request __attribute__((unused));
6435#ifdef __MigPackStructs
6436#pragma pack()
6437#endif
6438 typedef __Request__io_service_acknowledge_notification_t __Request;
6439 typedef __Reply__io_service_acknowledge_notification_t Reply __attribute__((unused));
6440
6441 /*
6442 * typedef struct {
6443 * mach_msg_header_t Head;
6444 * NDR_record_t NDR;
6445 * kern_return_t RetCode;
6446 * } mig_reply_error_t;
6447 */
6448
6449 Request *In0P = (Request *) InHeadP;
6450 Reply *OutP = (Reply *) OutHeadP;
6451#ifdef __MIG_check__Request__io_service_acknowledge_notification_t__defined
6452 kern_return_t check_result;
6453#endif /* __MIG_check__Request__io_service_acknowledge_notification_t__defined */
6454
6455#if __MigKernelSpecificCode
6456#else
6457#endif /* __MigKernelSpecificCode */
6458 io_object_t service;
6459
6460 __DeclareRcvRpc(2851, "io_service_acknowledge_notification")
6461 __BeforeRcvRpc(2851, "io_service_acknowledge_notification")
6462
6463#if defined(__MIG_check__Request__io_service_acknowledge_notification_t__defined)
6464 check_result = __MIG_check__Request__io_service_acknowledge_notification_t((__Request *)In0P);
6465 if (check_result != MACH_MSG_SUCCESS)
6466 { MIG_RETURN_ERROR(OutP, check_result); }
6467#endif /* defined(__MIG_check__Request__io_service_acknowledge_notification_t__defined) */
6468
6469 service = iokit_lookup_object_port(In0P->Head.msgh_request_port);
6470
6471 OutP->RetCode = is_io_service_acknowledge_notification(service, In0P->notify_ref, In0P->response);
6472 iokit_remove_reference(service);
6473#if __MigKernelSpecificCode
6474#endif /* __MigKernelSpecificCode */
6475
6476 OutP->NDR = NDR_record;
6477
6478
6479 __AfterRcvRpc(2851, "io_service_acknowledge_notification")
6480}
6481
6482#if ( __MigTypeCheck )
6483#if __MIG_check__Request__iokit_subsystem__
6484#if !defined(__MIG_check__Request__io_connect_get_notification_semaphore_t__defined)
6485#define __MIG_check__Request__io_connect_get_notification_semaphore_t__defined
6486
6487mig_internal kern_return_t __MIG_check__Request__io_connect_get_notification_semaphore_t(__attribute__((__unused__)) __Request__io_connect_get_notification_semaphore_t *In0P)
6488{
6489
6490 typedef __Request__io_connect_get_notification_semaphore_t __Request;
6491#if __MigTypeCheck
6492 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
6493 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
6494 return MIG_BAD_ARGUMENTS;
6495#endif /* __MigTypeCheck */
6496
6497 return MACH_MSG_SUCCESS;
6498}
6499#endif /* !defined(__MIG_check__Request__io_connect_get_notification_semaphore_t__defined) */
6500#endif /* __MIG_check__Request__iokit_subsystem__ */
6501#endif /* ( __MigTypeCheck ) */
6502
6503
6504/* Routine io_connect_get_notification_semaphore */
6505mig_internal novalue _Xio_connect_get_notification_semaphore
6506 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
6507{
6508
6509#ifdef __MigPackStructs
6510#pragma pack(4)
6511#endif
6512 typedef struct {
6513 mach_msg_header_t Head;
6514 NDR_record_t NDR;
6515 natural_t notification_type;
6516 mach_msg_trailer_t trailer;
6517 } Request __attribute__((unused));
6518#ifdef __MigPackStructs
6519#pragma pack()
6520#endif
6521 typedef __Request__io_connect_get_notification_semaphore_t __Request;
6522 typedef __Reply__io_connect_get_notification_semaphore_t Reply __attribute__((unused));
6523
6524 /*
6525 * typedef struct {
6526 * mach_msg_header_t Head;
6527 * NDR_record_t NDR;
6528 * kern_return_t RetCode;
6529 * } mig_reply_error_t;
6530 */
6531
6532 Request *In0P = (Request *) InHeadP;
6533 Reply *OutP = (Reply *) OutHeadP;
6534#ifdef __MIG_check__Request__io_connect_get_notification_semaphore_t__defined
6535 kern_return_t check_result;
6536#endif /* __MIG_check__Request__io_connect_get_notification_semaphore_t__defined */
6537
6538#if __MigKernelSpecificCode
6539#if UseStaticTemplates
6540 const static mach_msg_port_descriptor_t semaphoreTemplate = {
6541 /* name = */ MACH_PORT_NULL,
6542 /* pad1 = */ 0,
6543 /* pad2 = */ 0,
6544 /* disp = */ 17,
6545 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
6546 };
6547#endif /* UseStaticTemplates */
6548
6549#else
6550#if UseStaticTemplates
6551 const static mach_msg_port_descriptor_t semaphoreTemplate = {
6552 /* name = */ MACH_PORT_NULL,
6553 /* pad1 = */ 0,
6554 /* pad2 = */ 0,
6555 /* disp = */ 19,
6556 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
6557 };
6558#endif /* UseStaticTemplates */
6559
6560#endif /* __MigKernelSpecificCode */
6561 kern_return_t RetCode;
6562 io_connect_t connection;
6563 semaphore_t semaphore;
6564
6565 __DeclareRcvRpc(2852, "io_connect_get_notification_semaphore")
6566 __BeforeRcvRpc(2852, "io_connect_get_notification_semaphore")
6567
6568#if defined(__MIG_check__Request__io_connect_get_notification_semaphore_t__defined)
6569 check_result = __MIG_check__Request__io_connect_get_notification_semaphore_t((__Request *)In0P);
6570 if (check_result != MACH_MSG_SUCCESS)
6571 { MIG_RETURN_ERROR(OutP, check_result); }
6572#endif /* defined(__MIG_check__Request__io_connect_get_notification_semaphore_t__defined) */
6573
6574#if UseStaticTemplates
6575 OutP->semaphore = semaphoreTemplate;
6576#else /* UseStaticTemplates */
6577#if __MigKernelSpecificCode
6578 OutP->semaphore.disposition = 17;
6579#else
6580 OutP->semaphore.disposition = 19;
6581#endif /* __MigKernelSpecificCode */
6582#if !(defined(KERNEL) && defined(__LP64__))
6583 OutP->semaphore.pad1 = 0;
6584#endif
6585 OutP->semaphore.pad2 = 0;
6586 OutP->semaphore.type = MACH_MSG_PORT_DESCRIPTOR;
6587#if defined(KERNEL)
6588 OutP->semaphore.pad_end = 0;
6589#endif
6590#endif /* UseStaticTemplates */
6591
6592
6593 connection = iokit_lookup_connect_port(In0P->Head.msgh_request_port);
6594
6595 RetCode = is_io_connect_get_notification_semaphore(connection, In0P->notification_type, &semaphore);
6596 iokit_remove_connect_reference(connection);
6597 if (RetCode != KERN_SUCCESS) {
6598 MIG_RETURN_ERROR(OutP, RetCode);
6599 }
6600#if __MigKernelSpecificCode
6601#endif /* __MigKernelSpecificCode */
6602 OutP->semaphore.name = (mach_port_t)convert_semaphore_to_port(semaphore);
6603
6604
6605 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
6606 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
6607 OutP->msgh_body.msgh_descriptor_count = 1;
6608 __AfterRcvRpc(2852, "io_connect_get_notification_semaphore")
6609}
6610
6611#if ( __MigTypeCheck )
6612#if __MIG_check__Request__iokit_subsystem__
6613#if !defined(__MIG_check__Request__io_connect_unmap_memory_t__defined)
6614#define __MIG_check__Request__io_connect_unmap_memory_t__defined
6615
6616mig_internal kern_return_t __MIG_check__Request__io_connect_unmap_memory_t(__attribute__((__unused__)) __Request__io_connect_unmap_memory_t *In0P)
6617{
6618
6619 typedef __Request__io_connect_unmap_memory_t __Request;
6620#if __MigTypeCheck
6621 if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
6622 (In0P->msgh_body.msgh_descriptor_count != 1) ||
6623 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
6624 return MIG_BAD_ARGUMENTS;
6625#endif /* __MigTypeCheck */
6626
6627#if __MigTypeCheck
6628 if (In0P->into_task.type != MACH_MSG_PORT_DESCRIPTOR ||
6629 In0P->into_task.disposition != 17)
6630 return MIG_TYPE_ERROR;
6631#endif /* __MigTypeCheck */
6632
6633 return MACH_MSG_SUCCESS;
6634}
6635#endif /* !defined(__MIG_check__Request__io_connect_unmap_memory_t__defined) */
6636#endif /* __MIG_check__Request__iokit_subsystem__ */
6637#endif /* ( __MigTypeCheck ) */
6638
6639
6640/* Routine io_connect_unmap_memory */
6641mig_internal novalue _Xio_connect_unmap_memory
6642 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
6643{
6644
6645#ifdef __MigPackStructs
6646#pragma pack(4)
6647#endif
6648 typedef struct {
6649 mach_msg_header_t Head;
6650 /* start of the kernel processed data */
6651 mach_msg_body_t msgh_body;
6652 mach_msg_port_descriptor_t into_task;
6653 /* end of the kernel processed data */
6654 NDR_record_t NDR;
6655 uint32_t memory_type;
6656 uint32_t address;
6657 mach_msg_trailer_t trailer;
6658 } Request __attribute__((unused));
6659#ifdef __MigPackStructs
6660#pragma pack()
6661#endif
6662 typedef __Request__io_connect_unmap_memory_t __Request;
6663 typedef __Reply__io_connect_unmap_memory_t Reply __attribute__((unused));
6664
6665 /*
6666 * typedef struct {
6667 * mach_msg_header_t Head;
6668 * NDR_record_t NDR;
6669 * kern_return_t RetCode;
6670 * } mig_reply_error_t;
6671 */
6672
6673 Request *In0P = (Request *) InHeadP;
6674 Reply *OutP = (Reply *) OutHeadP;
6675#ifdef __MIG_check__Request__io_connect_unmap_memory_t__defined
6676 kern_return_t check_result;
6677#endif /* __MIG_check__Request__io_connect_unmap_memory_t__defined */
6678
6679#if __MigKernelSpecificCode
6680#else
6681#endif /* __MigKernelSpecificCode */
6682 io_connect_t connection;
6683 task_t into_task;
6684
6685 __DeclareRcvRpc(2853, "io_connect_unmap_memory")
6686 __BeforeRcvRpc(2853, "io_connect_unmap_memory")
6687
6688#if defined(__MIG_check__Request__io_connect_unmap_memory_t__defined)
6689 check_result = __MIG_check__Request__io_connect_unmap_memory_t((__Request *)In0P);
6690 if (check_result != MACH_MSG_SUCCESS)
6691 { MIG_RETURN_ERROR(OutP, check_result); }
6692#endif /* defined(__MIG_check__Request__io_connect_unmap_memory_t__defined) */
6693
6694 connection = iokit_lookup_connect_port(In0P->Head.msgh_request_port);
6695
6696 into_task = convert_port_to_task(In0P->into_task.name);
6697
6698 OutP->RetCode = is_io_connect_unmap_memory(connection, In0P->memory_type, into_task, In0P->address);
6699 task_deallocate(into_task);
6700 iokit_remove_connect_reference(connection);
6701#if __MigKernelSpecificCode
6702 if (OutP->RetCode != KERN_SUCCESS) {
6703 MIG_RETURN_ERROR(OutP, OutP->RetCode);
6704 }
6705
6706 if (IP_VALID((ipc_port_t)In0P->into_task.name))
6707 ipc_port_release_send((ipc_port_t)In0P->into_task.name);
6708#endif /* __MigKernelSpecificCode */
6709
6710 OutP->NDR = NDR_record;
6711
6712
6713 __AfterRcvRpc(2853, "io_connect_unmap_memory")
6714}
6715
6716#if ( __MigTypeCheck )
6717#if __MIG_check__Request__iokit_subsystem__
6718#if !defined(__MIG_check__Request__io_registry_entry_get_location_in_plane_t__defined)
6719#define __MIG_check__Request__io_registry_entry_get_location_in_plane_t__defined
6720
6721mig_internal kern_return_t __MIG_check__Request__io_registry_entry_get_location_in_plane_t(__attribute__((__unused__)) __Request__io_registry_entry_get_location_in_plane_t *In0P)
6722{
6723
6724 typedef __Request__io_registry_entry_get_location_in_plane_t __Request;
6725#if __MigTypeCheck
6726 unsigned int msgh_size;
6727#endif /* __MigTypeCheck */
6728
6729#if __MigTypeCheck
6730 msgh_size = In0P->Head.msgh_size;
6731 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
6732 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 128)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
6733 return MIG_BAD_ARGUMENTS;
6734#endif /* __MigTypeCheck */
6735
6736#if defined(__NDR_convert__int_rep__Request__io_registry_entry_get_location_in_plane_t__planeCnt__defined)
6737 if (In0P->NDR.int_rep != NDR_record.int_rep)
6738 __NDR_convert__int_rep__Request__io_registry_entry_get_location_in_plane_t__planeCnt(&In0P->planeCnt, In0P->NDR.int_rep);
6739#endif /* __NDR_convert__int_rep__Request__io_registry_entry_get_location_in_plane_t__planeCnt__defined */
6740#if __MigTypeCheck
6741 if ( In0P->planeCnt > 128 )
6742 return MIG_BAD_ARGUMENTS;
6743 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 128)) < In0P->planeCnt) ||
6744 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 128) + _WALIGN_(In0P->planeCnt)))
6745 return MIG_BAD_ARGUMENTS;
6746#endif /* __MigTypeCheck */
6747
6748#if __MigTypeCheck
6749 {
6750 char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
6751#if __MigKernelSpecificCode
6752 size_t strnlen_limit;
6753#else
6754 size_t memchr_limit;
6755#endif /* __MigKernelSpecificCode */
6756
6757#if __MigKernelSpecificCode
6758 strnlen_limit = min((msg_limit - In0P->plane), 128);
6759 if (( strnlen(In0P->plane, strnlen_limit) >= 128 + 1 ))
6760 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
6761#else
6762 memchr_limit = min((msg_limit - In0P->plane), 128);
6763 if (( memchr(In0P->plane, '\0', memchr_limit) == NULL ))
6764 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
6765#endif /* __MigKernelSpecificCode */
6766 }
6767#endif /* __MigTypeCheck */
6768
6769 return MACH_MSG_SUCCESS;
6770}
6771#endif /* !defined(__MIG_check__Request__io_registry_entry_get_location_in_plane_t__defined) */
6772#endif /* __MIG_check__Request__iokit_subsystem__ */
6773#endif /* ( __MigTypeCheck ) */
6774
6775
6776/* Routine io_registry_entry_get_location_in_plane */
6777mig_internal novalue _Xio_registry_entry_get_location_in_plane
6778 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
6779{
6780
6781#ifdef __MigPackStructs
6782#pragma pack(4)
6783#endif
6784 typedef struct {
6785 mach_msg_header_t Head;
6786 NDR_record_t NDR;
6787 mach_msg_type_number_t planeOffset; /* MiG doesn't use it */
6788 mach_msg_type_number_t planeCnt;
6789 char plane[128];
6790 mach_msg_trailer_t trailer;
6791 } Request __attribute__((unused));
6792#ifdef __MigPackStructs
6793#pragma pack()
6794#endif
6795 typedef __Request__io_registry_entry_get_location_in_plane_t __Request;
6796 typedef __Reply__io_registry_entry_get_location_in_plane_t Reply __attribute__((unused));
6797
6798 /*
6799 * typedef struct {
6800 * mach_msg_header_t Head;
6801 * NDR_record_t NDR;
6802 * kern_return_t RetCode;
6803 * } mig_reply_error_t;
6804 */
6805
6806 Request *In0P = (Request *) InHeadP;
6807 Reply *OutP = (Reply *) OutHeadP;
6808#ifdef __MIG_check__Request__io_registry_entry_get_location_in_plane_t__defined
6809 kern_return_t check_result;
6810#endif /* __MIG_check__Request__io_registry_entry_get_location_in_plane_t__defined */
6811
6812#if __MigKernelSpecificCode
6813#else
6814#endif /* __MigKernelSpecificCode */
6815 io_object_t registry_entry;
6816
6817 __DeclareRcvRpc(2854, "io_registry_entry_get_location_in_plane")
6818 __BeforeRcvRpc(2854, "io_registry_entry_get_location_in_plane")
6819
6820#if defined(__MIG_check__Request__io_registry_entry_get_location_in_plane_t__defined)
6821 check_result = __MIG_check__Request__io_registry_entry_get_location_in_plane_t((__Request *)In0P);
6822 if (check_result != MACH_MSG_SUCCESS)
6823 { MIG_RETURN_ERROR(OutP, check_result); }
6824#endif /* defined(__MIG_check__Request__io_registry_entry_get_location_in_plane_t__defined) */
6825
6826 registry_entry = iokit_lookup_object_port(In0P->Head.msgh_request_port);
6827
6828 OutP->RetCode = is_io_registry_entry_get_location_in_plane(registry_entry, In0P->plane, OutP->location);
6829 iokit_remove_reference(registry_entry);
6830 if (OutP->RetCode != KERN_SUCCESS) {
6831 MIG_RETURN_ERROR(OutP, OutP->RetCode);
6832 }
6833#if __MigKernelSpecificCode
6834#endif /* __MigKernelSpecificCode */
6835
6836 OutP->NDR = NDR_record;
6837
6838#ifdef __LP64__
6839 {
6840 size_t strLength = strlen(OutP->location) + 1;
6841 if (strLength > 0xffffffff)
6842 MIG_RETURN_ERROR(OutP, MIG_BAD_ARGUMENTS);
6843 OutP->locationCnt = (mach_msg_type_number_t) strLength;
6844 }
6845#else
6846 OutP->locationCnt = (mach_msg_type_number_t) strlen(OutP->location) + 1;
6847#endif /* __LP64__ */
6848 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 128) + (_WALIGN_((OutP->locationCnt + 3) & ~3));
6849
6850 __AfterRcvRpc(2854, "io_registry_entry_get_location_in_plane")
6851}
6852
6853#if ( __MigTypeCheck )
6854#if __MIG_check__Request__iokit_subsystem__
6855#if !defined(__MIG_check__Request__io_registry_entry_get_property_recursively_t__defined)
6856#define __MIG_check__Request__io_registry_entry_get_property_recursively_t__defined
6857
6858mig_internal kern_return_t __MIG_check__Request__io_registry_entry_get_property_recursively_t(__attribute__((__unused__)) __Request__io_registry_entry_get_property_recursively_t *In0P, __attribute__((__unused__)) __Request__io_registry_entry_get_property_recursively_t **In1PP, __attribute__((__unused__)) __Request__io_registry_entry_get_property_recursively_t **In2PP)
6859{
6860
6861 typedef __Request__io_registry_entry_get_property_recursively_t __Request;
6862 __Request *In1P;
6863 __Request *In2P;
6864#if __MigTypeCheck
6865 unsigned int msgh_size;
6866#endif /* __MigTypeCheck */
6867 unsigned int msgh_size_delta;
6868
6869#if __MigTypeCheck
6870 msgh_size = In0P->Head.msgh_size;
6871 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
6872 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 256)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
6873 return MIG_BAD_ARGUMENTS;
6874#endif /* __MigTypeCheck */
6875
6876#if defined(__NDR_convert__int_rep__Request__io_registry_entry_get_property_recursively_t__planeCnt__defined)
6877 if (In0P->NDR.int_rep != NDR_record.int_rep)
6878 __NDR_convert__int_rep__Request__io_registry_entry_get_property_recursively_t__planeCnt(&In0P->planeCnt, In0P->NDR.int_rep);
6879#endif /* __NDR_convert__int_rep__Request__io_registry_entry_get_property_recursively_t__planeCnt__defined */
6880 msgh_size_delta = _WALIGN_(In0P->planeCnt);
6881#if __MigTypeCheck
6882 if ( In0P->planeCnt > 128 )
6883 return MIG_BAD_ARGUMENTS;
6884 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 256)) < In0P->planeCnt) ||
6885 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 256) + _WALIGN_(In0P->planeCnt)))
6886 return MIG_BAD_ARGUMENTS;
6887 msgh_size -= msgh_size_delta;
6888#endif /* __MigTypeCheck */
6889
6890 *In1PP = In1P = (__Request *) ((pointer_t) In0P + msgh_size_delta - 128);
6891
6892#if defined(__NDR_convert__int_rep__Request__io_registry_entry_get_property_recursively_t__property_nameCnt__defined)
6893 if (In0P->NDR.int_rep != NDR_record.int_rep)
6894 __NDR_convert__int_rep__Request__io_registry_entry_get_property_recursively_t__property_nameCnt(&In1P->property_nameCnt, In1P->NDR.int_rep);
6895#endif /* __NDR_convert__int_rep__Request__io_registry_entry_get_property_recursively_t__property_nameCnt__defined */
6896 msgh_size_delta = _WALIGN_(In1P->property_nameCnt);
6897#if __MigTypeCheck
6898 if ( In1P->property_nameCnt > 128 )
6899 return MIG_BAD_ARGUMENTS;
6900 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 256)) < In1P->property_nameCnt) ||
6901 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 256) + _WALIGN_(In1P->property_nameCnt)))
6902 return MIG_BAD_ARGUMENTS;
6903#endif /* __MigTypeCheck */
6904
6905 *In2PP = In2P = (__Request *) ((pointer_t) In1P + msgh_size_delta - 128);
6906
6907#if __MigTypeCheck
6908 {
6909 char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
6910#if __MigKernelSpecificCode
6911 size_t strnlen_limit;
6912#else
6913 size_t memchr_limit;
6914#endif /* __MigKernelSpecificCode */
6915
6916#if __MigKernelSpecificCode
6917 strnlen_limit = min((msg_limit - In0P->plane), 128);
6918 if (( strnlen(In0P->plane, strnlen_limit) >= 128 + 1 ))
6919 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
6920#else
6921 memchr_limit = min((msg_limit - In0P->plane), 128);
6922 if (( memchr(In0P->plane, '\0', memchr_limit) == NULL ))
6923 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
6924#endif /* __MigKernelSpecificCode */
6925#if __MigKernelSpecificCode
6926 strnlen_limit = min((msg_limit - In1P->property_name), 128);
6927 if (( strnlen(In1P->property_name, strnlen_limit) >= 128 + 1 ))
6928 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
6929#else
6930 memchr_limit = min((msg_limit - In1P->property_name), 128);
6931 if (( memchr(In1P->property_name, '\0', memchr_limit) == NULL ))
6932 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
6933#endif /* __MigKernelSpecificCode */
6934 }
6935#endif /* __MigTypeCheck */
6936
6937 return MACH_MSG_SUCCESS;
6938}
6939#endif /* !defined(__MIG_check__Request__io_registry_entry_get_property_recursively_t__defined) */
6940#endif /* __MIG_check__Request__iokit_subsystem__ */
6941#endif /* ( __MigTypeCheck ) */
6942
6943
6944/* Routine io_registry_entry_get_property_recursively */
6945mig_internal novalue _Xio_registry_entry_get_property_recursively
6946 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
6947{
6948
6949#ifdef __MigPackStructs
6950#pragma pack(4)
6951#endif
6952 typedef struct {
6953 mach_msg_header_t Head;
6954 NDR_record_t NDR;
6955 mach_msg_type_number_t planeOffset; /* MiG doesn't use it */
6956 mach_msg_type_number_t planeCnt;
6957 char plane[128];
6958 mach_msg_type_number_t property_nameOffset; /* MiG doesn't use it */
6959 mach_msg_type_number_t property_nameCnt;
6960 char property_name[128];
6961 uint32_t options;
6962 mach_msg_trailer_t trailer;
6963 } Request __attribute__((unused));
6964#ifdef __MigPackStructs
6965#pragma pack()
6966#endif
6967 typedef __Request__io_registry_entry_get_property_recursively_t __Request;
6968 typedef __Reply__io_registry_entry_get_property_recursively_t Reply __attribute__((unused));
6969
6970 /*
6971 * typedef struct {
6972 * mach_msg_header_t Head;
6973 * NDR_record_t NDR;
6974 * kern_return_t RetCode;
6975 * } mig_reply_error_t;
6976 */
6977
6978 Request *In0P = (Request *) InHeadP;
6979 Request *In1P;
6980 Request *In2P;
6981 Reply *OutP = (Reply *) OutHeadP;
6982#ifdef __MIG_check__Request__io_registry_entry_get_property_recursively_t__defined
6983 kern_return_t check_result;
6984#endif /* __MIG_check__Request__io_registry_entry_get_property_recursively_t__defined */
6985
6986#if __MigKernelSpecificCode
6987#if UseStaticTemplates
6988 const static mach_msg_ool_descriptor_t propertiesTemplate = {
6989 /* addr = */ (void *)0,
6990 /* size = */ 0,
6991 /* deal = */ FALSE,
6992 /* copy = */ MACH_MSG_PHYSICAL_COPY,
6993 /* pad2 = */ 0,
6994 /* type = */ MACH_MSG_OOL_DESCRIPTOR,
6995 };
6996#endif /* UseStaticTemplates */
6997
6998#else
6999#if UseStaticTemplates
7000 const static mach_msg_ool_descriptor_t propertiesTemplate = {
7001 /* addr = */ (void *)0,
7002 /* size = */ 0,
7003 /* deal = */ FALSE,
7004 /* copy = */ MACH_MSG_PHYSICAL_COPY,
7005 /* pad2 = */ 0,
7006 /* type = */ MACH_MSG_OOL_DESCRIPTOR,
7007 };
7008#endif /* UseStaticTemplates */
7009
7010#endif /* __MigKernelSpecificCode */
7011 kern_return_t RetCode;
7012 io_object_t registry_entry;
7013
7014 __DeclareRcvRpc(2855, "io_registry_entry_get_property_recursively")
7015 __BeforeRcvRpc(2855, "io_registry_entry_get_property_recursively")
7016
7017#if defined(__MIG_check__Request__io_registry_entry_get_property_recursively_t__defined)
7018 check_result = __MIG_check__Request__io_registry_entry_get_property_recursively_t((__Request *)In0P, (__Request **)&In1P, (__Request **)&In2P);
7019 if (check_result != MACH_MSG_SUCCESS)
7020 { MIG_RETURN_ERROR(OutP, check_result); }
7021#endif /* defined(__MIG_check__Request__io_registry_entry_get_property_recursively_t__defined) */
7022
7023#if UseStaticTemplates
7024 OutP->properties = propertiesTemplate;
7025#else /* UseStaticTemplates */
7026 OutP->properties.deallocate = FALSE;
7027 OutP->properties.copy = MACH_MSG_PHYSICAL_COPY;
7028 OutP->properties.pad1 = 0;
7029 OutP->properties.type = MACH_MSG_OOL_DESCRIPTOR;
7030#if defined(KERNEL) && !defined(__LP64__)
7031 OutP->properties.pad_end = 0;
7032#endif
7033#endif /* UseStaticTemplates */
7034
7035
7036 registry_entry = iokit_lookup_object_port(In0P->Head.msgh_request_port);
7037
7038 RetCode = is_io_registry_entry_get_property_recursively(registry_entry, In0P->plane, In1P->property_name, In2P->options, (io_buf_ptr_t *)&(OutP->properties.address), &OutP->propertiesCnt);
7039 iokit_remove_reference(registry_entry);
7040 if (RetCode != KERN_SUCCESS) {
7041 MIG_RETURN_ERROR(OutP, RetCode);
7042 }
7043#if __MigKernelSpecificCode
7044#endif /* __MigKernelSpecificCode */
7045 OutP->properties.size = OutP->propertiesCnt;
7046
7047
7048 OutP->NDR = NDR_record;
7049
7050
7051 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
7052 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
7053 OutP->msgh_body.msgh_descriptor_count = 1;
7054 __AfterRcvRpc(2855, "io_registry_entry_get_property_recursively")
7055}
7056
7057#if ( __MigTypeCheck )
7058#if __MIG_check__Request__iokit_subsystem__
7059#if !defined(__MIG_check__Request__io_service_get_state_t__defined)
7060#define __MIG_check__Request__io_service_get_state_t__defined
7061
7062mig_internal kern_return_t __MIG_check__Request__io_service_get_state_t(__attribute__((__unused__)) __Request__io_service_get_state_t *In0P)
7063{
7064
7065 typedef __Request__io_service_get_state_t __Request;
7066#if __MigTypeCheck
7067 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
7068 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
7069 return MIG_BAD_ARGUMENTS;
7070#endif /* __MigTypeCheck */
7071
7072 return MACH_MSG_SUCCESS;
7073}
7074#endif /* !defined(__MIG_check__Request__io_service_get_state_t__defined) */
7075#endif /* __MIG_check__Request__iokit_subsystem__ */
7076#endif /* ( __MigTypeCheck ) */
7077
7078
7079/* Routine io_service_get_state */
7080mig_internal novalue _Xio_service_get_state
7081 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
7082{
7083
7084#ifdef __MigPackStructs
7085#pragma pack(4)
7086#endif
7087 typedef struct {
7088 mach_msg_header_t Head;
7089 mach_msg_trailer_t trailer;
7090 } Request __attribute__((unused));
7091#ifdef __MigPackStructs
7092#pragma pack()
7093#endif
7094 typedef __Request__io_service_get_state_t __Request;
7095 typedef __Reply__io_service_get_state_t Reply __attribute__((unused));
7096
7097 /*
7098 * typedef struct {
7099 * mach_msg_header_t Head;
7100 * NDR_record_t NDR;
7101 * kern_return_t RetCode;
7102 * } mig_reply_error_t;
7103 */
7104
7105 Request *In0P = (Request *) InHeadP;
7106 Reply *OutP = (Reply *) OutHeadP;
7107#ifdef __MIG_check__Request__io_service_get_state_t__defined
7108 kern_return_t check_result;
7109#endif /* __MIG_check__Request__io_service_get_state_t__defined */
7110
7111#if __MigKernelSpecificCode
7112#else
7113#endif /* __MigKernelSpecificCode */
7114 io_object_t service;
7115
7116 __DeclareRcvRpc(2856, "io_service_get_state")
7117 __BeforeRcvRpc(2856, "io_service_get_state")
7118
7119#if defined(__MIG_check__Request__io_service_get_state_t__defined)
7120 check_result = __MIG_check__Request__io_service_get_state_t((__Request *)In0P);
7121 if (check_result != MACH_MSG_SUCCESS)
7122 { MIG_RETURN_ERROR(OutP, check_result); }
7123#endif /* defined(__MIG_check__Request__io_service_get_state_t__defined) */
7124
7125 service = iokit_lookup_object_port(In0P->Head.msgh_request_port);
7126
7127 OutP->RetCode = is_io_service_get_state(service, &OutP->state, &OutP->busy_state, &OutP->accumulated_busy_time);
7128 iokit_remove_reference(service);
7129 if (OutP->RetCode != KERN_SUCCESS) {
7130 MIG_RETURN_ERROR(OutP, OutP->RetCode);
7131 }
7132#if __MigKernelSpecificCode
7133#endif /* __MigKernelSpecificCode */
7134
7135 OutP->NDR = NDR_record;
7136
7137
7138 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
7139 __AfterRcvRpc(2856, "io_service_get_state")
7140}
7141
7142#if ( __MigTypeCheck )
7143#if __MIG_check__Request__iokit_subsystem__
7144#if !defined(__MIG_check__Request__io_service_get_matching_services_ool_t__defined)
7145#define __MIG_check__Request__io_service_get_matching_services_ool_t__defined
7146
7147mig_internal kern_return_t __MIG_check__Request__io_service_get_matching_services_ool_t(__attribute__((__unused__)) __Request__io_service_get_matching_services_ool_t *In0P)
7148{
7149
7150 typedef __Request__io_service_get_matching_services_ool_t __Request;
7151#if __MigTypeCheck
7152 if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
7153 (In0P->msgh_body.msgh_descriptor_count != 1) ||
7154 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
7155 return MIG_BAD_ARGUMENTS;
7156#endif /* __MigTypeCheck */
7157
7158#if __MigTypeCheck
7159 if (In0P->matching.type != MACH_MSG_OOL_DESCRIPTOR)
7160 return MIG_TYPE_ERROR;
7161#endif /* __MigTypeCheck */
7162
7163#if __MigTypeCheck
7164 if (In0P->matching.size != In0P->matchingCnt)
7165 return MIG_TYPE_ERROR;
7166#endif /* __MigTypeCheck */
7167
7168 return MACH_MSG_SUCCESS;
7169}
7170#endif /* !defined(__MIG_check__Request__io_service_get_matching_services_ool_t__defined) */
7171#endif /* __MIG_check__Request__iokit_subsystem__ */
7172#endif /* ( __MigTypeCheck ) */
7173
7174
7175/* Routine io_service_get_matching_services_ool */
7176mig_internal novalue _Xio_service_get_matching_services_ool
7177 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
7178{
7179
7180#ifdef __MigPackStructs
7181#pragma pack(4)
7182#endif
7183 typedef struct {
7184 mach_msg_header_t Head;
7185 /* start of the kernel processed data */
7186 mach_msg_body_t msgh_body;
7187 mach_msg_ool_descriptor_t matching;
7188 /* end of the kernel processed data */
7189 NDR_record_t NDR;
7190 mach_msg_type_number_t matchingCnt;
7191 mach_msg_trailer_t trailer;
7192 } Request __attribute__((unused));
7193#ifdef __MigPackStructs
7194#pragma pack()
7195#endif
7196 typedef __Request__io_service_get_matching_services_ool_t __Request;
7197 typedef __Reply__io_service_get_matching_services_ool_t Reply __attribute__((unused));
7198
7199 /*
7200 * typedef struct {
7201 * mach_msg_header_t Head;
7202 * NDR_record_t NDR;
7203 * kern_return_t RetCode;
7204 * } mig_reply_error_t;
7205 */
7206
7207 Request *In0P = (Request *) InHeadP;
7208 Reply *OutP = (Reply *) OutHeadP;
7209#ifdef __MIG_check__Request__io_service_get_matching_services_ool_t__defined
7210 kern_return_t check_result;
7211#endif /* __MIG_check__Request__io_service_get_matching_services_ool_t__defined */
7212
7213#if __MigKernelSpecificCode
7214#if UseStaticTemplates
7215 const static mach_msg_port_descriptor_t existingTemplate = {
7216 /* name = */ MACH_PORT_NULL,
7217 /* pad1 = */ 0,
7218 /* pad2 = */ 0,
7219 /* disp = */ 17,
7220 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
7221 };
7222#endif /* UseStaticTemplates */
7223
7224#else
7225#if UseStaticTemplates
7226 const static mach_msg_port_descriptor_t existingTemplate = {
7227 /* name = */ MACH_PORT_NULL,
7228 /* pad1 = */ 0,
7229 /* pad2 = */ 0,
7230 /* disp = */ 19,
7231 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
7232 };
7233#endif /* UseStaticTemplates */
7234
7235#endif /* __MigKernelSpecificCode */
7236 kern_return_t RetCode;
7237 io_object_t existing;
7238
7239 __DeclareRcvRpc(2857, "io_service_get_matching_services_ool")
7240 __BeforeRcvRpc(2857, "io_service_get_matching_services_ool")
7241
7242#if defined(__MIG_check__Request__io_service_get_matching_services_ool_t__defined)
7243 check_result = __MIG_check__Request__io_service_get_matching_services_ool_t((__Request *)In0P);
7244 if (check_result != MACH_MSG_SUCCESS)
7245 { MIG_RETURN_ERROR(OutP, check_result); }
7246#endif /* defined(__MIG_check__Request__io_service_get_matching_services_ool_t__defined) */
7247
7248#if UseStaticTemplates
7249 OutP->existing = existingTemplate;
7250#else /* UseStaticTemplates */
7251#if __MigKernelSpecificCode
7252 OutP->existing.disposition = 17;
7253#else
7254 OutP->existing.disposition = 19;
7255#endif /* __MigKernelSpecificCode */
7256#if !(defined(KERNEL) && defined(__LP64__))
7257 OutP->existing.pad1 = 0;
7258#endif
7259 OutP->existing.pad2 = 0;
7260 OutP->existing.type = MACH_MSG_PORT_DESCRIPTOR;
7261#if defined(KERNEL)
7262 OutP->existing.pad_end = 0;
7263#endif
7264#endif /* UseStaticTemplates */
7265
7266
7267 RetCode = is_io_service_get_matching_services_ool(In0P->Head.msgh_request_port, (io_buf_ptr_t)(In0P->matching.address), In0P->matching.size, &OutP->result, &existing);
7268 if (RetCode != KERN_SUCCESS) {
7269 MIG_RETURN_ERROR(OutP, RetCode);
7270 }
7271#if __MigKernelSpecificCode
7272#endif /* __MigKernelSpecificCode */
7273 OutP->existing.name = (mach_port_t)iokit_make_object_port(existing);
7274
7275
7276 OutP->NDR = NDR_record;
7277
7278
7279 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
7280 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
7281 OutP->msgh_body.msgh_descriptor_count = 1;
7282 __AfterRcvRpc(2857, "io_service_get_matching_services_ool")
7283}
7284
7285#if ( __MigTypeCheck )
7286#if __MIG_check__Request__iokit_subsystem__
7287#if !defined(__MIG_check__Request__io_service_match_property_table_ool_t__defined)
7288#define __MIG_check__Request__io_service_match_property_table_ool_t__defined
7289
7290mig_internal kern_return_t __MIG_check__Request__io_service_match_property_table_ool_t(__attribute__((__unused__)) __Request__io_service_match_property_table_ool_t *In0P)
7291{
7292
7293 typedef __Request__io_service_match_property_table_ool_t __Request;
7294#if __MigTypeCheck
7295 if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
7296 (In0P->msgh_body.msgh_descriptor_count != 1) ||
7297 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
7298 return MIG_BAD_ARGUMENTS;
7299#endif /* __MigTypeCheck */
7300
7301#if __MigTypeCheck
7302 if (In0P->matching.type != MACH_MSG_OOL_DESCRIPTOR)
7303 return MIG_TYPE_ERROR;
7304#endif /* __MigTypeCheck */
7305
7306#if __MigTypeCheck
7307 if (In0P->matching.size != In0P->matchingCnt)
7308 return MIG_TYPE_ERROR;
7309#endif /* __MigTypeCheck */
7310
7311 return MACH_MSG_SUCCESS;
7312}
7313#endif /* !defined(__MIG_check__Request__io_service_match_property_table_ool_t__defined) */
7314#endif /* __MIG_check__Request__iokit_subsystem__ */
7315#endif /* ( __MigTypeCheck ) */
7316
7317
7318/* Routine io_service_match_property_table_ool */
7319mig_internal novalue _Xio_service_match_property_table_ool
7320 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
7321{
7322
7323#ifdef __MigPackStructs
7324#pragma pack(4)
7325#endif
7326 typedef struct {
7327 mach_msg_header_t Head;
7328 /* start of the kernel processed data */
7329 mach_msg_body_t msgh_body;
7330 mach_msg_ool_descriptor_t matching;
7331 /* end of the kernel processed data */
7332 NDR_record_t NDR;
7333 mach_msg_type_number_t matchingCnt;
7334 mach_msg_trailer_t trailer;
7335 } Request __attribute__((unused));
7336#ifdef __MigPackStructs
7337#pragma pack()
7338#endif
7339 typedef __Request__io_service_match_property_table_ool_t __Request;
7340 typedef __Reply__io_service_match_property_table_ool_t Reply __attribute__((unused));
7341
7342 /*
7343 * typedef struct {
7344 * mach_msg_header_t Head;
7345 * NDR_record_t NDR;
7346 * kern_return_t RetCode;
7347 * } mig_reply_error_t;
7348 */
7349
7350 Request *In0P = (Request *) InHeadP;
7351 Reply *OutP = (Reply *) OutHeadP;
7352#ifdef __MIG_check__Request__io_service_match_property_table_ool_t__defined
7353 kern_return_t check_result;
7354#endif /* __MIG_check__Request__io_service_match_property_table_ool_t__defined */
7355
7356#if __MigKernelSpecificCode
7357#else
7358#endif /* __MigKernelSpecificCode */
7359 io_object_t service;
7360
7361 __DeclareRcvRpc(2858, "io_service_match_property_table_ool")
7362 __BeforeRcvRpc(2858, "io_service_match_property_table_ool")
7363
7364#if defined(__MIG_check__Request__io_service_match_property_table_ool_t__defined)
7365 check_result = __MIG_check__Request__io_service_match_property_table_ool_t((__Request *)In0P);
7366 if (check_result != MACH_MSG_SUCCESS)
7367 { MIG_RETURN_ERROR(OutP, check_result); }
7368#endif /* defined(__MIG_check__Request__io_service_match_property_table_ool_t__defined) */
7369
7370 service = iokit_lookup_object_port(In0P->Head.msgh_request_port);
7371
7372 OutP->RetCode = is_io_service_match_property_table_ool(service, (io_buf_ptr_t)(In0P->matching.address), In0P->matching.size, &OutP->result, &OutP->matches);
7373 iokit_remove_reference(service);
7374 if (OutP->RetCode != KERN_SUCCESS) {
7375 MIG_RETURN_ERROR(OutP, OutP->RetCode);
7376 }
7377#if __MigKernelSpecificCode
7378#endif /* __MigKernelSpecificCode */
7379
7380 OutP->NDR = NDR_record;
7381
7382
7383 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
7384 __AfterRcvRpc(2858, "io_service_match_property_table_ool")
7385}
7386
7387#if ( __MigTypeCheck )
7388#if __MIG_check__Request__iokit_subsystem__
7389#if !defined(__MIG_check__Request__io_service_add_notification_ool_t__defined)
7390#define __MIG_check__Request__io_service_add_notification_ool_t__defined
7391
7392mig_internal kern_return_t __MIG_check__Request__io_service_add_notification_ool_t(__attribute__((__unused__)) __Request__io_service_add_notification_ool_t *In0P, __attribute__((__unused__)) __Request__io_service_add_notification_ool_t **In1PP)
7393{
7394
7395 typedef __Request__io_service_add_notification_ool_t __Request;
7396 __Request *In1P;
7397#if __MigTypeCheck
7398 unsigned int msgh_size;
7399#endif /* __MigTypeCheck */
7400 unsigned int msgh_size_delta;
7401
7402#if __MigTypeCheck
7403 msgh_size = In0P->Head.msgh_size;
7404 if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
7405 (In0P->msgh_body.msgh_descriptor_count != 2) ||
7406 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 160)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
7407 return MIG_BAD_ARGUMENTS;
7408#endif /* __MigTypeCheck */
7409
7410#if __MigTypeCheck
7411 if (In0P->matching.type != MACH_MSG_OOL_DESCRIPTOR)
7412 return MIG_TYPE_ERROR;
7413#endif /* __MigTypeCheck */
7414
7415#if __MigTypeCheck
7416 if (In0P->wake_port.type != MACH_MSG_PORT_DESCRIPTOR ||
7417 In0P->wake_port.disposition != 17)
7418 return MIG_TYPE_ERROR;
7419#endif /* __MigTypeCheck */
7420
7421#if defined(__NDR_convert__int_rep__Request__io_service_add_notification_ool_t__notification_typeCnt__defined)
7422 if (In0P->NDR.int_rep != NDR_record.int_rep)
7423 __NDR_convert__int_rep__Request__io_service_add_notification_ool_t__notification_typeCnt(&In0P->notification_typeCnt, In0P->NDR.int_rep);
7424#endif /* __NDR_convert__int_rep__Request__io_service_add_notification_ool_t__notification_typeCnt__defined */
7425 msgh_size_delta = _WALIGN_(In0P->notification_typeCnt);
7426#if __MigTypeCheck
7427 if ( In0P->notification_typeCnt > 128 )
7428 return MIG_BAD_ARGUMENTS;
7429 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 160)) < In0P->notification_typeCnt) ||
7430 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 160) + _WALIGN_(In0P->notification_typeCnt)))
7431 return MIG_BAD_ARGUMENTS;
7432 msgh_size -= msgh_size_delta;
7433#endif /* __MigTypeCheck */
7434
7435 *In1PP = In1P = (__Request *) ((pointer_t) In0P + msgh_size_delta - 128);
7436
7437#if defined(__NDR_convert__int_rep__Request__io_service_add_notification_ool_t__referenceCnt__defined)
7438 if (In0P->NDR.int_rep != NDR_record.int_rep)
7439 __NDR_convert__int_rep__Request__io_service_add_notification_ool_t__referenceCnt(&In1P->referenceCnt, In1P->NDR.int_rep);
7440#endif /* __NDR_convert__int_rep__Request__io_service_add_notification_ool_t__referenceCnt__defined */
7441#if __MigTypeCheck
7442 if ( In1P->referenceCnt > 8 )
7443 return MIG_BAD_ARGUMENTS;
7444 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 160)) / 4 < In1P->referenceCnt) ||
7445 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 160) + (4 * In1P->referenceCnt)))
7446 return MIG_BAD_ARGUMENTS;
7447#endif /* __MigTypeCheck */
7448
7449#if __MigTypeCheck
7450 if (In0P->matching.size != In1P->matchingCnt)
7451 return MIG_TYPE_ERROR;
7452#endif /* __MigTypeCheck */
7453
7454#if __MigTypeCheck
7455 {
7456 char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
7457#if __MigKernelSpecificCode
7458 size_t strnlen_limit;
7459#else
7460 size_t memchr_limit;
7461#endif /* __MigKernelSpecificCode */
7462
7463#if __MigKernelSpecificCode
7464 strnlen_limit = min((msg_limit - In0P->notification_type), 128);
7465 if (( strnlen(In0P->notification_type, strnlen_limit) >= 128 + 1 ))
7466 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
7467#else
7468 memchr_limit = min((msg_limit - In0P->notification_type), 128);
7469 if (( memchr(In0P->notification_type, '\0', memchr_limit) == NULL ))
7470 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
7471#endif /* __MigKernelSpecificCode */
7472 }
7473#endif /* __MigTypeCheck */
7474
7475 return MACH_MSG_SUCCESS;
7476}
7477#endif /* !defined(__MIG_check__Request__io_service_add_notification_ool_t__defined) */
7478#endif /* __MIG_check__Request__iokit_subsystem__ */
7479#endif /* ( __MigTypeCheck ) */
7480
7481
7482/* Routine io_service_add_notification_ool */
7483mig_internal novalue _Xio_service_add_notification_ool
7484 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
7485{
7486
7487#ifdef __MigPackStructs
7488#pragma pack(4)
7489#endif
7490 typedef struct {
7491 mach_msg_header_t Head;
7492 /* start of the kernel processed data */
7493 mach_msg_body_t msgh_body;
7494 mach_msg_ool_descriptor_t matching;
7495 mach_msg_port_descriptor_t wake_port;
7496 /* end of the kernel processed data */
7497 NDR_record_t NDR;
7498 mach_msg_type_number_t notification_typeOffset; /* MiG doesn't use it */
7499 mach_msg_type_number_t notification_typeCnt;
7500 char notification_type[128];
7501 mach_msg_type_number_t matchingCnt;
7502 mach_msg_type_number_t referenceCnt;
7503 natural_t reference[8];
7504 mach_msg_trailer_t trailer;
7505 } Request __attribute__((unused));
7506#ifdef __MigPackStructs
7507#pragma pack()
7508#endif
7509 typedef __Request__io_service_add_notification_ool_t __Request;
7510 typedef __Reply__io_service_add_notification_ool_t Reply __attribute__((unused));
7511
7512 /*
7513 * typedef struct {
7514 * mach_msg_header_t Head;
7515 * NDR_record_t NDR;
7516 * kern_return_t RetCode;
7517 * } mig_reply_error_t;
7518 */
7519
7520 Request *In0P = (Request *) InHeadP;
7521 Request *In1P;
7522 Reply *OutP = (Reply *) OutHeadP;
7523#ifdef __MIG_check__Request__io_service_add_notification_ool_t__defined
7524 kern_return_t check_result;
7525#endif /* __MIG_check__Request__io_service_add_notification_ool_t__defined */
7526
7527#if __MigKernelSpecificCode
7528#if UseStaticTemplates
7529 const static mach_msg_port_descriptor_t notificationTemplate = {
7530 /* name = */ MACH_PORT_NULL,
7531 /* pad1 = */ 0,
7532 /* pad2 = */ 0,
7533 /* disp = */ 17,
7534 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
7535 };
7536#endif /* UseStaticTemplates */
7537
7538#else
7539#if UseStaticTemplates
7540 const static mach_msg_port_descriptor_t notificationTemplate = {
7541 /* name = */ MACH_PORT_NULL,
7542 /* pad1 = */ 0,
7543 /* pad2 = */ 0,
7544 /* disp = */ 19,
7545 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
7546 };
7547#endif /* UseStaticTemplates */
7548
7549#endif /* __MigKernelSpecificCode */
7550 kern_return_t RetCode;
7551 io_object_t notification;
7552
7553 __DeclareRcvRpc(2859, "io_service_add_notification_ool")
7554 __BeforeRcvRpc(2859, "io_service_add_notification_ool")
7555
7556#if defined(__MIG_check__Request__io_service_add_notification_ool_t__defined)
7557 check_result = __MIG_check__Request__io_service_add_notification_ool_t((__Request *)In0P, (__Request **)&In1P);
7558 if (check_result != MACH_MSG_SUCCESS)
7559 { MIG_RETURN_ERROR(OutP, check_result); }
7560#endif /* defined(__MIG_check__Request__io_service_add_notification_ool_t__defined) */
7561
7562#if UseStaticTemplates
7563 OutP->notification = notificationTemplate;
7564#else /* UseStaticTemplates */
7565#if __MigKernelSpecificCode
7566 OutP->notification.disposition = 17;
7567#else
7568 OutP->notification.disposition = 19;
7569#endif /* __MigKernelSpecificCode */
7570#if !(defined(KERNEL) && defined(__LP64__))
7571 OutP->notification.pad1 = 0;
7572#endif
7573 OutP->notification.pad2 = 0;
7574 OutP->notification.type = MACH_MSG_PORT_DESCRIPTOR;
7575#if defined(KERNEL)
7576 OutP->notification.pad_end = 0;
7577#endif
7578#endif /* UseStaticTemplates */
7579
7580
7581 RetCode = is_io_service_add_notification_ool(In0P->Head.msgh_request_port, In0P->notification_type, (io_buf_ptr_t)(In0P->matching.address), In0P->matching.size, In0P->wake_port.name, In1P->reference, In1P->referenceCnt, &OutP->result, &notification);
7582 if (RetCode != KERN_SUCCESS) {
7583 MIG_RETURN_ERROR(OutP, RetCode);
7584 }
7585#if __MigKernelSpecificCode
7586#endif /* __MigKernelSpecificCode */
7587 OutP->notification.name = (mach_port_t)iokit_make_object_port(notification);
7588
7589
7590 OutP->NDR = NDR_record;
7591
7592
7593 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
7594 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
7595 OutP->msgh_body.msgh_descriptor_count = 1;
7596 __AfterRcvRpc(2859, "io_service_add_notification_ool")
7597}
7598
7599#if ( __MigTypeCheck )
7600#if __MIG_check__Request__iokit_subsystem__
7601#if !defined(__MIG_check__Request__io_object_get_superclass_t__defined)
7602#define __MIG_check__Request__io_object_get_superclass_t__defined
7603
7604mig_internal kern_return_t __MIG_check__Request__io_object_get_superclass_t(__attribute__((__unused__)) __Request__io_object_get_superclass_t *In0P)
7605{
7606
7607 typedef __Request__io_object_get_superclass_t __Request;
7608#if __MigTypeCheck
7609 unsigned int msgh_size;
7610#endif /* __MigTypeCheck */
7611
7612#if __MigTypeCheck
7613 msgh_size = In0P->Head.msgh_size;
7614 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
7615 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 128)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
7616 return MIG_BAD_ARGUMENTS;
7617#endif /* __MigTypeCheck */
7618
7619#if defined(__NDR_convert__int_rep__Request__io_object_get_superclass_t__obj_nameCnt__defined)
7620 if (In0P->NDR.int_rep != NDR_record.int_rep)
7621 __NDR_convert__int_rep__Request__io_object_get_superclass_t__obj_nameCnt(&In0P->obj_nameCnt, In0P->NDR.int_rep);
7622#endif /* __NDR_convert__int_rep__Request__io_object_get_superclass_t__obj_nameCnt__defined */
7623#if __MigTypeCheck
7624 if ( In0P->obj_nameCnt > 128 )
7625 return MIG_BAD_ARGUMENTS;
7626 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 128)) < In0P->obj_nameCnt) ||
7627 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 128) + _WALIGN_(In0P->obj_nameCnt)))
7628 return MIG_BAD_ARGUMENTS;
7629#endif /* __MigTypeCheck */
7630
7631#if __MigTypeCheck
7632 {
7633 char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
7634#if __MigKernelSpecificCode
7635 size_t strnlen_limit;
7636#else
7637 size_t memchr_limit;
7638#endif /* __MigKernelSpecificCode */
7639
7640#if __MigKernelSpecificCode
7641 strnlen_limit = min((msg_limit - In0P->obj_name), 128);
7642 if (( strnlen(In0P->obj_name, strnlen_limit) >= 128 + 1 ))
7643 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
7644#else
7645 memchr_limit = min((msg_limit - In0P->obj_name), 128);
7646 if (( memchr(In0P->obj_name, '\0', memchr_limit) == NULL ))
7647 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
7648#endif /* __MigKernelSpecificCode */
7649 }
7650#endif /* __MigTypeCheck */
7651
7652 return MACH_MSG_SUCCESS;
7653}
7654#endif /* !defined(__MIG_check__Request__io_object_get_superclass_t__defined) */
7655#endif /* __MIG_check__Request__iokit_subsystem__ */
7656#endif /* ( __MigTypeCheck ) */
7657
7658
7659/* Routine io_object_get_superclass */
7660mig_internal novalue _Xio_object_get_superclass
7661 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
7662{
7663
7664#ifdef __MigPackStructs
7665#pragma pack(4)
7666#endif
7667 typedef struct {
7668 mach_msg_header_t Head;
7669 NDR_record_t NDR;
7670 mach_msg_type_number_t obj_nameOffset; /* MiG doesn't use it */
7671 mach_msg_type_number_t obj_nameCnt;
7672 char obj_name[128];
7673 mach_msg_trailer_t trailer;
7674 } Request __attribute__((unused));
7675#ifdef __MigPackStructs
7676#pragma pack()
7677#endif
7678 typedef __Request__io_object_get_superclass_t __Request;
7679 typedef __Reply__io_object_get_superclass_t Reply __attribute__((unused));
7680
7681 /*
7682 * typedef struct {
7683 * mach_msg_header_t Head;
7684 * NDR_record_t NDR;
7685 * kern_return_t RetCode;
7686 * } mig_reply_error_t;
7687 */
7688
7689 Request *In0P = (Request *) InHeadP;
7690 Reply *OutP = (Reply *) OutHeadP;
7691#ifdef __MIG_check__Request__io_object_get_superclass_t__defined
7692 kern_return_t check_result;
7693#endif /* __MIG_check__Request__io_object_get_superclass_t__defined */
7694
7695#if __MigKernelSpecificCode
7696#else
7697#endif /* __MigKernelSpecificCode */
7698 __DeclareRcvRpc(2860, "io_object_get_superclass")
7699 __BeforeRcvRpc(2860, "io_object_get_superclass")
7700
7701#if defined(__MIG_check__Request__io_object_get_superclass_t__defined)
7702 check_result = __MIG_check__Request__io_object_get_superclass_t((__Request *)In0P);
7703 if (check_result != MACH_MSG_SUCCESS)
7704 { MIG_RETURN_ERROR(OutP, check_result); }
7705#endif /* defined(__MIG_check__Request__io_object_get_superclass_t__defined) */
7706
7707 OutP->RetCode = is_io_object_get_superclass(In0P->Head.msgh_request_port, In0P->obj_name, OutP->class_name);
7708 if (OutP->RetCode != KERN_SUCCESS) {
7709 MIG_RETURN_ERROR(OutP, OutP->RetCode);
7710 }
7711#if __MigKernelSpecificCode
7712#endif /* __MigKernelSpecificCode */
7713
7714 OutP->NDR = NDR_record;
7715
7716#ifdef __LP64__
7717 {
7718 size_t strLength = strlen(OutP->class_name) + 1;
7719 if (strLength > 0xffffffff)
7720 MIG_RETURN_ERROR(OutP, MIG_BAD_ARGUMENTS);
7721 OutP->class_nameCnt = (mach_msg_type_number_t) strLength;
7722 }
7723#else
7724 OutP->class_nameCnt = (mach_msg_type_number_t) strlen(OutP->class_name) + 1;
7725#endif /* __LP64__ */
7726 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 128) + (_WALIGN_((OutP->class_nameCnt + 3) & ~3));
7727
7728 __AfterRcvRpc(2860, "io_object_get_superclass")
7729}
7730
7731#if ( __MigTypeCheck )
7732#if __MIG_check__Request__iokit_subsystem__
7733#if !defined(__MIG_check__Request__io_object_get_bundle_identifier_t__defined)
7734#define __MIG_check__Request__io_object_get_bundle_identifier_t__defined
7735
7736mig_internal kern_return_t __MIG_check__Request__io_object_get_bundle_identifier_t(__attribute__((__unused__)) __Request__io_object_get_bundle_identifier_t *In0P)
7737{
7738
7739 typedef __Request__io_object_get_bundle_identifier_t __Request;
7740#if __MigTypeCheck
7741 unsigned int msgh_size;
7742#endif /* __MigTypeCheck */
7743
7744#if __MigTypeCheck
7745 msgh_size = In0P->Head.msgh_size;
7746 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
7747 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 128)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
7748 return MIG_BAD_ARGUMENTS;
7749#endif /* __MigTypeCheck */
7750
7751#if defined(__NDR_convert__int_rep__Request__io_object_get_bundle_identifier_t__obj_nameCnt__defined)
7752 if (In0P->NDR.int_rep != NDR_record.int_rep)
7753 __NDR_convert__int_rep__Request__io_object_get_bundle_identifier_t__obj_nameCnt(&In0P->obj_nameCnt, In0P->NDR.int_rep);
7754#endif /* __NDR_convert__int_rep__Request__io_object_get_bundle_identifier_t__obj_nameCnt__defined */
7755#if __MigTypeCheck
7756 if ( In0P->obj_nameCnt > 128 )
7757 return MIG_BAD_ARGUMENTS;
7758 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 128)) < In0P->obj_nameCnt) ||
7759 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 128) + _WALIGN_(In0P->obj_nameCnt)))
7760 return MIG_BAD_ARGUMENTS;
7761#endif /* __MigTypeCheck */
7762
7763#if __MigTypeCheck
7764 {
7765 char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
7766#if __MigKernelSpecificCode
7767 size_t strnlen_limit;
7768#else
7769 size_t memchr_limit;
7770#endif /* __MigKernelSpecificCode */
7771
7772#if __MigKernelSpecificCode
7773 strnlen_limit = min((msg_limit - In0P->obj_name), 128);
7774 if (( strnlen(In0P->obj_name, strnlen_limit) >= 128 + 1 ))
7775 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
7776#else
7777 memchr_limit = min((msg_limit - In0P->obj_name), 128);
7778 if (( memchr(In0P->obj_name, '\0', memchr_limit) == NULL ))
7779 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
7780#endif /* __MigKernelSpecificCode */
7781 }
7782#endif /* __MigTypeCheck */
7783
7784 return MACH_MSG_SUCCESS;
7785}
7786#endif /* !defined(__MIG_check__Request__io_object_get_bundle_identifier_t__defined) */
7787#endif /* __MIG_check__Request__iokit_subsystem__ */
7788#endif /* ( __MigTypeCheck ) */
7789
7790
7791/* Routine io_object_get_bundle_identifier */
7792mig_internal novalue _Xio_object_get_bundle_identifier
7793 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
7794{
7795
7796#ifdef __MigPackStructs
7797#pragma pack(4)
7798#endif
7799 typedef struct {
7800 mach_msg_header_t Head;
7801 NDR_record_t NDR;
7802 mach_msg_type_number_t obj_nameOffset; /* MiG doesn't use it */
7803 mach_msg_type_number_t obj_nameCnt;
7804 char obj_name[128];
7805 mach_msg_trailer_t trailer;
7806 } Request __attribute__((unused));
7807#ifdef __MigPackStructs
7808#pragma pack()
7809#endif
7810 typedef __Request__io_object_get_bundle_identifier_t __Request;
7811 typedef __Reply__io_object_get_bundle_identifier_t Reply __attribute__((unused));
7812
7813 /*
7814 * typedef struct {
7815 * mach_msg_header_t Head;
7816 * NDR_record_t NDR;
7817 * kern_return_t RetCode;
7818 * } mig_reply_error_t;
7819 */
7820
7821 Request *In0P = (Request *) InHeadP;
7822 Reply *OutP = (Reply *) OutHeadP;
7823#ifdef __MIG_check__Request__io_object_get_bundle_identifier_t__defined
7824 kern_return_t check_result;
7825#endif /* __MIG_check__Request__io_object_get_bundle_identifier_t__defined */
7826
7827#if __MigKernelSpecificCode
7828#else
7829#endif /* __MigKernelSpecificCode */
7830 __DeclareRcvRpc(2861, "io_object_get_bundle_identifier")
7831 __BeforeRcvRpc(2861, "io_object_get_bundle_identifier")
7832
7833#if defined(__MIG_check__Request__io_object_get_bundle_identifier_t__defined)
7834 check_result = __MIG_check__Request__io_object_get_bundle_identifier_t((__Request *)In0P);
7835 if (check_result != MACH_MSG_SUCCESS)
7836 { MIG_RETURN_ERROR(OutP, check_result); }
7837#endif /* defined(__MIG_check__Request__io_object_get_bundle_identifier_t__defined) */
7838
7839 OutP->RetCode = is_io_object_get_bundle_identifier(In0P->Head.msgh_request_port, In0P->obj_name, OutP->class_name);
7840 if (OutP->RetCode != KERN_SUCCESS) {
7841 MIG_RETURN_ERROR(OutP, OutP->RetCode);
7842 }
7843#if __MigKernelSpecificCode
7844#endif /* __MigKernelSpecificCode */
7845
7846 OutP->NDR = NDR_record;
7847
7848#ifdef __LP64__
7849 {
7850 size_t strLength = strlen(OutP->class_name) + 1;
7851 if (strLength > 0xffffffff)
7852 MIG_RETURN_ERROR(OutP, MIG_BAD_ARGUMENTS);
7853 OutP->class_nameCnt = (mach_msg_type_number_t) strLength;
7854 }
7855#else
7856 OutP->class_nameCnt = (mach_msg_type_number_t) strlen(OutP->class_name) + 1;
7857#endif /* __LP64__ */
7858 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 128) + (_WALIGN_((OutP->class_nameCnt + 3) & ~3));
7859
7860 __AfterRcvRpc(2861, "io_object_get_bundle_identifier")
7861}
7862
7863#if ( __MigTypeCheck )
7864#if __MIG_check__Request__iokit_subsystem__
7865#if !defined(__MIG_check__Request__io_service_open_extended_t__defined)
7866#define __MIG_check__Request__io_service_open_extended_t__defined
7867
7868mig_internal kern_return_t __MIG_check__Request__io_service_open_extended_t(__attribute__((__unused__)) __Request__io_service_open_extended_t *In0P)
7869{
7870
7871 typedef __Request__io_service_open_extended_t __Request;
7872#if __MigTypeCheck
7873 if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
7874 (In0P->msgh_body.msgh_descriptor_count != 2) ||
7875 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
7876 return MIG_BAD_ARGUMENTS;
7877#endif /* __MigTypeCheck */
7878
7879#if __MigTypeCheck
7880 if (In0P->owningTask.type != MACH_MSG_PORT_DESCRIPTOR ||
7881 In0P->owningTask.disposition != 17)
7882 return MIG_TYPE_ERROR;
7883#endif /* __MigTypeCheck */
7884
7885#if __MigTypeCheck
7886 if (In0P->properties.type != MACH_MSG_OOL_DESCRIPTOR)
7887 return MIG_TYPE_ERROR;
7888#endif /* __MigTypeCheck */
7889
7890#if __MigTypeCheck
7891 if (In0P->properties.size != In0P->propertiesCnt)
7892 return MIG_TYPE_ERROR;
7893#endif /* __MigTypeCheck */
7894
7895 return MACH_MSG_SUCCESS;
7896}
7897#endif /* !defined(__MIG_check__Request__io_service_open_extended_t__defined) */
7898#endif /* __MIG_check__Request__iokit_subsystem__ */
7899#endif /* ( __MigTypeCheck ) */
7900
7901
7902/* Routine io_service_open_extended */
7903mig_internal novalue _Xio_service_open_extended
7904 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
7905{
7906
7907#ifdef __MigPackStructs
7908#pragma pack(4)
7909#endif
7910 typedef struct {
7911 mach_msg_header_t Head;
7912 /* start of the kernel processed data */
7913 mach_msg_body_t msgh_body;
7914 mach_msg_port_descriptor_t owningTask;
7915 mach_msg_ool_descriptor_t properties;
7916 /* end of the kernel processed data */
7917 NDR_record_t NDR;
7918 uint32_t connect_type;
7919 NDR_record_t ndr;
7920 mach_msg_type_number_t propertiesCnt;
7921 mach_msg_trailer_t trailer;
7922 } Request __attribute__((unused));
7923#ifdef __MigPackStructs
7924#pragma pack()
7925#endif
7926 typedef __Request__io_service_open_extended_t __Request;
7927 typedef __Reply__io_service_open_extended_t Reply __attribute__((unused));
7928
7929 /*
7930 * typedef struct {
7931 * mach_msg_header_t Head;
7932 * NDR_record_t NDR;
7933 * kern_return_t RetCode;
7934 * } mig_reply_error_t;
7935 */
7936
7937 Request *In0P = (Request *) InHeadP;
7938 Reply *OutP = (Reply *) OutHeadP;
7939#ifdef __MIG_check__Request__io_service_open_extended_t__defined
7940 kern_return_t check_result;
7941#endif /* __MIG_check__Request__io_service_open_extended_t__defined */
7942
7943#if __MigKernelSpecificCode
7944#if UseStaticTemplates
7945 const static mach_msg_port_descriptor_t connectionTemplate = {
7946 /* name = */ MACH_PORT_NULL,
7947 /* pad1 = */ 0,
7948 /* pad2 = */ 0,
7949 /* disp = */ 17,
7950 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
7951 };
7952#endif /* UseStaticTemplates */
7953
7954#else
7955#if UseStaticTemplates
7956 const static mach_msg_port_descriptor_t connectionTemplate = {
7957 /* name = */ MACH_PORT_NULL,
7958 /* pad1 = */ 0,
7959 /* pad2 = */ 0,
7960 /* disp = */ 19,
7961 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
7962 };
7963#endif /* UseStaticTemplates */
7964
7965#endif /* __MigKernelSpecificCode */
7966 kern_return_t RetCode;
7967 io_object_t service;
7968 task_t owningTask;
7969 io_connect_t connection;
7970
7971 __DeclareRcvRpc(2862, "io_service_open_extended")
7972 __BeforeRcvRpc(2862, "io_service_open_extended")
7973
7974#if defined(__MIG_check__Request__io_service_open_extended_t__defined)
7975 check_result = __MIG_check__Request__io_service_open_extended_t((__Request *)In0P);
7976 if (check_result != MACH_MSG_SUCCESS)
7977 { MIG_RETURN_ERROR(OutP, check_result); }
7978#endif /* defined(__MIG_check__Request__io_service_open_extended_t__defined) */
7979
7980#if UseStaticTemplates
7981 OutP->connection = connectionTemplate;
7982#else /* UseStaticTemplates */
7983#if __MigKernelSpecificCode
7984 OutP->connection.disposition = 17;
7985#else
7986 OutP->connection.disposition = 19;
7987#endif /* __MigKernelSpecificCode */
7988#if !(defined(KERNEL) && defined(__LP64__))
7989 OutP->connection.pad1 = 0;
7990#endif
7991 OutP->connection.pad2 = 0;
7992 OutP->connection.type = MACH_MSG_PORT_DESCRIPTOR;
7993#if defined(KERNEL)
7994 OutP->connection.pad_end = 0;
7995#endif
7996#endif /* UseStaticTemplates */
7997
7998
7999 service = iokit_lookup_object_port(In0P->Head.msgh_request_port);
8000
8001 owningTask = convert_port_to_task(In0P->owningTask.name);
8002
8003 RetCode = is_io_service_open_extended(service, owningTask, In0P->connect_type, In0P->ndr, (io_buf_ptr_t)(In0P->properties.address), In0P->properties.size, &OutP->result, &connection);
8004 task_deallocate(owningTask);
8005 iokit_remove_reference(service);
8006 if (RetCode != KERN_SUCCESS) {
8007 MIG_RETURN_ERROR(OutP, RetCode);
8008 }
8009#if __MigKernelSpecificCode
8010
8011 if (IP_VALID((ipc_port_t)In0P->owningTask.name))
8012 ipc_port_release_send((ipc_port_t)In0P->owningTask.name);
8013#endif /* __MigKernelSpecificCode */
8014 OutP->connection.name = (mach_port_t)iokit_make_connect_port(connection);
8015
8016
8017 OutP->NDR = NDR_record;
8018
8019
8020 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
8021 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
8022 OutP->msgh_body.msgh_descriptor_count = 1;
8023 __AfterRcvRpc(2862, "io_service_open_extended")
8024}
8025
8026#if ( __MigTypeCheck )
8027#if __MIG_check__Request__iokit_subsystem__
8028#if !defined(__MIG_check__Request__io_connect_map_memory_into_task_t__defined)
8029#define __MIG_check__Request__io_connect_map_memory_into_task_t__defined
8030
8031mig_internal kern_return_t __MIG_check__Request__io_connect_map_memory_into_task_t(__attribute__((__unused__)) __Request__io_connect_map_memory_into_task_t *In0P)
8032{
8033
8034 typedef __Request__io_connect_map_memory_into_task_t __Request;
8035#if __MigTypeCheck
8036 if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
8037 (In0P->msgh_body.msgh_descriptor_count != 1) ||
8038 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
8039 return MIG_BAD_ARGUMENTS;
8040#endif /* __MigTypeCheck */
8041
8042#if __MigTypeCheck
8043 if (In0P->into_task.type != MACH_MSG_PORT_DESCRIPTOR ||
8044 In0P->into_task.disposition != 17)
8045 return MIG_TYPE_ERROR;
8046#endif /* __MigTypeCheck */
8047
8048 return MACH_MSG_SUCCESS;
8049}
8050#endif /* !defined(__MIG_check__Request__io_connect_map_memory_into_task_t__defined) */
8051#endif /* __MIG_check__Request__iokit_subsystem__ */
8052#endif /* ( __MigTypeCheck ) */
8053
8054
8055/* Routine io_connect_map_memory_into_task */
8056mig_internal novalue _Xio_connect_map_memory_into_task
8057 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
8058{
8059
8060#ifdef __MigPackStructs
8061#pragma pack(4)
8062#endif
8063 typedef struct {
8064 mach_msg_header_t Head;
8065 /* start of the kernel processed data */
8066 mach_msg_body_t msgh_body;
8067 mach_msg_port_descriptor_t into_task;
8068 /* end of the kernel processed data */
8069 NDR_record_t NDR;
8070 uint32_t memory_type;
8071 mach_vm_address_t address;
8072 mach_vm_size_t size;
8073 uint32_t flags;
8074 mach_msg_trailer_t trailer;
8075 } Request __attribute__((unused));
8076#ifdef __MigPackStructs
8077#pragma pack()
8078#endif
8079 typedef __Request__io_connect_map_memory_into_task_t __Request;
8080 typedef __Reply__io_connect_map_memory_into_task_t Reply __attribute__((unused));
8081
8082 /*
8083 * typedef struct {
8084 * mach_msg_header_t Head;
8085 * NDR_record_t NDR;
8086 * kern_return_t RetCode;
8087 * } mig_reply_error_t;
8088 */
8089
8090 Request *In0P = (Request *) InHeadP;
8091 Reply *OutP = (Reply *) OutHeadP;
8092#ifdef __MIG_check__Request__io_connect_map_memory_into_task_t__defined
8093 kern_return_t check_result;
8094#endif /* __MIG_check__Request__io_connect_map_memory_into_task_t__defined */
8095
8096#if __MigKernelSpecificCode
8097#else
8098#endif /* __MigKernelSpecificCode */
8099 io_connect_t connection;
8100 task_t into_task;
8101
8102 __DeclareRcvRpc(2863, "io_connect_map_memory_into_task")
8103 __BeforeRcvRpc(2863, "io_connect_map_memory_into_task")
8104
8105#if defined(__MIG_check__Request__io_connect_map_memory_into_task_t__defined)
8106 check_result = __MIG_check__Request__io_connect_map_memory_into_task_t((__Request *)In0P);
8107 if (check_result != MACH_MSG_SUCCESS)
8108 { MIG_RETURN_ERROR(OutP, check_result); }
8109#endif /* defined(__MIG_check__Request__io_connect_map_memory_into_task_t__defined) */
8110
8111 connection = iokit_lookup_connect_port(In0P->Head.msgh_request_port);
8112
8113 into_task = convert_port_to_task(In0P->into_task.name);
8114
8115 OutP->RetCode = is_io_connect_map_memory_into_task(connection, In0P->memory_type, into_task, &In0P->address, &In0P->size, In0P->flags);
8116 task_deallocate(into_task);
8117 iokit_remove_connect_reference(connection);
8118 if (OutP->RetCode != KERN_SUCCESS) {
8119 MIG_RETURN_ERROR(OutP, OutP->RetCode);
8120 }
8121#if __MigKernelSpecificCode
8122
8123 if (IP_VALID((ipc_port_t)In0P->into_task.name))
8124 ipc_port_release_send((ipc_port_t)In0P->into_task.name);
8125#endif /* __MigKernelSpecificCode */
8126
8127 OutP->NDR = NDR_record;
8128
8129
8130 OutP->address = In0P->address;
8131
8132 OutP->size = In0P->size;
8133
8134 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
8135 __AfterRcvRpc(2863, "io_connect_map_memory_into_task")
8136}
8137
8138#if ( __MigTypeCheck )
8139#if __MIG_check__Request__iokit_subsystem__
8140#if !defined(__MIG_check__Request__io_connect_unmap_memory_from_task_t__defined)
8141#define __MIG_check__Request__io_connect_unmap_memory_from_task_t__defined
8142
8143mig_internal kern_return_t __MIG_check__Request__io_connect_unmap_memory_from_task_t(__attribute__((__unused__)) __Request__io_connect_unmap_memory_from_task_t *In0P)
8144{
8145
8146 typedef __Request__io_connect_unmap_memory_from_task_t __Request;
8147#if __MigTypeCheck
8148 if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
8149 (In0P->msgh_body.msgh_descriptor_count != 1) ||
8150 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
8151 return MIG_BAD_ARGUMENTS;
8152#endif /* __MigTypeCheck */
8153
8154#if __MigTypeCheck
8155 if (In0P->from_task.type != MACH_MSG_PORT_DESCRIPTOR ||
8156 In0P->from_task.disposition != 17)
8157 return MIG_TYPE_ERROR;
8158#endif /* __MigTypeCheck */
8159
8160 return MACH_MSG_SUCCESS;
8161}
8162#endif /* !defined(__MIG_check__Request__io_connect_unmap_memory_from_task_t__defined) */
8163#endif /* __MIG_check__Request__iokit_subsystem__ */
8164#endif /* ( __MigTypeCheck ) */
8165
8166
8167/* Routine io_connect_unmap_memory_from_task */
8168mig_internal novalue _Xio_connect_unmap_memory_from_task
8169 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
8170{
8171
8172#ifdef __MigPackStructs
8173#pragma pack(4)
8174#endif
8175 typedef struct {
8176 mach_msg_header_t Head;
8177 /* start of the kernel processed data */
8178 mach_msg_body_t msgh_body;
8179 mach_msg_port_descriptor_t from_task;
8180 /* end of the kernel processed data */
8181 NDR_record_t NDR;
8182 uint32_t memory_type;
8183 mach_vm_address_t address;
8184 mach_msg_trailer_t trailer;
8185 } Request __attribute__((unused));
8186#ifdef __MigPackStructs
8187#pragma pack()
8188#endif
8189 typedef __Request__io_connect_unmap_memory_from_task_t __Request;
8190 typedef __Reply__io_connect_unmap_memory_from_task_t Reply __attribute__((unused));
8191
8192 /*
8193 * typedef struct {
8194 * mach_msg_header_t Head;
8195 * NDR_record_t NDR;
8196 * kern_return_t RetCode;
8197 * } mig_reply_error_t;
8198 */
8199
8200 Request *In0P = (Request *) InHeadP;
8201 Reply *OutP = (Reply *) OutHeadP;
8202#ifdef __MIG_check__Request__io_connect_unmap_memory_from_task_t__defined
8203 kern_return_t check_result;
8204#endif /* __MIG_check__Request__io_connect_unmap_memory_from_task_t__defined */
8205
8206#if __MigKernelSpecificCode
8207#else
8208#endif /* __MigKernelSpecificCode */
8209 io_connect_t connection;
8210 task_t from_task;
8211
8212 __DeclareRcvRpc(2864, "io_connect_unmap_memory_from_task")
8213 __BeforeRcvRpc(2864, "io_connect_unmap_memory_from_task")
8214
8215#if defined(__MIG_check__Request__io_connect_unmap_memory_from_task_t__defined)
8216 check_result = __MIG_check__Request__io_connect_unmap_memory_from_task_t((__Request *)In0P);
8217 if (check_result != MACH_MSG_SUCCESS)
8218 { MIG_RETURN_ERROR(OutP, check_result); }
8219#endif /* defined(__MIG_check__Request__io_connect_unmap_memory_from_task_t__defined) */
8220
8221 connection = iokit_lookup_connect_port(In0P->Head.msgh_request_port);
8222
8223 from_task = convert_port_to_task(In0P->from_task.name);
8224
8225 OutP->RetCode = is_io_connect_unmap_memory_from_task(connection, In0P->memory_type, from_task, In0P->address);
8226 task_deallocate(from_task);
8227 iokit_remove_connect_reference(connection);
8228#if __MigKernelSpecificCode
8229 if (OutP->RetCode != KERN_SUCCESS) {
8230 MIG_RETURN_ERROR(OutP, OutP->RetCode);
8231 }
8232
8233 if (IP_VALID((ipc_port_t)In0P->from_task.name))
8234 ipc_port_release_send((ipc_port_t)In0P->from_task.name);
8235#endif /* __MigKernelSpecificCode */
8236
8237 OutP->NDR = NDR_record;
8238
8239
8240 __AfterRcvRpc(2864, "io_connect_unmap_memory_from_task")
8241}
8242
8243#if ( __MigTypeCheck )
8244#if __MIG_check__Request__iokit_subsystem__
8245#if !defined(__MIG_check__Request__io_connect_method_t__defined)
8246#define __MIG_check__Request__io_connect_method_t__defined
8247
8248mig_internal kern_return_t __MIG_check__Request__io_connect_method_t(__attribute__((__unused__)) __Request__io_connect_method_t *In0P, __attribute__((__unused__)) __Request__io_connect_method_t **In1PP, __attribute__((__unused__)) __Request__io_connect_method_t **In2PP)
8249{
8250
8251 typedef __Request__io_connect_method_t __Request;
8252 __Request *In1P;
8253 __Request *In2P;
8254#if __MigTypeCheck
8255 unsigned int msgh_size;
8256#endif /* __MigTypeCheck */
8257 unsigned int msgh_size_delta;
8258
8259#if __MigTypeCheck
8260 msgh_size = In0P->Head.msgh_size;
8261 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
8262 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 4224)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
8263 return MIG_BAD_ARGUMENTS;
8264#endif /* __MigTypeCheck */
8265
8266#if defined(__NDR_convert__int_rep__Request__io_connect_method_t__scalar_inputCnt__defined)
8267 if (In0P->NDR.int_rep != NDR_record.int_rep)
8268 __NDR_convert__int_rep__Request__io_connect_method_t__scalar_inputCnt(&In0P->scalar_inputCnt, In0P->NDR.int_rep);
8269#endif /* __NDR_convert__int_rep__Request__io_connect_method_t__scalar_inputCnt__defined */
8270 msgh_size_delta = (8 * In0P->scalar_inputCnt);
8271#if __MigTypeCheck
8272 if ( In0P->scalar_inputCnt > 16 )
8273 return MIG_BAD_ARGUMENTS;
8274 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 4224)) / 8 < In0P->scalar_inputCnt) ||
8275 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 4224) + (8 * In0P->scalar_inputCnt)))
8276 return MIG_BAD_ARGUMENTS;
8277 msgh_size -= msgh_size_delta;
8278#endif /* __MigTypeCheck */
8279
8280 *In1PP = In1P = (__Request *) ((pointer_t) In0P + msgh_size_delta - 128);
8281
8282#if defined(__NDR_convert__int_rep__Request__io_connect_method_t__inband_inputCnt__defined)
8283 if (In0P->NDR.int_rep != NDR_record.int_rep)
8284 __NDR_convert__int_rep__Request__io_connect_method_t__inband_inputCnt(&In1P->inband_inputCnt, In1P->NDR.int_rep);
8285#endif /* __NDR_convert__int_rep__Request__io_connect_method_t__inband_inputCnt__defined */
8286 msgh_size_delta = _WALIGN_(In1P->inband_inputCnt);
8287#if __MigTypeCheck
8288 if ( In1P->inband_inputCnt > 4096 )
8289 return MIG_BAD_ARGUMENTS;
8290 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 4224)) < In1P->inband_inputCnt) ||
8291 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 4224) + _WALIGN_(In1P->inband_inputCnt)))
8292 return MIG_BAD_ARGUMENTS;
8293#endif /* __MigTypeCheck */
8294
8295 *In2PP = In2P = (__Request *) ((pointer_t) In1P + msgh_size_delta - 4096);
8296
8297 return MACH_MSG_SUCCESS;
8298}
8299#endif /* !defined(__MIG_check__Request__io_connect_method_t__defined) */
8300#endif /* __MIG_check__Request__iokit_subsystem__ */
8301#endif /* ( __MigTypeCheck ) */
8302
8303
8304/* Routine io_connect_method */
8305mig_internal novalue _Xio_connect_method
8306 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
8307{
8308
8309#ifdef __MigPackStructs
8310#pragma pack(4)
8311#endif
8312 typedef struct {
8313 mach_msg_header_t Head;
8314 NDR_record_t NDR;
8315 uint32_t selector;
8316 mach_msg_type_number_t scalar_inputCnt;
8317 io_user_scalar_t scalar_input[16];
8318 mach_msg_type_number_t inband_inputCnt;
8319 char inband_input[4096];
8320 mach_vm_address_t ool_input;
8321 mach_vm_size_t ool_input_size;
8322 mach_msg_type_number_t inband_outputCnt;
8323 mach_msg_type_number_t scalar_outputCnt;
8324 mach_vm_address_t ool_output;
8325 mach_vm_size_t ool_output_size;
8326 mach_msg_trailer_t trailer;
8327 } Request __attribute__((unused));
8328#ifdef __MigPackStructs
8329#pragma pack()
8330#endif
8331 typedef __Request__io_connect_method_t __Request;
8332 typedef __Reply__io_connect_method_t Reply __attribute__((unused));
8333
8334 /*
8335 * typedef struct {
8336 * mach_msg_header_t Head;
8337 * NDR_record_t NDR;
8338 * kern_return_t RetCode;
8339 * } mig_reply_error_t;
8340 */
8341
8342 Request *In0P = (Request *) InHeadP;
8343 Request *In1P;
8344 Request *In2P;
8345 Reply *OutP = (Reply *) OutHeadP;
8346 unsigned int msgh_size;
8347 unsigned int msgh_size_delta;
8348
8349#ifdef __MIG_check__Request__io_connect_method_t__defined
8350 kern_return_t check_result;
8351#endif /* __MIG_check__Request__io_connect_method_t__defined */
8352
8353#if __MigKernelSpecificCode
8354#else
8355#endif /* __MigKernelSpecificCode */
8356 io_connect_t connection;
8357 io_user_scalar_t scalar_output[16];
8358 mach_msg_type_number_t scalar_outputCnt;
8359
8360 __DeclareRcvRpc(2865, "io_connect_method")
8361 __BeforeRcvRpc(2865, "io_connect_method")
8362
8363#if defined(__MIG_check__Request__io_connect_method_t__defined)
8364 check_result = __MIG_check__Request__io_connect_method_t((__Request *)In0P, (__Request **)&In1P, (__Request **)&In2P);
8365 if (check_result != MACH_MSG_SUCCESS)
8366 { MIG_RETURN_ERROR(OutP, check_result); }
8367#endif /* defined(__MIG_check__Request__io_connect_method_t__defined) */
8368
8369 connection = iokit_lookup_connect_port(In0P->Head.msgh_request_port);
8370
8371 OutP->inband_outputCnt = 4096;
8372 if (In2P->inband_outputCnt < OutP->inband_outputCnt)
8373 OutP->inband_outputCnt = In2P->inband_outputCnt;
8374
8375 scalar_outputCnt = 16;
8376 if (In2P->scalar_outputCnt < scalar_outputCnt)
8377 scalar_outputCnt = In2P->scalar_outputCnt;
8378
8379 OutP->RetCode = is_io_connect_method(connection, In0P->selector, In0P->scalar_input, In0P->scalar_inputCnt, In1P->inband_input, In1P->inband_inputCnt, In2P->ool_input, In2P->ool_input_size, OutP->inband_output, &OutP->inband_outputCnt, scalar_output, &scalar_outputCnt, In2P->ool_output, &In2P->ool_output_size);
8380 iokit_remove_connect_reference(connection);
8381 if (OutP->RetCode != KERN_SUCCESS) {
8382 MIG_RETURN_ERROR(OutP, OutP->RetCode);
8383 }
8384#if __MigKernelSpecificCode
8385#endif /* __MigKernelSpecificCode */
8386
8387 OutP->NDR = NDR_record;
8388
8389 msgh_size_delta = _WALIGN_((OutP->inband_outputCnt + 3) & ~3);
8390 msgh_size = (mach_msg_size_t)(sizeof(Reply) - 4224) + msgh_size_delta;
8391 OutP = (Reply *) ((pointer_t) OutP + msgh_size_delta - 4096);
8392 (void)memcpy((char *) OutP->scalar_output, (const char *) scalar_output, 8 * scalar_outputCnt);
8393 OutP->scalar_outputCnt = scalar_outputCnt;
8394 msgh_size_delta = ((8 * scalar_outputCnt));
8395 msgh_size += msgh_size_delta;
8396 OutP = (Reply *) ((pointer_t) OutP + msgh_size_delta - 128);
8397
8398 OutP->ool_output_size = In2P->ool_output_size;
8399
8400 OutP = (Reply *) OutHeadP;
8401 OutP->Head.msgh_size = msgh_size;
8402 __AfterRcvRpc(2865, "io_connect_method")
8403}
8404
8405#if ( __MigTypeCheck )
8406#if __MIG_check__Request__iokit_subsystem__
8407#if !defined(__MIG_check__Request__io_connect_async_method_t__defined)
8408#define __MIG_check__Request__io_connect_async_method_t__defined
8409
8410mig_internal kern_return_t __MIG_check__Request__io_connect_async_method_t(__attribute__((__unused__)) __Request__io_connect_async_method_t *In0P, __attribute__((__unused__)) __Request__io_connect_async_method_t **In1PP, __attribute__((__unused__)) __Request__io_connect_async_method_t **In2PP, __attribute__((__unused__)) __Request__io_connect_async_method_t **In3PP)
8411{
8412
8413 typedef __Request__io_connect_async_method_t __Request;
8414 __Request *In1P;
8415 __Request *In2P;
8416 __Request *In3P;
8417#if __MigTypeCheck
8418 unsigned int msgh_size;
8419#endif /* __MigTypeCheck */
8420 unsigned int msgh_size_delta;
8421
8422#if __MigTypeCheck
8423 msgh_size = In0P->Head.msgh_size;
8424 if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
8425 (In0P->msgh_body.msgh_descriptor_count != 1) ||
8426 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 4288)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
8427 return MIG_BAD_ARGUMENTS;
8428#endif /* __MigTypeCheck */
8429
8430#if __MigTypeCheck
8431 if (In0P->wake_port.type != MACH_MSG_PORT_DESCRIPTOR ||
8432 In0P->wake_port.disposition != 17)
8433 return MIG_TYPE_ERROR;
8434#endif /* __MigTypeCheck */
8435
8436#if defined(__NDR_convert__int_rep__Request__io_connect_async_method_t__referenceCnt__defined)
8437 if (In0P->NDR.int_rep != NDR_record.int_rep)
8438 __NDR_convert__int_rep__Request__io_connect_async_method_t__referenceCnt(&In0P->referenceCnt, In0P->NDR.int_rep);
8439#endif /* __NDR_convert__int_rep__Request__io_connect_async_method_t__referenceCnt__defined */
8440 msgh_size_delta = (8 * In0P->referenceCnt);
8441#if __MigTypeCheck
8442 if ( In0P->referenceCnt > 8 )
8443 return MIG_BAD_ARGUMENTS;
8444 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 4288)) / 8 < In0P->referenceCnt) ||
8445 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 4288) + (8 * In0P->referenceCnt)))
8446 return MIG_BAD_ARGUMENTS;
8447 msgh_size -= msgh_size_delta;
8448#endif /* __MigTypeCheck */
8449
8450 *In1PP = In1P = (__Request *) ((pointer_t) In0P + msgh_size_delta - 64);
8451
8452#if defined(__NDR_convert__int_rep__Request__io_connect_async_method_t__scalar_inputCnt__defined)
8453 if (In0P->NDR.int_rep != NDR_record.int_rep)
8454 __NDR_convert__int_rep__Request__io_connect_async_method_t__scalar_inputCnt(&In1P->scalar_inputCnt, In1P->NDR.int_rep);
8455#endif /* __NDR_convert__int_rep__Request__io_connect_async_method_t__scalar_inputCnt__defined */
8456 msgh_size_delta = (8 * In1P->scalar_inputCnt);
8457#if __MigTypeCheck
8458 if ( In1P->scalar_inputCnt > 16 )
8459 return MIG_BAD_ARGUMENTS;
8460 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 4288)) / 8 < In1P->scalar_inputCnt) ||
8461 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 4288) + (8 * In1P->scalar_inputCnt)))
8462 return MIG_BAD_ARGUMENTS;
8463 msgh_size -= msgh_size_delta;
8464#endif /* __MigTypeCheck */
8465
8466 *In2PP = In2P = (__Request *) ((pointer_t) In1P + msgh_size_delta - 128);
8467
8468#if defined(__NDR_convert__int_rep__Request__io_connect_async_method_t__inband_inputCnt__defined)
8469 if (In0P->NDR.int_rep != NDR_record.int_rep)
8470 __NDR_convert__int_rep__Request__io_connect_async_method_t__inband_inputCnt(&In2P->inband_inputCnt, In2P->NDR.int_rep);
8471#endif /* __NDR_convert__int_rep__Request__io_connect_async_method_t__inband_inputCnt__defined */
8472 msgh_size_delta = _WALIGN_(In2P->inband_inputCnt);
8473#if __MigTypeCheck
8474 if ( In2P->inband_inputCnt > 4096 )
8475 return MIG_BAD_ARGUMENTS;
8476 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 4288)) < In2P->inband_inputCnt) ||
8477 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 4288) + _WALIGN_(In2P->inband_inputCnt)))
8478 return MIG_BAD_ARGUMENTS;
8479#endif /* __MigTypeCheck */
8480
8481 *In3PP = In3P = (__Request *) ((pointer_t) In2P + msgh_size_delta - 4096);
8482
8483 return MACH_MSG_SUCCESS;
8484}
8485#endif /* !defined(__MIG_check__Request__io_connect_async_method_t__defined) */
8486#endif /* __MIG_check__Request__iokit_subsystem__ */
8487#endif /* ( __MigTypeCheck ) */
8488
8489
8490/* Routine io_connect_async_method */
8491mig_internal novalue _Xio_connect_async_method
8492 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
8493{
8494
8495#ifdef __MigPackStructs
8496#pragma pack(4)
8497#endif
8498 typedef struct {
8499 mach_msg_header_t Head;
8500 /* start of the kernel processed data */
8501 mach_msg_body_t msgh_body;
8502 mach_msg_port_descriptor_t wake_port;
8503 /* end of the kernel processed data */
8504 NDR_record_t NDR;
8505 mach_msg_type_number_t referenceCnt;
8506 io_user_reference_t reference[8];
8507 uint32_t selector;
8508 mach_msg_type_number_t scalar_inputCnt;
8509 io_user_scalar_t scalar_input[16];
8510 mach_msg_type_number_t inband_inputCnt;
8511 char inband_input[4096];
8512 mach_vm_address_t ool_input;
8513 mach_vm_size_t ool_input_size;
8514 mach_msg_type_number_t inband_outputCnt;
8515 mach_msg_type_number_t scalar_outputCnt;
8516 mach_vm_address_t ool_output;
8517 mach_vm_size_t ool_output_size;
8518 mach_msg_trailer_t trailer;
8519 } Request __attribute__((unused));
8520#ifdef __MigPackStructs
8521#pragma pack()
8522#endif
8523 typedef __Request__io_connect_async_method_t __Request;
8524 typedef __Reply__io_connect_async_method_t Reply __attribute__((unused));
8525
8526 /*
8527 * typedef struct {
8528 * mach_msg_header_t Head;
8529 * NDR_record_t NDR;
8530 * kern_return_t RetCode;
8531 * } mig_reply_error_t;
8532 */
8533
8534 Request *In0P = (Request *) InHeadP;
8535 Request *In1P;
8536 Request *In2P;
8537 Request *In3P;
8538 Reply *OutP = (Reply *) OutHeadP;
8539 unsigned int msgh_size;
8540 unsigned int msgh_size_delta;
8541
8542#ifdef __MIG_check__Request__io_connect_async_method_t__defined
8543 kern_return_t check_result;
8544#endif /* __MIG_check__Request__io_connect_async_method_t__defined */
8545
8546#if __MigKernelSpecificCode
8547#else
8548#endif /* __MigKernelSpecificCode */
8549 io_connect_t connection;
8550 io_user_scalar_t scalar_output[16];
8551 mach_msg_type_number_t scalar_outputCnt;
8552
8553 __DeclareRcvRpc(2866, "io_connect_async_method")
8554 __BeforeRcvRpc(2866, "io_connect_async_method")
8555
8556#if defined(__MIG_check__Request__io_connect_async_method_t__defined)
8557 check_result = __MIG_check__Request__io_connect_async_method_t((__Request *)In0P, (__Request **)&In1P, (__Request **)&In2P, (__Request **)&In3P);
8558 if (check_result != MACH_MSG_SUCCESS)
8559 { MIG_RETURN_ERROR(OutP, check_result); }
8560#endif /* defined(__MIG_check__Request__io_connect_async_method_t__defined) */
8561
8562 connection = iokit_lookup_connect_port(In0P->Head.msgh_request_port);
8563
8564 OutP->inband_outputCnt = 4096;
8565 if (In3P->inband_outputCnt < OutP->inband_outputCnt)
8566 OutP->inband_outputCnt = In3P->inband_outputCnt;
8567
8568 scalar_outputCnt = 16;
8569 if (In3P->scalar_outputCnt < scalar_outputCnt)
8570 scalar_outputCnt = In3P->scalar_outputCnt;
8571
8572 OutP->RetCode = is_io_connect_async_method(connection, In0P->wake_port.name, In0P->reference, In0P->referenceCnt, In1P->selector, In1P->scalar_input, In1P->scalar_inputCnt, In2P->inband_input, In2P->inband_inputCnt, In3P->ool_input, In3P->ool_input_size, OutP->inband_output, &OutP->inband_outputCnt, scalar_output, &scalar_outputCnt, In3P->ool_output, &In3P->ool_output_size);
8573 iokit_remove_connect_reference(connection);
8574 if (OutP->RetCode != KERN_SUCCESS) {
8575 MIG_RETURN_ERROR(OutP, OutP->RetCode);
8576 }
8577#if __MigKernelSpecificCode
8578#endif /* __MigKernelSpecificCode */
8579
8580 OutP->NDR = NDR_record;
8581
8582 msgh_size_delta = _WALIGN_((OutP->inband_outputCnt + 3) & ~3);
8583 msgh_size = (mach_msg_size_t)(sizeof(Reply) - 4224) + msgh_size_delta;
8584 OutP = (Reply *) ((pointer_t) OutP + msgh_size_delta - 4096);
8585 (void)memcpy((char *) OutP->scalar_output, (const char *) scalar_output, 8 * scalar_outputCnt);
8586 OutP->scalar_outputCnt = scalar_outputCnt;
8587 msgh_size_delta = ((8 * scalar_outputCnt));
8588 msgh_size += msgh_size_delta;
8589 OutP = (Reply *) ((pointer_t) OutP + msgh_size_delta - 128);
8590
8591 OutP->ool_output_size = In3P->ool_output_size;
8592
8593 OutP = (Reply *) OutHeadP;
8594 OutP->Head.msgh_size = msgh_size;
8595 __AfterRcvRpc(2866, "io_connect_async_method")
8596}
8597
8598#if ( __MigTypeCheck )
8599#if __MIG_check__Request__iokit_subsystem__
8600#if !defined(__MIG_check__Request__io_connect_set_notification_port_64_t__defined)
8601#define __MIG_check__Request__io_connect_set_notification_port_64_t__defined
8602
8603mig_internal kern_return_t __MIG_check__Request__io_connect_set_notification_port_64_t(__attribute__((__unused__)) __Request__io_connect_set_notification_port_64_t *In0P)
8604{
8605
8606 typedef __Request__io_connect_set_notification_port_64_t __Request;
8607#if __MigTypeCheck
8608 if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
8609 (In0P->msgh_body.msgh_descriptor_count != 1) ||
8610 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
8611 return MIG_BAD_ARGUMENTS;
8612#endif /* __MigTypeCheck */
8613
8614#if __MigTypeCheck
8615 if (In0P->port.type != MACH_MSG_PORT_DESCRIPTOR ||
8616 In0P->port.disposition != 17)
8617 return MIG_TYPE_ERROR;
8618#endif /* __MigTypeCheck */
8619
8620 return MACH_MSG_SUCCESS;
8621}
8622#endif /* !defined(__MIG_check__Request__io_connect_set_notification_port_64_t__defined) */
8623#endif /* __MIG_check__Request__iokit_subsystem__ */
8624#endif /* ( __MigTypeCheck ) */
8625
8626
8627/* Routine io_connect_set_notification_port_64 */
8628mig_internal novalue _Xio_connect_set_notification_port_64
8629 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
8630{
8631
8632#ifdef __MigPackStructs
8633#pragma pack(4)
8634#endif
8635 typedef struct {
8636 mach_msg_header_t Head;
8637 /* start of the kernel processed data */
8638 mach_msg_body_t msgh_body;
8639 mach_msg_port_descriptor_t port;
8640 /* end of the kernel processed data */
8641 NDR_record_t NDR;
8642 uint32_t notification_type;
8643 io_user_reference_t reference;
8644 mach_msg_trailer_t trailer;
8645 } Request __attribute__((unused));
8646#ifdef __MigPackStructs
8647#pragma pack()
8648#endif
8649 typedef __Request__io_connect_set_notification_port_64_t __Request;
8650 typedef __Reply__io_connect_set_notification_port_64_t Reply __attribute__((unused));
8651
8652 /*
8653 * typedef struct {
8654 * mach_msg_header_t Head;
8655 * NDR_record_t NDR;
8656 * kern_return_t RetCode;
8657 * } mig_reply_error_t;
8658 */
8659
8660 Request *In0P = (Request *) InHeadP;
8661 Reply *OutP = (Reply *) OutHeadP;
8662#ifdef __MIG_check__Request__io_connect_set_notification_port_64_t__defined
8663 kern_return_t check_result;
8664#endif /* __MIG_check__Request__io_connect_set_notification_port_64_t__defined */
8665
8666#if __MigKernelSpecificCode
8667#else
8668#endif /* __MigKernelSpecificCode */
8669 io_connect_t connection;
8670
8671 __DeclareRcvRpc(2867, "io_connect_set_notification_port_64")
8672 __BeforeRcvRpc(2867, "io_connect_set_notification_port_64")
8673
8674#if defined(__MIG_check__Request__io_connect_set_notification_port_64_t__defined)
8675 check_result = __MIG_check__Request__io_connect_set_notification_port_64_t((__Request *)In0P);
8676 if (check_result != MACH_MSG_SUCCESS)
8677 { MIG_RETURN_ERROR(OutP, check_result); }
8678#endif /* defined(__MIG_check__Request__io_connect_set_notification_port_64_t__defined) */
8679
8680 connection = iokit_lookup_connect_port(In0P->Head.msgh_request_port);
8681
8682 OutP->RetCode = is_io_connect_set_notification_port_64(connection, In0P->notification_type, In0P->port.name, In0P->reference);
8683 iokit_remove_connect_reference(connection);
8684#if __MigKernelSpecificCode
8685#endif /* __MigKernelSpecificCode */
8686
8687 OutP->NDR = NDR_record;
8688
8689
8690 __AfterRcvRpc(2867, "io_connect_set_notification_port_64")
8691}
8692
8693#if ( __MigTypeCheck )
8694#if __MIG_check__Request__iokit_subsystem__
8695#if !defined(__MIG_check__Request__io_service_add_notification_64_t__defined)
8696#define __MIG_check__Request__io_service_add_notification_64_t__defined
8697
8698mig_internal kern_return_t __MIG_check__Request__io_service_add_notification_64_t(__attribute__((__unused__)) __Request__io_service_add_notification_64_t *In0P, __attribute__((__unused__)) __Request__io_service_add_notification_64_t **In1PP, __attribute__((__unused__)) __Request__io_service_add_notification_64_t **In2PP)
8699{
8700
8701 typedef __Request__io_service_add_notification_64_t __Request;
8702 __Request *In1P;
8703 __Request *In2P;
8704#if __MigTypeCheck
8705 unsigned int msgh_size;
8706#endif /* __MigTypeCheck */
8707 unsigned int msgh_size_delta;
8708
8709#if __MigTypeCheck
8710 msgh_size = In0P->Head.msgh_size;
8711 if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
8712 (In0P->msgh_body.msgh_descriptor_count != 1) ||
8713 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 704)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
8714 return MIG_BAD_ARGUMENTS;
8715#endif /* __MigTypeCheck */
8716
8717#if __MigTypeCheck
8718 if (In0P->wake_port.type != MACH_MSG_PORT_DESCRIPTOR ||
8719 In0P->wake_port.disposition != 17)
8720 return MIG_TYPE_ERROR;
8721#endif /* __MigTypeCheck */
8722
8723#if defined(__NDR_convert__int_rep__Request__io_service_add_notification_64_t__notification_typeCnt__defined)
8724 if (In0P->NDR.int_rep != NDR_record.int_rep)
8725 __NDR_convert__int_rep__Request__io_service_add_notification_64_t__notification_typeCnt(&In0P->notification_typeCnt, In0P->NDR.int_rep);
8726#endif /* __NDR_convert__int_rep__Request__io_service_add_notification_64_t__notification_typeCnt__defined */
8727 msgh_size_delta = _WALIGN_(In0P->notification_typeCnt);
8728#if __MigTypeCheck
8729 if ( In0P->notification_typeCnt > 128 )
8730 return MIG_BAD_ARGUMENTS;
8731 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 704)) < In0P->notification_typeCnt) ||
8732 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 704) + _WALIGN_(In0P->notification_typeCnt)))
8733 return MIG_BAD_ARGUMENTS;
8734 msgh_size -= msgh_size_delta;
8735#endif /* __MigTypeCheck */
8736
8737 *In1PP = In1P = (__Request *) ((pointer_t) In0P + msgh_size_delta - 128);
8738
8739#if defined(__NDR_convert__int_rep__Request__io_service_add_notification_64_t__matchingCnt__defined)
8740 if (In0P->NDR.int_rep != NDR_record.int_rep)
8741 __NDR_convert__int_rep__Request__io_service_add_notification_64_t__matchingCnt(&In1P->matchingCnt, In1P->NDR.int_rep);
8742#endif /* __NDR_convert__int_rep__Request__io_service_add_notification_64_t__matchingCnt__defined */
8743 msgh_size_delta = _WALIGN_(In1P->matchingCnt);
8744#if __MigTypeCheck
8745 if ( In1P->matchingCnt > 512 )
8746 return MIG_BAD_ARGUMENTS;
8747 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 704)) < In1P->matchingCnt) ||
8748 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 704) + _WALIGN_(In1P->matchingCnt)))
8749 return MIG_BAD_ARGUMENTS;
8750 msgh_size -= msgh_size_delta;
8751#endif /* __MigTypeCheck */
8752
8753 *In2PP = In2P = (__Request *) ((pointer_t) In1P + msgh_size_delta - 512);
8754
8755#if defined(__NDR_convert__int_rep__Request__io_service_add_notification_64_t__referenceCnt__defined)
8756 if (In0P->NDR.int_rep != NDR_record.int_rep)
8757 __NDR_convert__int_rep__Request__io_service_add_notification_64_t__referenceCnt(&In2P->referenceCnt, In2P->NDR.int_rep);
8758#endif /* __NDR_convert__int_rep__Request__io_service_add_notification_64_t__referenceCnt__defined */
8759#if __MigTypeCheck
8760 if ( In2P->referenceCnt > 8 )
8761 return MIG_BAD_ARGUMENTS;
8762 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 704)) / 8 < In2P->referenceCnt) ||
8763 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 704) + (8 * In2P->referenceCnt)))
8764 return MIG_BAD_ARGUMENTS;
8765#endif /* __MigTypeCheck */
8766
8767#if __MigTypeCheck
8768 {
8769 char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
8770#if __MigKernelSpecificCode
8771 size_t strnlen_limit;
8772#else
8773 size_t memchr_limit;
8774#endif /* __MigKernelSpecificCode */
8775
8776#if __MigKernelSpecificCode
8777 strnlen_limit = min((msg_limit - In0P->notification_type), 128);
8778 if (( strnlen(In0P->notification_type, strnlen_limit) >= 128 + 1 ))
8779 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
8780#else
8781 memchr_limit = min((msg_limit - In0P->notification_type), 128);
8782 if (( memchr(In0P->notification_type, '\0', memchr_limit) == NULL ))
8783 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
8784#endif /* __MigKernelSpecificCode */
8785#if __MigKernelSpecificCode
8786 strnlen_limit = min((msg_limit - In1P->matching), 512);
8787 if (( strnlen(In1P->matching, strnlen_limit) >= 512 + 1 ))
8788 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
8789#else
8790 memchr_limit = min((msg_limit - In1P->matching), 512);
8791 if (( memchr(In1P->matching, '\0', memchr_limit) == NULL ))
8792 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
8793#endif /* __MigKernelSpecificCode */
8794 }
8795#endif /* __MigTypeCheck */
8796
8797 return MACH_MSG_SUCCESS;
8798}
8799#endif /* !defined(__MIG_check__Request__io_service_add_notification_64_t__defined) */
8800#endif /* __MIG_check__Request__iokit_subsystem__ */
8801#endif /* ( __MigTypeCheck ) */
8802
8803
8804/* Routine io_service_add_notification_64 */
8805mig_internal novalue _Xio_service_add_notification_64
8806 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
8807{
8808
8809#ifdef __MigPackStructs
8810#pragma pack(4)
8811#endif
8812 typedef struct {
8813 mach_msg_header_t Head;
8814 /* start of the kernel processed data */
8815 mach_msg_body_t msgh_body;
8816 mach_msg_port_descriptor_t wake_port;
8817 /* end of the kernel processed data */
8818 NDR_record_t NDR;
8819 mach_msg_type_number_t notification_typeOffset; /* MiG doesn't use it */
8820 mach_msg_type_number_t notification_typeCnt;
8821 char notification_type[128];
8822 mach_msg_type_number_t matchingOffset; /* MiG doesn't use it */
8823 mach_msg_type_number_t matchingCnt;
8824 char matching[512];
8825 mach_msg_type_number_t referenceCnt;
8826 io_user_reference_t reference[8];
8827 mach_msg_trailer_t trailer;
8828 } Request __attribute__((unused));
8829#ifdef __MigPackStructs
8830#pragma pack()
8831#endif
8832 typedef __Request__io_service_add_notification_64_t __Request;
8833 typedef __Reply__io_service_add_notification_64_t Reply __attribute__((unused));
8834
8835 /*
8836 * typedef struct {
8837 * mach_msg_header_t Head;
8838 * NDR_record_t NDR;
8839 * kern_return_t RetCode;
8840 * } mig_reply_error_t;
8841 */
8842
8843 Request *In0P = (Request *) InHeadP;
8844 Request *In1P;
8845 Request *In2P;
8846 Reply *OutP = (Reply *) OutHeadP;
8847#ifdef __MIG_check__Request__io_service_add_notification_64_t__defined
8848 kern_return_t check_result;
8849#endif /* __MIG_check__Request__io_service_add_notification_64_t__defined */
8850
8851#if __MigKernelSpecificCode
8852#if UseStaticTemplates
8853 const static mach_msg_port_descriptor_t notificationTemplate = {
8854 /* name = */ MACH_PORT_NULL,
8855 /* pad1 = */ 0,
8856 /* pad2 = */ 0,
8857 /* disp = */ 17,
8858 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
8859 };
8860#endif /* UseStaticTemplates */
8861
8862#else
8863#if UseStaticTemplates
8864 const static mach_msg_port_descriptor_t notificationTemplate = {
8865 /* name = */ MACH_PORT_NULL,
8866 /* pad1 = */ 0,
8867 /* pad2 = */ 0,
8868 /* disp = */ 19,
8869 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
8870 };
8871#endif /* UseStaticTemplates */
8872
8873#endif /* __MigKernelSpecificCode */
8874 kern_return_t RetCode;
8875 io_object_t notification;
8876
8877 __DeclareRcvRpc(2868, "io_service_add_notification_64")
8878 __BeforeRcvRpc(2868, "io_service_add_notification_64")
8879
8880#if defined(__MIG_check__Request__io_service_add_notification_64_t__defined)
8881 check_result = __MIG_check__Request__io_service_add_notification_64_t((__Request *)In0P, (__Request **)&In1P, (__Request **)&In2P);
8882 if (check_result != MACH_MSG_SUCCESS)
8883 { MIG_RETURN_ERROR(OutP, check_result); }
8884#endif /* defined(__MIG_check__Request__io_service_add_notification_64_t__defined) */
8885
8886#if UseStaticTemplates
8887 OutP->notification = notificationTemplate;
8888#else /* UseStaticTemplates */
8889#if __MigKernelSpecificCode
8890 OutP->notification.disposition = 17;
8891#else
8892 OutP->notification.disposition = 19;
8893#endif /* __MigKernelSpecificCode */
8894#if !(defined(KERNEL) && defined(__LP64__))
8895 OutP->notification.pad1 = 0;
8896#endif
8897 OutP->notification.pad2 = 0;
8898 OutP->notification.type = MACH_MSG_PORT_DESCRIPTOR;
8899#if defined(KERNEL)
8900 OutP->notification.pad_end = 0;
8901#endif
8902#endif /* UseStaticTemplates */
8903
8904
8905 RetCode = is_io_service_add_notification_64(In0P->Head.msgh_request_port, In0P->notification_type, In1P->matching, In0P->wake_port.name, In2P->reference, In2P->referenceCnt, &notification);
8906 if (RetCode != KERN_SUCCESS) {
8907 MIG_RETURN_ERROR(OutP, RetCode);
8908 }
8909#if __MigKernelSpecificCode
8910#endif /* __MigKernelSpecificCode */
8911 OutP->notification.name = (mach_port_t)iokit_make_object_port(notification);
8912
8913
8914 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
8915 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
8916 OutP->msgh_body.msgh_descriptor_count = 1;
8917 __AfterRcvRpc(2868, "io_service_add_notification_64")
8918}
8919
8920#if ( __MigTypeCheck )
8921#if __MIG_check__Request__iokit_subsystem__
8922#if !defined(__MIG_check__Request__io_service_add_interest_notification_64_t__defined)
8923#define __MIG_check__Request__io_service_add_interest_notification_64_t__defined
8924
8925mig_internal kern_return_t __MIG_check__Request__io_service_add_interest_notification_64_t(__attribute__((__unused__)) __Request__io_service_add_interest_notification_64_t *In0P, __attribute__((__unused__)) __Request__io_service_add_interest_notification_64_t **In1PP)
8926{
8927
8928 typedef __Request__io_service_add_interest_notification_64_t __Request;
8929 __Request *In1P;
8930#if __MigTypeCheck
8931 unsigned int msgh_size;
8932#endif /* __MigTypeCheck */
8933 unsigned int msgh_size_delta;
8934
8935#if __MigTypeCheck
8936 msgh_size = In0P->Head.msgh_size;
8937 if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
8938 (In0P->msgh_body.msgh_descriptor_count != 1) ||
8939 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 192)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
8940 return MIG_BAD_ARGUMENTS;
8941#endif /* __MigTypeCheck */
8942
8943#if __MigTypeCheck
8944 if (In0P->wake_port.type != MACH_MSG_PORT_DESCRIPTOR ||
8945 In0P->wake_port.disposition != 17)
8946 return MIG_TYPE_ERROR;
8947#endif /* __MigTypeCheck */
8948
8949#if defined(__NDR_convert__int_rep__Request__io_service_add_interest_notification_64_t__type_of_interestCnt__defined)
8950 if (In0P->NDR.int_rep != NDR_record.int_rep)
8951 __NDR_convert__int_rep__Request__io_service_add_interest_notification_64_t__type_of_interestCnt(&In0P->type_of_interestCnt, In0P->NDR.int_rep);
8952#endif /* __NDR_convert__int_rep__Request__io_service_add_interest_notification_64_t__type_of_interestCnt__defined */
8953 msgh_size_delta = _WALIGN_(In0P->type_of_interestCnt);
8954#if __MigTypeCheck
8955 if ( In0P->type_of_interestCnt > 128 )
8956 return MIG_BAD_ARGUMENTS;
8957 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 192)) < In0P->type_of_interestCnt) ||
8958 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 192) + _WALIGN_(In0P->type_of_interestCnt)))
8959 return MIG_BAD_ARGUMENTS;
8960 msgh_size -= msgh_size_delta;
8961#endif /* __MigTypeCheck */
8962
8963 *In1PP = In1P = (__Request *) ((pointer_t) In0P + msgh_size_delta - 128);
8964
8965#if defined(__NDR_convert__int_rep__Request__io_service_add_interest_notification_64_t__referenceCnt__defined)
8966 if (In0P->NDR.int_rep != NDR_record.int_rep)
8967 __NDR_convert__int_rep__Request__io_service_add_interest_notification_64_t__referenceCnt(&In1P->referenceCnt, In1P->NDR.int_rep);
8968#endif /* __NDR_convert__int_rep__Request__io_service_add_interest_notification_64_t__referenceCnt__defined */
8969#if __MigTypeCheck
8970 if ( In1P->referenceCnt > 8 )
8971 return MIG_BAD_ARGUMENTS;
8972 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 192)) / 8 < In1P->referenceCnt) ||
8973 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 192) + (8 * In1P->referenceCnt)))
8974 return MIG_BAD_ARGUMENTS;
8975#endif /* __MigTypeCheck */
8976
8977#if __MigTypeCheck
8978 {
8979 char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
8980#if __MigKernelSpecificCode
8981 size_t strnlen_limit;
8982#else
8983 size_t memchr_limit;
8984#endif /* __MigKernelSpecificCode */
8985
8986#if __MigKernelSpecificCode
8987 strnlen_limit = min((msg_limit - In0P->type_of_interest), 128);
8988 if (( strnlen(In0P->type_of_interest, strnlen_limit) >= 128 + 1 ))
8989 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
8990#else
8991 memchr_limit = min((msg_limit - In0P->type_of_interest), 128);
8992 if (( memchr(In0P->type_of_interest, '\0', memchr_limit) == NULL ))
8993 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
8994#endif /* __MigKernelSpecificCode */
8995 }
8996#endif /* __MigTypeCheck */
8997
8998 return MACH_MSG_SUCCESS;
8999}
9000#endif /* !defined(__MIG_check__Request__io_service_add_interest_notification_64_t__defined) */
9001#endif /* __MIG_check__Request__iokit_subsystem__ */
9002#endif /* ( __MigTypeCheck ) */
9003
9004
9005/* Routine io_service_add_interest_notification_64 */
9006mig_internal novalue _Xio_service_add_interest_notification_64
9007 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
9008{
9009
9010#ifdef __MigPackStructs
9011#pragma pack(4)
9012#endif
9013 typedef struct {
9014 mach_msg_header_t Head;
9015 /* start of the kernel processed data */
9016 mach_msg_body_t msgh_body;
9017 mach_msg_port_descriptor_t wake_port;
9018 /* end of the kernel processed data */
9019 NDR_record_t NDR;
9020 mach_msg_type_number_t type_of_interestOffset; /* MiG doesn't use it */
9021 mach_msg_type_number_t type_of_interestCnt;
9022 char type_of_interest[128];
9023 mach_msg_type_number_t referenceCnt;
9024 io_user_reference_t reference[8];
9025 mach_msg_trailer_t trailer;
9026 } Request __attribute__((unused));
9027#ifdef __MigPackStructs
9028#pragma pack()
9029#endif
9030 typedef __Request__io_service_add_interest_notification_64_t __Request;
9031 typedef __Reply__io_service_add_interest_notification_64_t Reply __attribute__((unused));
9032
9033 /*
9034 * typedef struct {
9035 * mach_msg_header_t Head;
9036 * NDR_record_t NDR;
9037 * kern_return_t RetCode;
9038 * } mig_reply_error_t;
9039 */
9040
9041 Request *In0P = (Request *) InHeadP;
9042 Request *In1P;
9043 Reply *OutP = (Reply *) OutHeadP;
9044#ifdef __MIG_check__Request__io_service_add_interest_notification_64_t__defined
9045 kern_return_t check_result;
9046#endif /* __MIG_check__Request__io_service_add_interest_notification_64_t__defined */
9047
9048#if __MigKernelSpecificCode
9049#if UseStaticTemplates
9050 const static mach_msg_port_descriptor_t notificationTemplate = {
9051 /* name = */ MACH_PORT_NULL,
9052 /* pad1 = */ 0,
9053 /* pad2 = */ 0,
9054 /* disp = */ 17,
9055 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
9056 };
9057#endif /* UseStaticTemplates */
9058
9059#else
9060#if UseStaticTemplates
9061 const static mach_msg_port_descriptor_t notificationTemplate = {
9062 /* name = */ MACH_PORT_NULL,
9063 /* pad1 = */ 0,
9064 /* pad2 = */ 0,
9065 /* disp = */ 19,
9066 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
9067 };
9068#endif /* UseStaticTemplates */
9069
9070#endif /* __MigKernelSpecificCode */
9071 kern_return_t RetCode;
9072 io_object_t service;
9073 io_object_t notification;
9074
9075 __DeclareRcvRpc(2869, "io_service_add_interest_notification_64")
9076 __BeforeRcvRpc(2869, "io_service_add_interest_notification_64")
9077
9078#if defined(__MIG_check__Request__io_service_add_interest_notification_64_t__defined)
9079 check_result = __MIG_check__Request__io_service_add_interest_notification_64_t((__Request *)In0P, (__Request **)&In1P);
9080 if (check_result != MACH_MSG_SUCCESS)
9081 { MIG_RETURN_ERROR(OutP, check_result); }
9082#endif /* defined(__MIG_check__Request__io_service_add_interest_notification_64_t__defined) */
9083
9084#if UseStaticTemplates
9085 OutP->notification = notificationTemplate;
9086#else /* UseStaticTemplates */
9087#if __MigKernelSpecificCode
9088 OutP->notification.disposition = 17;
9089#else
9090 OutP->notification.disposition = 19;
9091#endif /* __MigKernelSpecificCode */
9092#if !(defined(KERNEL) && defined(__LP64__))
9093 OutP->notification.pad1 = 0;
9094#endif
9095 OutP->notification.pad2 = 0;
9096 OutP->notification.type = MACH_MSG_PORT_DESCRIPTOR;
9097#if defined(KERNEL)
9098 OutP->notification.pad_end = 0;
9099#endif
9100#endif /* UseStaticTemplates */
9101
9102
9103 service = iokit_lookup_object_port(In0P->Head.msgh_request_port);
9104
9105 RetCode = is_io_service_add_interest_notification_64(service, In0P->type_of_interest, In0P->wake_port.name, In1P->reference, In1P->referenceCnt, &notification);
9106 iokit_remove_reference(service);
9107 if (RetCode != KERN_SUCCESS) {
9108 MIG_RETURN_ERROR(OutP, RetCode);
9109 }
9110#if __MigKernelSpecificCode
9111#endif /* __MigKernelSpecificCode */
9112 OutP->notification.name = (mach_port_t)iokit_make_object_port(notification);
9113
9114
9115 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
9116 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
9117 OutP->msgh_body.msgh_descriptor_count = 1;
9118 __AfterRcvRpc(2869, "io_service_add_interest_notification_64")
9119}
9120
9121#if ( __MigTypeCheck )
9122#if __MIG_check__Request__iokit_subsystem__
9123#if !defined(__MIG_check__Request__io_service_add_notification_ool_64_t__defined)
9124#define __MIG_check__Request__io_service_add_notification_ool_64_t__defined
9125
9126mig_internal kern_return_t __MIG_check__Request__io_service_add_notification_ool_64_t(__attribute__((__unused__)) __Request__io_service_add_notification_ool_64_t *In0P, __attribute__((__unused__)) __Request__io_service_add_notification_ool_64_t **In1PP)
9127{
9128
9129 typedef __Request__io_service_add_notification_ool_64_t __Request;
9130 __Request *In1P;
9131#if __MigTypeCheck
9132 unsigned int msgh_size;
9133#endif /* __MigTypeCheck */
9134 unsigned int msgh_size_delta;
9135
9136#if __MigTypeCheck
9137 msgh_size = In0P->Head.msgh_size;
9138 if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
9139 (In0P->msgh_body.msgh_descriptor_count != 2) ||
9140 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 192)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
9141 return MIG_BAD_ARGUMENTS;
9142#endif /* __MigTypeCheck */
9143
9144#if __MigTypeCheck
9145 if (In0P->matching.type != MACH_MSG_OOL_DESCRIPTOR)
9146 return MIG_TYPE_ERROR;
9147#endif /* __MigTypeCheck */
9148
9149#if __MigTypeCheck
9150 if (In0P->wake_port.type != MACH_MSG_PORT_DESCRIPTOR ||
9151 In0P->wake_port.disposition != 17)
9152 return MIG_TYPE_ERROR;
9153#endif /* __MigTypeCheck */
9154
9155#if defined(__NDR_convert__int_rep__Request__io_service_add_notification_ool_64_t__notification_typeCnt__defined)
9156 if (In0P->NDR.int_rep != NDR_record.int_rep)
9157 __NDR_convert__int_rep__Request__io_service_add_notification_ool_64_t__notification_typeCnt(&In0P->notification_typeCnt, In0P->NDR.int_rep);
9158#endif /* __NDR_convert__int_rep__Request__io_service_add_notification_ool_64_t__notification_typeCnt__defined */
9159 msgh_size_delta = _WALIGN_(In0P->notification_typeCnt);
9160#if __MigTypeCheck
9161 if ( In0P->notification_typeCnt > 128 )
9162 return MIG_BAD_ARGUMENTS;
9163 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 192)) < In0P->notification_typeCnt) ||
9164 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 192) + _WALIGN_(In0P->notification_typeCnt)))
9165 return MIG_BAD_ARGUMENTS;
9166 msgh_size -= msgh_size_delta;
9167#endif /* __MigTypeCheck */
9168
9169 *In1PP = In1P = (__Request *) ((pointer_t) In0P + msgh_size_delta - 128);
9170
9171#if defined(__NDR_convert__int_rep__Request__io_service_add_notification_ool_64_t__referenceCnt__defined)
9172 if (In0P->NDR.int_rep != NDR_record.int_rep)
9173 __NDR_convert__int_rep__Request__io_service_add_notification_ool_64_t__referenceCnt(&In1P->referenceCnt, In1P->NDR.int_rep);
9174#endif /* __NDR_convert__int_rep__Request__io_service_add_notification_ool_64_t__referenceCnt__defined */
9175#if __MigTypeCheck
9176 if ( In1P->referenceCnt > 8 )
9177 return MIG_BAD_ARGUMENTS;
9178 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 192)) / 8 < In1P->referenceCnt) ||
9179 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 192) + (8 * In1P->referenceCnt)))
9180 return MIG_BAD_ARGUMENTS;
9181#endif /* __MigTypeCheck */
9182
9183#if __MigTypeCheck
9184 if (In0P->matching.size != In1P->matchingCnt)
9185 return MIG_TYPE_ERROR;
9186#endif /* __MigTypeCheck */
9187
9188#if __MigTypeCheck
9189 {
9190 char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
9191#if __MigKernelSpecificCode
9192 size_t strnlen_limit;
9193#else
9194 size_t memchr_limit;
9195#endif /* __MigKernelSpecificCode */
9196
9197#if __MigKernelSpecificCode
9198 strnlen_limit = min((msg_limit - In0P->notification_type), 128);
9199 if (( strnlen(In0P->notification_type, strnlen_limit) >= 128 + 1 ))
9200 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
9201#else
9202 memchr_limit = min((msg_limit - In0P->notification_type), 128);
9203 if (( memchr(In0P->notification_type, '\0', memchr_limit) == NULL ))
9204 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
9205#endif /* __MigKernelSpecificCode */
9206 }
9207#endif /* __MigTypeCheck */
9208
9209 return MACH_MSG_SUCCESS;
9210}
9211#endif /* !defined(__MIG_check__Request__io_service_add_notification_ool_64_t__defined) */
9212#endif /* __MIG_check__Request__iokit_subsystem__ */
9213#endif /* ( __MigTypeCheck ) */
9214
9215
9216/* Routine io_service_add_notification_ool_64 */
9217mig_internal novalue _Xio_service_add_notification_ool_64
9218 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
9219{
9220
9221#ifdef __MigPackStructs
9222#pragma pack(4)
9223#endif
9224 typedef struct {
9225 mach_msg_header_t Head;
9226 /* start of the kernel processed data */
9227 mach_msg_body_t msgh_body;
9228 mach_msg_ool_descriptor_t matching;
9229 mach_msg_port_descriptor_t wake_port;
9230 /* end of the kernel processed data */
9231 NDR_record_t NDR;
9232 mach_msg_type_number_t notification_typeOffset; /* MiG doesn't use it */
9233 mach_msg_type_number_t notification_typeCnt;
9234 char notification_type[128];
9235 mach_msg_type_number_t matchingCnt;
9236 mach_msg_type_number_t referenceCnt;
9237 io_user_reference_t reference[8];
9238 mach_msg_trailer_t trailer;
9239 } Request __attribute__((unused));
9240#ifdef __MigPackStructs
9241#pragma pack()
9242#endif
9243 typedef __Request__io_service_add_notification_ool_64_t __Request;
9244 typedef __Reply__io_service_add_notification_ool_64_t Reply __attribute__((unused));
9245
9246 /*
9247 * typedef struct {
9248 * mach_msg_header_t Head;
9249 * NDR_record_t NDR;
9250 * kern_return_t RetCode;
9251 * } mig_reply_error_t;
9252 */
9253
9254 Request *In0P = (Request *) InHeadP;
9255 Request *In1P;
9256 Reply *OutP = (Reply *) OutHeadP;
9257#ifdef __MIG_check__Request__io_service_add_notification_ool_64_t__defined
9258 kern_return_t check_result;
9259#endif /* __MIG_check__Request__io_service_add_notification_ool_64_t__defined */
9260
9261#if __MigKernelSpecificCode
9262#if UseStaticTemplates
9263 const static mach_msg_port_descriptor_t notificationTemplate = {
9264 /* name = */ MACH_PORT_NULL,
9265 /* pad1 = */ 0,
9266 /* pad2 = */ 0,
9267 /* disp = */ 17,
9268 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
9269 };
9270#endif /* UseStaticTemplates */
9271
9272#else
9273#if UseStaticTemplates
9274 const static mach_msg_port_descriptor_t notificationTemplate = {
9275 /* name = */ MACH_PORT_NULL,
9276 /* pad1 = */ 0,
9277 /* pad2 = */ 0,
9278 /* disp = */ 19,
9279 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
9280 };
9281#endif /* UseStaticTemplates */
9282
9283#endif /* __MigKernelSpecificCode */
9284 kern_return_t RetCode;
9285 io_object_t notification;
9286
9287 __DeclareRcvRpc(2870, "io_service_add_notification_ool_64")
9288 __BeforeRcvRpc(2870, "io_service_add_notification_ool_64")
9289
9290#if defined(__MIG_check__Request__io_service_add_notification_ool_64_t__defined)
9291 check_result = __MIG_check__Request__io_service_add_notification_ool_64_t((__Request *)In0P, (__Request **)&In1P);
9292 if (check_result != MACH_MSG_SUCCESS)
9293 { MIG_RETURN_ERROR(OutP, check_result); }
9294#endif /* defined(__MIG_check__Request__io_service_add_notification_ool_64_t__defined) */
9295
9296#if UseStaticTemplates
9297 OutP->notification = notificationTemplate;
9298#else /* UseStaticTemplates */
9299#if __MigKernelSpecificCode
9300 OutP->notification.disposition = 17;
9301#else
9302 OutP->notification.disposition = 19;
9303#endif /* __MigKernelSpecificCode */
9304#if !(defined(KERNEL) && defined(__LP64__))
9305 OutP->notification.pad1 = 0;
9306#endif
9307 OutP->notification.pad2 = 0;
9308 OutP->notification.type = MACH_MSG_PORT_DESCRIPTOR;
9309#if defined(KERNEL)
9310 OutP->notification.pad_end = 0;
9311#endif
9312#endif /* UseStaticTemplates */
9313
9314
9315 RetCode = is_io_service_add_notification_ool_64(In0P->Head.msgh_request_port, In0P->notification_type, (io_buf_ptr_t)(In0P->matching.address), In0P->matching.size, In0P->wake_port.name, In1P->reference, In1P->referenceCnt, &OutP->result, &notification);
9316 if (RetCode != KERN_SUCCESS) {
9317 MIG_RETURN_ERROR(OutP, RetCode);
9318 }
9319#if __MigKernelSpecificCode
9320#endif /* __MigKernelSpecificCode */
9321 OutP->notification.name = (mach_port_t)iokit_make_object_port(notification);
9322
9323
9324 OutP->NDR = NDR_record;
9325
9326
9327 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
9328 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
9329 OutP->msgh_body.msgh_descriptor_count = 1;
9330 __AfterRcvRpc(2870, "io_service_add_notification_ool_64")
9331}
9332
9333#if ( __MigTypeCheck )
9334#if __MIG_check__Request__iokit_subsystem__
9335#if !defined(__MIG_check__Request__io_registry_entry_get_registry_entry_id_t__defined)
9336#define __MIG_check__Request__io_registry_entry_get_registry_entry_id_t__defined
9337
9338mig_internal kern_return_t __MIG_check__Request__io_registry_entry_get_registry_entry_id_t(__attribute__((__unused__)) __Request__io_registry_entry_get_registry_entry_id_t *In0P)
9339{
9340
9341 typedef __Request__io_registry_entry_get_registry_entry_id_t __Request;
9342#if __MigTypeCheck
9343 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
9344 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
9345 return MIG_BAD_ARGUMENTS;
9346#endif /* __MigTypeCheck */
9347
9348 return MACH_MSG_SUCCESS;
9349}
9350#endif /* !defined(__MIG_check__Request__io_registry_entry_get_registry_entry_id_t__defined) */
9351#endif /* __MIG_check__Request__iokit_subsystem__ */
9352#endif /* ( __MigTypeCheck ) */
9353
9354
9355/* Routine io_registry_entry_get_registry_entry_id */
9356mig_internal novalue _Xio_registry_entry_get_registry_entry_id
9357 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
9358{
9359
9360#ifdef __MigPackStructs
9361#pragma pack(4)
9362#endif
9363 typedef struct {
9364 mach_msg_header_t Head;
9365 mach_msg_trailer_t trailer;
9366 } Request __attribute__((unused));
9367#ifdef __MigPackStructs
9368#pragma pack()
9369#endif
9370 typedef __Request__io_registry_entry_get_registry_entry_id_t __Request;
9371 typedef __Reply__io_registry_entry_get_registry_entry_id_t Reply __attribute__((unused));
9372
9373 /*
9374 * typedef struct {
9375 * mach_msg_header_t Head;
9376 * NDR_record_t NDR;
9377 * kern_return_t RetCode;
9378 * } mig_reply_error_t;
9379 */
9380
9381 Request *In0P = (Request *) InHeadP;
9382 Reply *OutP = (Reply *) OutHeadP;
9383#ifdef __MIG_check__Request__io_registry_entry_get_registry_entry_id_t__defined
9384 kern_return_t check_result;
9385#endif /* __MIG_check__Request__io_registry_entry_get_registry_entry_id_t__defined */
9386
9387#if __MigKernelSpecificCode
9388#else
9389#endif /* __MigKernelSpecificCode */
9390 io_object_t registry_entry;
9391
9392 __DeclareRcvRpc(2871, "io_registry_entry_get_registry_entry_id")
9393 __BeforeRcvRpc(2871, "io_registry_entry_get_registry_entry_id")
9394
9395#if defined(__MIG_check__Request__io_registry_entry_get_registry_entry_id_t__defined)
9396 check_result = __MIG_check__Request__io_registry_entry_get_registry_entry_id_t((__Request *)In0P);
9397 if (check_result != MACH_MSG_SUCCESS)
9398 { MIG_RETURN_ERROR(OutP, check_result); }
9399#endif /* defined(__MIG_check__Request__io_registry_entry_get_registry_entry_id_t__defined) */
9400
9401 registry_entry = iokit_lookup_object_port(In0P->Head.msgh_request_port);
9402
9403 OutP->RetCode = is_io_registry_entry_get_registry_entry_id(registry_entry, &OutP->entry_id);
9404 iokit_remove_reference(registry_entry);
9405 if (OutP->RetCode != KERN_SUCCESS) {
9406 MIG_RETURN_ERROR(OutP, OutP->RetCode);
9407 }
9408#if __MigKernelSpecificCode
9409#endif /* __MigKernelSpecificCode */
9410
9411 OutP->NDR = NDR_record;
9412
9413
9414 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
9415 __AfterRcvRpc(2871, "io_registry_entry_get_registry_entry_id")
9416}
9417
9418#if ( __MigTypeCheck )
9419#if __MIG_check__Request__iokit_subsystem__
9420#if !defined(__MIG_check__Request__io_connect_method_var_output_t__defined)
9421#define __MIG_check__Request__io_connect_method_var_output_t__defined
9422
9423mig_internal kern_return_t __MIG_check__Request__io_connect_method_var_output_t(__attribute__((__unused__)) __Request__io_connect_method_var_output_t *In0P, __attribute__((__unused__)) __Request__io_connect_method_var_output_t **In1PP, __attribute__((__unused__)) __Request__io_connect_method_var_output_t **In2PP)
9424{
9425
9426 typedef __Request__io_connect_method_var_output_t __Request;
9427 __Request *In1P;
9428 __Request *In2P;
9429#if __MigTypeCheck
9430 unsigned int msgh_size;
9431#endif /* __MigTypeCheck */
9432 unsigned int msgh_size_delta;
9433
9434#if __MigTypeCheck
9435 msgh_size = In0P->Head.msgh_size;
9436 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
9437 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 4224)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
9438 return MIG_BAD_ARGUMENTS;
9439#endif /* __MigTypeCheck */
9440
9441#if defined(__NDR_convert__int_rep__Request__io_connect_method_var_output_t__scalar_inputCnt__defined)
9442 if (In0P->NDR.int_rep != NDR_record.int_rep)
9443 __NDR_convert__int_rep__Request__io_connect_method_var_output_t__scalar_inputCnt(&In0P->scalar_inputCnt, In0P->NDR.int_rep);
9444#endif /* __NDR_convert__int_rep__Request__io_connect_method_var_output_t__scalar_inputCnt__defined */
9445 msgh_size_delta = (8 * In0P->scalar_inputCnt);
9446#if __MigTypeCheck
9447 if ( In0P->scalar_inputCnt > 16 )
9448 return MIG_BAD_ARGUMENTS;
9449 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 4224)) / 8 < In0P->scalar_inputCnt) ||
9450 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 4224) + (8 * In0P->scalar_inputCnt)))
9451 return MIG_BAD_ARGUMENTS;
9452 msgh_size -= msgh_size_delta;
9453#endif /* __MigTypeCheck */
9454
9455 *In1PP = In1P = (__Request *) ((pointer_t) In0P + msgh_size_delta - 128);
9456
9457#if defined(__NDR_convert__int_rep__Request__io_connect_method_var_output_t__inband_inputCnt__defined)
9458 if (In0P->NDR.int_rep != NDR_record.int_rep)
9459 __NDR_convert__int_rep__Request__io_connect_method_var_output_t__inband_inputCnt(&In1P->inband_inputCnt, In1P->NDR.int_rep);
9460#endif /* __NDR_convert__int_rep__Request__io_connect_method_var_output_t__inband_inputCnt__defined */
9461 msgh_size_delta = _WALIGN_(In1P->inband_inputCnt);
9462#if __MigTypeCheck
9463 if ( In1P->inband_inputCnt > 4096 )
9464 return MIG_BAD_ARGUMENTS;
9465 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 4224)) < In1P->inband_inputCnt) ||
9466 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 4224) + _WALIGN_(In1P->inband_inputCnt)))
9467 return MIG_BAD_ARGUMENTS;
9468#endif /* __MigTypeCheck */
9469
9470 *In2PP = In2P = (__Request *) ((pointer_t) In1P + msgh_size_delta - 4096);
9471
9472 return MACH_MSG_SUCCESS;
9473}
9474#endif /* !defined(__MIG_check__Request__io_connect_method_var_output_t__defined) */
9475#endif /* __MIG_check__Request__iokit_subsystem__ */
9476#endif /* ( __MigTypeCheck ) */
9477
9478
9479/* Routine io_connect_method_var_output */
9480mig_internal novalue _Xio_connect_method_var_output
9481 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
9482{
9483
9484#ifdef __MigPackStructs
9485#pragma pack(4)
9486#endif
9487 typedef struct {
9488 mach_msg_header_t Head;
9489 NDR_record_t NDR;
9490 uint32_t selector;
9491 mach_msg_type_number_t scalar_inputCnt;
9492 io_user_scalar_t scalar_input[16];
9493 mach_msg_type_number_t inband_inputCnt;
9494 char inband_input[4096];
9495 mach_vm_address_t ool_input;
9496 mach_vm_size_t ool_input_size;
9497 mach_msg_type_number_t inband_outputCnt;
9498 mach_msg_type_number_t scalar_outputCnt;
9499 mach_msg_trailer_t trailer;
9500 } Request __attribute__((unused));
9501#ifdef __MigPackStructs
9502#pragma pack()
9503#endif
9504 typedef __Request__io_connect_method_var_output_t __Request;
9505 typedef __Reply__io_connect_method_var_output_t Reply __attribute__((unused));
9506
9507 /*
9508 * typedef struct {
9509 * mach_msg_header_t Head;
9510 * NDR_record_t NDR;
9511 * kern_return_t RetCode;
9512 * } mig_reply_error_t;
9513 */
9514
9515 Request *In0P = (Request *) InHeadP;
9516 Request *In1P;
9517 Request *In2P;
9518 Reply *OutP = (Reply *) OutHeadP;
9519 unsigned int msgh_size;
9520 unsigned int msgh_size_delta;
9521
9522#ifdef __MIG_check__Request__io_connect_method_var_output_t__defined
9523 kern_return_t check_result;
9524#endif /* __MIG_check__Request__io_connect_method_var_output_t__defined */
9525
9526#if __MigKernelSpecificCode
9527#if UseStaticTemplates
9528 const static mach_msg_ool_descriptor_t var_outputTemplate = {
9529 /* addr = */ (void *)0,
9530 /* size = */ 0,
9531 /* deal = */ FALSE,
9532 /* copy = */ MACH_MSG_PHYSICAL_COPY,
9533 /* pad2 = */ 0,
9534 /* type = */ MACH_MSG_OOL_DESCRIPTOR,
9535 };
9536#endif /* UseStaticTemplates */
9537
9538#else
9539#if UseStaticTemplates
9540 const static mach_msg_ool_descriptor_t var_outputTemplate = {
9541 /* addr = */ (void *)0,
9542 /* size = */ 0,
9543 /* deal = */ FALSE,
9544 /* copy = */ MACH_MSG_PHYSICAL_COPY,
9545 /* pad2 = */ 0,
9546 /* type = */ MACH_MSG_OOL_DESCRIPTOR,
9547 };
9548#endif /* UseStaticTemplates */
9549
9550#endif /* __MigKernelSpecificCode */
9551 kern_return_t RetCode;
9552 io_connect_t connection;
9553 io_user_scalar_t scalar_output[16];
9554 mach_msg_type_number_t scalar_outputCnt;
9555 mach_msg_type_number_t var_outputCnt;
9556
9557 __DeclareRcvRpc(2872, "io_connect_method_var_output")
9558 __BeforeRcvRpc(2872, "io_connect_method_var_output")
9559
9560#if defined(__MIG_check__Request__io_connect_method_var_output_t__defined)
9561 check_result = __MIG_check__Request__io_connect_method_var_output_t((__Request *)In0P, (__Request **)&In1P, (__Request **)&In2P);
9562 if (check_result != MACH_MSG_SUCCESS)
9563 { MIG_RETURN_ERROR(OutP, check_result); }
9564#endif /* defined(__MIG_check__Request__io_connect_method_var_output_t__defined) */
9565
9566#if UseStaticTemplates
9567 OutP->var_output = var_outputTemplate;
9568#else /* UseStaticTemplates */
9569 OutP->var_output.deallocate = FALSE;
9570 OutP->var_output.copy = MACH_MSG_PHYSICAL_COPY;
9571 OutP->var_output.pad1 = 0;
9572 OutP->var_output.type = MACH_MSG_OOL_DESCRIPTOR;
9573#if defined(KERNEL) && !defined(__LP64__)
9574 OutP->var_output.pad_end = 0;
9575#endif
9576#endif /* UseStaticTemplates */
9577
9578
9579 connection = iokit_lookup_connect_port(In0P->Head.msgh_request_port);
9580
9581 OutP->inband_outputCnt = 4096;
9582 if (In2P->inband_outputCnt < OutP->inband_outputCnt)
9583 OutP->inband_outputCnt = In2P->inband_outputCnt;
9584
9585 scalar_outputCnt = 16;
9586 if (In2P->scalar_outputCnt < scalar_outputCnt)
9587 scalar_outputCnt = In2P->scalar_outputCnt;
9588
9589 RetCode = is_io_connect_method_var_output(connection, In0P->selector, In0P->scalar_input, In0P->scalar_inputCnt, In1P->inband_input, In1P->inband_inputCnt, In2P->ool_input, In2P->ool_input_size, OutP->inband_output, &OutP->inband_outputCnt, scalar_output, &scalar_outputCnt, (io_buf_ptr_t *)&(OutP->var_output.address), &var_outputCnt);
9590 iokit_remove_connect_reference(connection);
9591 if (RetCode != KERN_SUCCESS) {
9592 MIG_RETURN_ERROR(OutP, RetCode);
9593 }
9594#if __MigKernelSpecificCode
9595#endif /* __MigKernelSpecificCode */
9596 OutP->var_output.size = var_outputCnt;
9597
9598
9599 OutP->NDR = NDR_record;
9600
9601 msgh_size_delta = _WALIGN_((OutP->inband_outputCnt + 3) & ~3);
9602 msgh_size = (mach_msg_size_t)(sizeof(Reply) - 4224) + msgh_size_delta;
9603 OutP = (Reply *) ((pointer_t) OutP + msgh_size_delta - 4096);
9604 (void)memcpy((char *) OutP->scalar_output, (const char *) scalar_output, 8 * scalar_outputCnt);
9605 OutP->scalar_outputCnt = scalar_outputCnt;
9606 msgh_size_delta = ((8 * scalar_outputCnt));
9607 msgh_size += msgh_size_delta;
9608 OutP = (Reply *) ((pointer_t) OutP + msgh_size_delta - 128);
9609 OutP->var_outputCnt = var_outputCnt;
9610
9611 OutP = (Reply *) OutHeadP;
9612 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
9613 OutP->Head.msgh_size = msgh_size;
9614 OutP->msgh_body.msgh_descriptor_count = 1;
9615 __AfterRcvRpc(2872, "io_connect_method_var_output")
9616}
9617
9618#if ( __MigTypeCheck )
9619#if __MIG_check__Request__iokit_subsystem__
9620#if !defined(__MIG_check__Request__io_service_get_matching_service_t__defined)
9621#define __MIG_check__Request__io_service_get_matching_service_t__defined
9622
9623mig_internal kern_return_t __MIG_check__Request__io_service_get_matching_service_t(__attribute__((__unused__)) __Request__io_service_get_matching_service_t *In0P)
9624{
9625
9626 typedef __Request__io_service_get_matching_service_t __Request;
9627#if __MigTypeCheck
9628 unsigned int msgh_size;
9629#endif /* __MigTypeCheck */
9630
9631#if __MigTypeCheck
9632 msgh_size = In0P->Head.msgh_size;
9633 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
9634 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 512)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
9635 return MIG_BAD_ARGUMENTS;
9636#endif /* __MigTypeCheck */
9637
9638#if defined(__NDR_convert__int_rep__Request__io_service_get_matching_service_t__matchingCnt__defined)
9639 if (In0P->NDR.int_rep != NDR_record.int_rep)
9640 __NDR_convert__int_rep__Request__io_service_get_matching_service_t__matchingCnt(&In0P->matchingCnt, In0P->NDR.int_rep);
9641#endif /* __NDR_convert__int_rep__Request__io_service_get_matching_service_t__matchingCnt__defined */
9642#if __MigTypeCheck
9643 if ( In0P->matchingCnt > 512 )
9644 return MIG_BAD_ARGUMENTS;
9645 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 512)) < In0P->matchingCnt) ||
9646 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 512) + _WALIGN_(In0P->matchingCnt)))
9647 return MIG_BAD_ARGUMENTS;
9648#endif /* __MigTypeCheck */
9649
9650#if __MigTypeCheck
9651 {
9652 char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
9653#if __MigKernelSpecificCode
9654 size_t strnlen_limit;
9655#else
9656 size_t memchr_limit;
9657#endif /* __MigKernelSpecificCode */
9658
9659#if __MigKernelSpecificCode
9660 strnlen_limit = min((msg_limit - In0P->matching), 512);
9661 if (( strnlen(In0P->matching, strnlen_limit) >= 512 + 1 ))
9662 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
9663#else
9664 memchr_limit = min((msg_limit - In0P->matching), 512);
9665 if (( memchr(In0P->matching, '\0', memchr_limit) == NULL ))
9666 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
9667#endif /* __MigKernelSpecificCode */
9668 }
9669#endif /* __MigTypeCheck */
9670
9671 return MACH_MSG_SUCCESS;
9672}
9673#endif /* !defined(__MIG_check__Request__io_service_get_matching_service_t__defined) */
9674#endif /* __MIG_check__Request__iokit_subsystem__ */
9675#endif /* ( __MigTypeCheck ) */
9676
9677
9678/* Routine io_service_get_matching_service */
9679mig_internal novalue _Xio_service_get_matching_service
9680 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
9681{
9682
9683#ifdef __MigPackStructs
9684#pragma pack(4)
9685#endif
9686 typedef struct {
9687 mach_msg_header_t Head;
9688 NDR_record_t NDR;
9689 mach_msg_type_number_t matchingOffset; /* MiG doesn't use it */
9690 mach_msg_type_number_t matchingCnt;
9691 char matching[512];
9692 mach_msg_trailer_t trailer;
9693 } Request __attribute__((unused));
9694#ifdef __MigPackStructs
9695#pragma pack()
9696#endif
9697 typedef __Request__io_service_get_matching_service_t __Request;
9698 typedef __Reply__io_service_get_matching_service_t Reply __attribute__((unused));
9699
9700 /*
9701 * typedef struct {
9702 * mach_msg_header_t Head;
9703 * NDR_record_t NDR;
9704 * kern_return_t RetCode;
9705 * } mig_reply_error_t;
9706 */
9707
9708 Request *In0P = (Request *) InHeadP;
9709 Reply *OutP = (Reply *) OutHeadP;
9710#ifdef __MIG_check__Request__io_service_get_matching_service_t__defined
9711 kern_return_t check_result;
9712#endif /* __MIG_check__Request__io_service_get_matching_service_t__defined */
9713
9714#if __MigKernelSpecificCode
9715#if UseStaticTemplates
9716 const static mach_msg_port_descriptor_t serviceTemplate = {
9717 /* name = */ MACH_PORT_NULL,
9718 /* pad1 = */ 0,
9719 /* pad2 = */ 0,
9720 /* disp = */ 17,
9721 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
9722 };
9723#endif /* UseStaticTemplates */
9724
9725#else
9726#if UseStaticTemplates
9727 const static mach_msg_port_descriptor_t serviceTemplate = {
9728 /* name = */ MACH_PORT_NULL,
9729 /* pad1 = */ 0,
9730 /* pad2 = */ 0,
9731 /* disp = */ 19,
9732 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
9733 };
9734#endif /* UseStaticTemplates */
9735
9736#endif /* __MigKernelSpecificCode */
9737 kern_return_t RetCode;
9738 io_object_t service;
9739
9740 __DeclareRcvRpc(2873, "io_service_get_matching_service")
9741 __BeforeRcvRpc(2873, "io_service_get_matching_service")
9742
9743#if defined(__MIG_check__Request__io_service_get_matching_service_t__defined)
9744 check_result = __MIG_check__Request__io_service_get_matching_service_t((__Request *)In0P);
9745 if (check_result != MACH_MSG_SUCCESS)
9746 { MIG_RETURN_ERROR(OutP, check_result); }
9747#endif /* defined(__MIG_check__Request__io_service_get_matching_service_t__defined) */
9748
9749#if UseStaticTemplates
9750 OutP->service = serviceTemplate;
9751#else /* UseStaticTemplates */
9752#if __MigKernelSpecificCode
9753 OutP->service.disposition = 17;
9754#else
9755 OutP->service.disposition = 19;
9756#endif /* __MigKernelSpecificCode */
9757#if !(defined(KERNEL) && defined(__LP64__))
9758 OutP->service.pad1 = 0;
9759#endif
9760 OutP->service.pad2 = 0;
9761 OutP->service.type = MACH_MSG_PORT_DESCRIPTOR;
9762#if defined(KERNEL)
9763 OutP->service.pad_end = 0;
9764#endif
9765#endif /* UseStaticTemplates */
9766
9767
9768 RetCode = is_io_service_get_matching_service(In0P->Head.msgh_request_port, In0P->matching, &service);
9769 if (RetCode != KERN_SUCCESS) {
9770 MIG_RETURN_ERROR(OutP, RetCode);
9771 }
9772#if __MigKernelSpecificCode
9773#endif /* __MigKernelSpecificCode */
9774 OutP->service.name = (mach_port_t)iokit_make_object_port(service);
9775
9776
9777 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
9778 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
9779 OutP->msgh_body.msgh_descriptor_count = 1;
9780 __AfterRcvRpc(2873, "io_service_get_matching_service")
9781}
9782
9783#if ( __MigTypeCheck )
9784#if __MIG_check__Request__iokit_subsystem__
9785#if !defined(__MIG_check__Request__io_service_get_matching_service_ool_t__defined)
9786#define __MIG_check__Request__io_service_get_matching_service_ool_t__defined
9787
9788mig_internal kern_return_t __MIG_check__Request__io_service_get_matching_service_ool_t(__attribute__((__unused__)) __Request__io_service_get_matching_service_ool_t *In0P)
9789{
9790
9791 typedef __Request__io_service_get_matching_service_ool_t __Request;
9792#if __MigTypeCheck
9793 if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
9794 (In0P->msgh_body.msgh_descriptor_count != 1) ||
9795 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
9796 return MIG_BAD_ARGUMENTS;
9797#endif /* __MigTypeCheck */
9798
9799#if __MigTypeCheck
9800 if (In0P->matching.type != MACH_MSG_OOL_DESCRIPTOR)
9801 return MIG_TYPE_ERROR;
9802#endif /* __MigTypeCheck */
9803
9804#if __MigTypeCheck
9805 if (In0P->matching.size != In0P->matchingCnt)
9806 return MIG_TYPE_ERROR;
9807#endif /* __MigTypeCheck */
9808
9809 return MACH_MSG_SUCCESS;
9810}
9811#endif /* !defined(__MIG_check__Request__io_service_get_matching_service_ool_t__defined) */
9812#endif /* __MIG_check__Request__iokit_subsystem__ */
9813#endif /* ( __MigTypeCheck ) */
9814
9815
9816/* Routine io_service_get_matching_service_ool */
9817mig_internal novalue _Xio_service_get_matching_service_ool
9818 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
9819{
9820
9821#ifdef __MigPackStructs
9822#pragma pack(4)
9823#endif
9824 typedef struct {
9825 mach_msg_header_t Head;
9826 /* start of the kernel processed data */
9827 mach_msg_body_t msgh_body;
9828 mach_msg_ool_descriptor_t matching;
9829 /* end of the kernel processed data */
9830 NDR_record_t NDR;
9831 mach_msg_type_number_t matchingCnt;
9832 mach_msg_trailer_t trailer;
9833 } Request __attribute__((unused));
9834#ifdef __MigPackStructs
9835#pragma pack()
9836#endif
9837 typedef __Request__io_service_get_matching_service_ool_t __Request;
9838 typedef __Reply__io_service_get_matching_service_ool_t Reply __attribute__((unused));
9839
9840 /*
9841 * typedef struct {
9842 * mach_msg_header_t Head;
9843 * NDR_record_t NDR;
9844 * kern_return_t RetCode;
9845 * } mig_reply_error_t;
9846 */
9847
9848 Request *In0P = (Request *) InHeadP;
9849 Reply *OutP = (Reply *) OutHeadP;
9850#ifdef __MIG_check__Request__io_service_get_matching_service_ool_t__defined
9851 kern_return_t check_result;
9852#endif /* __MIG_check__Request__io_service_get_matching_service_ool_t__defined */
9853
9854#if __MigKernelSpecificCode
9855#if UseStaticTemplates
9856 const static mach_msg_port_descriptor_t serviceTemplate = {
9857 /* name = */ MACH_PORT_NULL,
9858 /* pad1 = */ 0,
9859 /* pad2 = */ 0,
9860 /* disp = */ 17,
9861 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
9862 };
9863#endif /* UseStaticTemplates */
9864
9865#else
9866#if UseStaticTemplates
9867 const static mach_msg_port_descriptor_t serviceTemplate = {
9868 /* name = */ MACH_PORT_NULL,
9869 /* pad1 = */ 0,
9870 /* pad2 = */ 0,
9871 /* disp = */ 19,
9872 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
9873 };
9874#endif /* UseStaticTemplates */
9875
9876#endif /* __MigKernelSpecificCode */
9877 kern_return_t RetCode;
9878 io_object_t service;
9879
9880 __DeclareRcvRpc(2874, "io_service_get_matching_service_ool")
9881 __BeforeRcvRpc(2874, "io_service_get_matching_service_ool")
9882
9883#if defined(__MIG_check__Request__io_service_get_matching_service_ool_t__defined)
9884 check_result = __MIG_check__Request__io_service_get_matching_service_ool_t((__Request *)In0P);
9885 if (check_result != MACH_MSG_SUCCESS)
9886 { MIG_RETURN_ERROR(OutP, check_result); }
9887#endif /* defined(__MIG_check__Request__io_service_get_matching_service_ool_t__defined) */
9888
9889#if UseStaticTemplates
9890 OutP->service = serviceTemplate;
9891#else /* UseStaticTemplates */
9892#if __MigKernelSpecificCode
9893 OutP->service.disposition = 17;
9894#else
9895 OutP->service.disposition = 19;
9896#endif /* __MigKernelSpecificCode */
9897#if !(defined(KERNEL) && defined(__LP64__))
9898 OutP->service.pad1 = 0;
9899#endif
9900 OutP->service.pad2 = 0;
9901 OutP->service.type = MACH_MSG_PORT_DESCRIPTOR;
9902#if defined(KERNEL)
9903 OutP->service.pad_end = 0;
9904#endif
9905#endif /* UseStaticTemplates */
9906
9907
9908 RetCode = is_io_service_get_matching_service_ool(In0P->Head.msgh_request_port, (io_buf_ptr_t)(In0P->matching.address), In0P->matching.size, &OutP->result, &service);
9909 if (RetCode != KERN_SUCCESS) {
9910 MIG_RETURN_ERROR(OutP, RetCode);
9911 }
9912#if __MigKernelSpecificCode
9913#endif /* __MigKernelSpecificCode */
9914 OutP->service.name = (mach_port_t)iokit_make_object_port(service);
9915
9916
9917 OutP->NDR = NDR_record;
9918
9919
9920 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
9921 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
9922 OutP->msgh_body.msgh_descriptor_count = 1;
9923 __AfterRcvRpc(2874, "io_service_get_matching_service_ool")
9924}
9925
9926#if ( __MigTypeCheck )
9927#if __MIG_check__Request__iokit_subsystem__
9928#if !defined(__MIG_check__Request__io_service_get_authorization_id_t__defined)
9929#define __MIG_check__Request__io_service_get_authorization_id_t__defined
9930
9931mig_internal kern_return_t __MIG_check__Request__io_service_get_authorization_id_t(__attribute__((__unused__)) __Request__io_service_get_authorization_id_t *In0P)
9932{
9933
9934 typedef __Request__io_service_get_authorization_id_t __Request;
9935#if __MigTypeCheck
9936 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
9937 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
9938 return MIG_BAD_ARGUMENTS;
9939#endif /* __MigTypeCheck */
9940
9941 return MACH_MSG_SUCCESS;
9942}
9943#endif /* !defined(__MIG_check__Request__io_service_get_authorization_id_t__defined) */
9944#endif /* __MIG_check__Request__iokit_subsystem__ */
9945#endif /* ( __MigTypeCheck ) */
9946
9947
9948/* Routine io_service_get_authorization_id */
9949mig_internal novalue _Xio_service_get_authorization_id
9950 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
9951{
9952
9953#ifdef __MigPackStructs
9954#pragma pack(4)
9955#endif
9956 typedef struct {
9957 mach_msg_header_t Head;
9958 mach_msg_trailer_t trailer;
9959 } Request __attribute__((unused));
9960#ifdef __MigPackStructs
9961#pragma pack()
9962#endif
9963 typedef __Request__io_service_get_authorization_id_t __Request;
9964 typedef __Reply__io_service_get_authorization_id_t Reply __attribute__((unused));
9965
9966 /*
9967 * typedef struct {
9968 * mach_msg_header_t Head;
9969 * NDR_record_t NDR;
9970 * kern_return_t RetCode;
9971 * } mig_reply_error_t;
9972 */
9973
9974 Request *In0P = (Request *) InHeadP;
9975 Reply *OutP = (Reply *) OutHeadP;
9976#ifdef __MIG_check__Request__io_service_get_authorization_id_t__defined
9977 kern_return_t check_result;
9978#endif /* __MIG_check__Request__io_service_get_authorization_id_t__defined */
9979
9980#if __MigKernelSpecificCode
9981#else
9982#endif /* __MigKernelSpecificCode */
9983 io_object_t service;
9984
9985 __DeclareRcvRpc(2875, "io_service_get_authorization_id")
9986 __BeforeRcvRpc(2875, "io_service_get_authorization_id")
9987
9988#if defined(__MIG_check__Request__io_service_get_authorization_id_t__defined)
9989 check_result = __MIG_check__Request__io_service_get_authorization_id_t((__Request *)In0P);
9990 if (check_result != MACH_MSG_SUCCESS)
9991 { MIG_RETURN_ERROR(OutP, check_result); }
9992#endif /* defined(__MIG_check__Request__io_service_get_authorization_id_t__defined) */
9993
9994 service = iokit_lookup_object_port(In0P->Head.msgh_request_port);
9995
9996 OutP->RetCode = is_io_service_get_authorization_id(service, &OutP->authorization_id);
9997 iokit_remove_reference(service);
9998 if (OutP->RetCode != KERN_SUCCESS) {
9999 MIG_RETURN_ERROR(OutP, OutP->RetCode);
10000 }
10001#if __MigKernelSpecificCode
10002#endif /* __MigKernelSpecificCode */
10003
10004 OutP->NDR = NDR_record;
10005
10006
10007 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
10008 __AfterRcvRpc(2875, "io_service_get_authorization_id")
10009}
10010
10011#if ( __MigTypeCheck )
10012#if __MIG_check__Request__iokit_subsystem__
10013#if !defined(__MIG_check__Request__io_service_set_authorization_id_t__defined)
10014#define __MIG_check__Request__io_service_set_authorization_id_t__defined
10015
10016mig_internal kern_return_t __MIG_check__Request__io_service_set_authorization_id_t(__attribute__((__unused__)) __Request__io_service_set_authorization_id_t *In0P)
10017{
10018
10019 typedef __Request__io_service_set_authorization_id_t __Request;
10020#if __MigTypeCheck
10021 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
10022 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
10023 return MIG_BAD_ARGUMENTS;
10024#endif /* __MigTypeCheck */
10025
10026 return MACH_MSG_SUCCESS;
10027}
10028#endif /* !defined(__MIG_check__Request__io_service_set_authorization_id_t__defined) */
10029#endif /* __MIG_check__Request__iokit_subsystem__ */
10030#endif /* ( __MigTypeCheck ) */
10031
10032
10033/* Routine io_service_set_authorization_id */
10034mig_internal novalue _Xio_service_set_authorization_id
10035 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
10036{
10037
10038#ifdef __MigPackStructs
10039#pragma pack(4)
10040#endif
10041 typedef struct {
10042 mach_msg_header_t Head;
10043 NDR_record_t NDR;
10044 uint64_t authorization_id;
10045 mach_msg_trailer_t trailer;
10046 } Request __attribute__((unused));
10047#ifdef __MigPackStructs
10048#pragma pack()
10049#endif
10050 typedef __Request__io_service_set_authorization_id_t __Request;
10051 typedef __Reply__io_service_set_authorization_id_t Reply __attribute__((unused));
10052
10053 /*
10054 * typedef struct {
10055 * mach_msg_header_t Head;
10056 * NDR_record_t NDR;
10057 * kern_return_t RetCode;
10058 * } mig_reply_error_t;
10059 */
10060
10061 Request *In0P = (Request *) InHeadP;
10062 Reply *OutP = (Reply *) OutHeadP;
10063#ifdef __MIG_check__Request__io_service_set_authorization_id_t__defined
10064 kern_return_t check_result;
10065#endif /* __MIG_check__Request__io_service_set_authorization_id_t__defined */
10066
10067#if __MigKernelSpecificCode
10068#else
10069#endif /* __MigKernelSpecificCode */
10070 io_object_t service;
10071
10072 __DeclareRcvRpc(2876, "io_service_set_authorization_id")
10073 __BeforeRcvRpc(2876, "io_service_set_authorization_id")
10074
10075#if defined(__MIG_check__Request__io_service_set_authorization_id_t__defined)
10076 check_result = __MIG_check__Request__io_service_set_authorization_id_t((__Request *)In0P);
10077 if (check_result != MACH_MSG_SUCCESS)
10078 { MIG_RETURN_ERROR(OutP, check_result); }
10079#endif /* defined(__MIG_check__Request__io_service_set_authorization_id_t__defined) */
10080
10081 service = iokit_lookup_object_port(In0P->Head.msgh_request_port);
10082
10083 OutP->RetCode = is_io_service_set_authorization_id(service, In0P->authorization_id);
10084 iokit_remove_reference(service);
10085#if __MigKernelSpecificCode
10086#endif /* __MigKernelSpecificCode */
10087
10088 OutP->NDR = NDR_record;
10089
10090
10091 __AfterRcvRpc(2876, "io_service_set_authorization_id")
10092}
10093
10094#if ( __MigTypeCheck )
10095#if __MIG_check__Request__iokit_subsystem__
10096#if !defined(__MIG_check__Request__io_server_version_t__defined)
10097#define __MIG_check__Request__io_server_version_t__defined
10098
10099mig_internal kern_return_t __MIG_check__Request__io_server_version_t(__attribute__((__unused__)) __Request__io_server_version_t *In0P)
10100{
10101
10102 typedef __Request__io_server_version_t __Request;
10103#if __MigTypeCheck
10104 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
10105 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
10106 return MIG_BAD_ARGUMENTS;
10107#endif /* __MigTypeCheck */
10108
10109 return MACH_MSG_SUCCESS;
10110}
10111#endif /* !defined(__MIG_check__Request__io_server_version_t__defined) */
10112#endif /* __MIG_check__Request__iokit_subsystem__ */
10113#endif /* ( __MigTypeCheck ) */
10114
10115
10116/* Routine io_server_version */
10117mig_internal novalue _Xio_server_version
10118 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
10119{
10120
10121#ifdef __MigPackStructs
10122#pragma pack(4)
10123#endif
10124 typedef struct {
10125 mach_msg_header_t Head;
10126 mach_msg_trailer_t trailer;
10127 } Request __attribute__((unused));
10128#ifdef __MigPackStructs
10129#pragma pack()
10130#endif
10131 typedef __Request__io_server_version_t __Request;
10132 typedef __Reply__io_server_version_t Reply __attribute__((unused));
10133
10134 /*
10135 * typedef struct {
10136 * mach_msg_header_t Head;
10137 * NDR_record_t NDR;
10138 * kern_return_t RetCode;
10139 * } mig_reply_error_t;
10140 */
10141
10142 Request *In0P = (Request *) InHeadP;
10143 Reply *OutP = (Reply *) OutHeadP;
10144#ifdef __MIG_check__Request__io_server_version_t__defined
10145 kern_return_t check_result;
10146#endif /* __MIG_check__Request__io_server_version_t__defined */
10147
10148#if __MigKernelSpecificCode
10149#else
10150#endif /* __MigKernelSpecificCode */
10151 __DeclareRcvRpc(2877, "io_server_version")
10152 __BeforeRcvRpc(2877, "io_server_version")
10153
10154#if defined(__MIG_check__Request__io_server_version_t__defined)
10155 check_result = __MIG_check__Request__io_server_version_t((__Request *)In0P);
10156 if (check_result != MACH_MSG_SUCCESS)
10157 { MIG_RETURN_ERROR(OutP, check_result); }
10158#endif /* defined(__MIG_check__Request__io_server_version_t__defined) */
10159
10160 OutP->RetCode = is_io_server_version(In0P->Head.msgh_request_port, &OutP->version);
10161 if (OutP->RetCode != KERN_SUCCESS) {
10162 MIG_RETURN_ERROR(OutP, OutP->RetCode);
10163 }
10164#if __MigKernelSpecificCode
10165#endif /* __MigKernelSpecificCode */
10166
10167 OutP->NDR = NDR_record;
10168
10169
10170 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
10171 __AfterRcvRpc(2877, "io_server_version")
10172}
10173
10174#if ( __MigTypeCheck )
10175#if __MIG_check__Request__iokit_subsystem__
10176#if !defined(__MIG_check__Request__io_registry_entry_get_properties_bin_t__defined)
10177#define __MIG_check__Request__io_registry_entry_get_properties_bin_t__defined
10178
10179mig_internal kern_return_t __MIG_check__Request__io_registry_entry_get_properties_bin_t(__attribute__((__unused__)) __Request__io_registry_entry_get_properties_bin_t *In0P)
10180{
10181
10182 typedef __Request__io_registry_entry_get_properties_bin_t __Request;
10183#if __MigTypeCheck
10184 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
10185 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
10186 return MIG_BAD_ARGUMENTS;
10187#endif /* __MigTypeCheck */
10188
10189 return MACH_MSG_SUCCESS;
10190}
10191#endif /* !defined(__MIG_check__Request__io_registry_entry_get_properties_bin_t__defined) */
10192#endif /* __MIG_check__Request__iokit_subsystem__ */
10193#endif /* ( __MigTypeCheck ) */
10194
10195
10196/* Routine io_registry_entry_get_properties_bin */
10197mig_internal novalue _Xio_registry_entry_get_properties_bin
10198 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
10199{
10200
10201#ifdef __MigPackStructs
10202#pragma pack(4)
10203#endif
10204 typedef struct {
10205 mach_msg_header_t Head;
10206 mach_msg_trailer_t trailer;
10207 } Request __attribute__((unused));
10208#ifdef __MigPackStructs
10209#pragma pack()
10210#endif
10211 typedef __Request__io_registry_entry_get_properties_bin_t __Request;
10212 typedef __Reply__io_registry_entry_get_properties_bin_t Reply __attribute__((unused));
10213
10214 /*
10215 * typedef struct {
10216 * mach_msg_header_t Head;
10217 * NDR_record_t NDR;
10218 * kern_return_t RetCode;
10219 * } mig_reply_error_t;
10220 */
10221
10222 Request *In0P = (Request *) InHeadP;
10223 Reply *OutP = (Reply *) OutHeadP;
10224#ifdef __MIG_check__Request__io_registry_entry_get_properties_bin_t__defined
10225 kern_return_t check_result;
10226#endif /* __MIG_check__Request__io_registry_entry_get_properties_bin_t__defined */
10227
10228#if __MigKernelSpecificCode
10229#if UseStaticTemplates
10230 const static mach_msg_ool_descriptor_t propertiesTemplate = {
10231 /* addr = */ (void *)0,
10232 /* size = */ 0,
10233 /* deal = */ FALSE,
10234 /* copy = */ MACH_MSG_PHYSICAL_COPY,
10235 /* pad2 = */ 0,
10236 /* type = */ MACH_MSG_OOL_DESCRIPTOR,
10237 };
10238#endif /* UseStaticTemplates */
10239
10240#else
10241#if UseStaticTemplates
10242 const static mach_msg_ool_descriptor_t propertiesTemplate = {
10243 /* addr = */ (void *)0,
10244 /* size = */ 0,
10245 /* deal = */ FALSE,
10246 /* copy = */ MACH_MSG_PHYSICAL_COPY,
10247 /* pad2 = */ 0,
10248 /* type = */ MACH_MSG_OOL_DESCRIPTOR,
10249 };
10250#endif /* UseStaticTemplates */
10251
10252#endif /* __MigKernelSpecificCode */
10253 kern_return_t RetCode;
10254 io_object_t registry_entry;
10255
10256 __DeclareRcvRpc(2878, "io_registry_entry_get_properties_bin")
10257 __BeforeRcvRpc(2878, "io_registry_entry_get_properties_bin")
10258
10259#if defined(__MIG_check__Request__io_registry_entry_get_properties_bin_t__defined)
10260 check_result = __MIG_check__Request__io_registry_entry_get_properties_bin_t((__Request *)In0P);
10261 if (check_result != MACH_MSG_SUCCESS)
10262 { MIG_RETURN_ERROR(OutP, check_result); }
10263#endif /* defined(__MIG_check__Request__io_registry_entry_get_properties_bin_t__defined) */
10264
10265#if UseStaticTemplates
10266 OutP->properties = propertiesTemplate;
10267#else /* UseStaticTemplates */
10268 OutP->properties.deallocate = FALSE;
10269 OutP->properties.copy = MACH_MSG_PHYSICAL_COPY;
10270 OutP->properties.pad1 = 0;
10271 OutP->properties.type = MACH_MSG_OOL_DESCRIPTOR;
10272#if defined(KERNEL) && !defined(__LP64__)
10273 OutP->properties.pad_end = 0;
10274#endif
10275#endif /* UseStaticTemplates */
10276
10277
10278 registry_entry = iokit_lookup_object_port(In0P->Head.msgh_request_port);
10279
10280 RetCode = is_io_registry_entry_get_properties_bin(registry_entry, (io_buf_ptr_t *)&(OutP->properties.address), &OutP->propertiesCnt);
10281 iokit_remove_reference(registry_entry);
10282 if (RetCode != KERN_SUCCESS) {
10283 MIG_RETURN_ERROR(OutP, RetCode);
10284 }
10285#if __MigKernelSpecificCode
10286#endif /* __MigKernelSpecificCode */
10287 OutP->properties.size = OutP->propertiesCnt;
10288
10289
10290 OutP->NDR = NDR_record;
10291
10292
10293 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
10294 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
10295 OutP->msgh_body.msgh_descriptor_count = 1;
10296 __AfterRcvRpc(2878, "io_registry_entry_get_properties_bin")
10297}
10298
10299#if ( __MigTypeCheck )
10300#if __MIG_check__Request__iokit_subsystem__
10301#if !defined(__MIG_check__Request__io_registry_entry_get_property_bin_t__defined)
10302#define __MIG_check__Request__io_registry_entry_get_property_bin_t__defined
10303
10304mig_internal kern_return_t __MIG_check__Request__io_registry_entry_get_property_bin_t(__attribute__((__unused__)) __Request__io_registry_entry_get_property_bin_t *In0P, __attribute__((__unused__)) __Request__io_registry_entry_get_property_bin_t **In1PP, __attribute__((__unused__)) __Request__io_registry_entry_get_property_bin_t **In2PP)
10305{
10306
10307 typedef __Request__io_registry_entry_get_property_bin_t __Request;
10308 __Request *In1P;
10309 __Request *In2P;
10310#if __MigTypeCheck
10311 unsigned int msgh_size;
10312#endif /* __MigTypeCheck */
10313 unsigned int msgh_size_delta;
10314
10315#if __MigTypeCheck
10316 msgh_size = In0P->Head.msgh_size;
10317 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
10318 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 256)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
10319 return MIG_BAD_ARGUMENTS;
10320#endif /* __MigTypeCheck */
10321
10322#if defined(__NDR_convert__int_rep__Request__io_registry_entry_get_property_bin_t__planeCnt__defined)
10323 if (In0P->NDR.int_rep != NDR_record.int_rep)
10324 __NDR_convert__int_rep__Request__io_registry_entry_get_property_bin_t__planeCnt(&In0P->planeCnt, In0P->NDR.int_rep);
10325#endif /* __NDR_convert__int_rep__Request__io_registry_entry_get_property_bin_t__planeCnt__defined */
10326 msgh_size_delta = _WALIGN_(In0P->planeCnt);
10327#if __MigTypeCheck
10328 if ( In0P->planeCnt > 128 )
10329 return MIG_BAD_ARGUMENTS;
10330 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 256)) < In0P->planeCnt) ||
10331 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 256) + _WALIGN_(In0P->planeCnt)))
10332 return MIG_BAD_ARGUMENTS;
10333 msgh_size -= msgh_size_delta;
10334#endif /* __MigTypeCheck */
10335
10336 *In1PP = In1P = (__Request *) ((pointer_t) In0P + msgh_size_delta - 128);
10337
10338#if defined(__NDR_convert__int_rep__Request__io_registry_entry_get_property_bin_t__property_nameCnt__defined)
10339 if (In0P->NDR.int_rep != NDR_record.int_rep)
10340 __NDR_convert__int_rep__Request__io_registry_entry_get_property_bin_t__property_nameCnt(&In1P->property_nameCnt, In1P->NDR.int_rep);
10341#endif /* __NDR_convert__int_rep__Request__io_registry_entry_get_property_bin_t__property_nameCnt__defined */
10342 msgh_size_delta = _WALIGN_(In1P->property_nameCnt);
10343#if __MigTypeCheck
10344 if ( In1P->property_nameCnt > 128 )
10345 return MIG_BAD_ARGUMENTS;
10346 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 256)) < In1P->property_nameCnt) ||
10347 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 256) + _WALIGN_(In1P->property_nameCnt)))
10348 return MIG_BAD_ARGUMENTS;
10349#endif /* __MigTypeCheck */
10350
10351 *In2PP = In2P = (__Request *) ((pointer_t) In1P + msgh_size_delta - 128);
10352
10353#if __MigTypeCheck
10354 {
10355 char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
10356#if __MigKernelSpecificCode
10357 size_t strnlen_limit;
10358#else
10359 size_t memchr_limit;
10360#endif /* __MigKernelSpecificCode */
10361
10362#if __MigKernelSpecificCode
10363 strnlen_limit = min((msg_limit - In0P->plane), 128);
10364 if (( strnlen(In0P->plane, strnlen_limit) >= 128 + 1 ))
10365 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
10366#else
10367 memchr_limit = min((msg_limit - In0P->plane), 128);
10368 if (( memchr(In0P->plane, '\0', memchr_limit) == NULL ))
10369 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
10370#endif /* __MigKernelSpecificCode */
10371#if __MigKernelSpecificCode
10372 strnlen_limit = min((msg_limit - In1P->property_name), 128);
10373 if (( strnlen(In1P->property_name, strnlen_limit) >= 128 + 1 ))
10374 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
10375#else
10376 memchr_limit = min((msg_limit - In1P->property_name), 128);
10377 if (( memchr(In1P->property_name, '\0', memchr_limit) == NULL ))
10378 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
10379#endif /* __MigKernelSpecificCode */
10380 }
10381#endif /* __MigTypeCheck */
10382
10383 return MACH_MSG_SUCCESS;
10384}
10385#endif /* !defined(__MIG_check__Request__io_registry_entry_get_property_bin_t__defined) */
10386#endif /* __MIG_check__Request__iokit_subsystem__ */
10387#endif /* ( __MigTypeCheck ) */
10388
10389
10390/* Routine io_registry_entry_get_property_bin */
10391mig_internal novalue _Xio_registry_entry_get_property_bin
10392 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
10393{
10394
10395#ifdef __MigPackStructs
10396#pragma pack(4)
10397#endif
10398 typedef struct {
10399 mach_msg_header_t Head;
10400 NDR_record_t NDR;
10401 mach_msg_type_number_t planeOffset; /* MiG doesn't use it */
10402 mach_msg_type_number_t planeCnt;
10403 char plane[128];
10404 mach_msg_type_number_t property_nameOffset; /* MiG doesn't use it */
10405 mach_msg_type_number_t property_nameCnt;
10406 char property_name[128];
10407 uint32_t options;
10408 mach_msg_trailer_t trailer;
10409 } Request __attribute__((unused));
10410#ifdef __MigPackStructs
10411#pragma pack()
10412#endif
10413 typedef __Request__io_registry_entry_get_property_bin_t __Request;
10414 typedef __Reply__io_registry_entry_get_property_bin_t Reply __attribute__((unused));
10415
10416 /*
10417 * typedef struct {
10418 * mach_msg_header_t Head;
10419 * NDR_record_t NDR;
10420 * kern_return_t RetCode;
10421 * } mig_reply_error_t;
10422 */
10423
10424 Request *In0P = (Request *) InHeadP;
10425 Request *In1P;
10426 Request *In2P;
10427 Reply *OutP = (Reply *) OutHeadP;
10428#ifdef __MIG_check__Request__io_registry_entry_get_property_bin_t__defined
10429 kern_return_t check_result;
10430#endif /* __MIG_check__Request__io_registry_entry_get_property_bin_t__defined */
10431
10432#if __MigKernelSpecificCode
10433#if UseStaticTemplates
10434 const static mach_msg_ool_descriptor_t propertiesTemplate = {
10435 /* addr = */ (void *)0,
10436 /* size = */ 0,
10437 /* deal = */ FALSE,
10438 /* copy = */ MACH_MSG_PHYSICAL_COPY,
10439 /* pad2 = */ 0,
10440 /* type = */ MACH_MSG_OOL_DESCRIPTOR,
10441 };
10442#endif /* UseStaticTemplates */
10443
10444#else
10445#if UseStaticTemplates
10446 const static mach_msg_ool_descriptor_t propertiesTemplate = {
10447 /* addr = */ (void *)0,
10448 /* size = */ 0,
10449 /* deal = */ FALSE,
10450 /* copy = */ MACH_MSG_PHYSICAL_COPY,
10451 /* pad2 = */ 0,
10452 /* type = */ MACH_MSG_OOL_DESCRIPTOR,
10453 };
10454#endif /* UseStaticTemplates */
10455
10456#endif /* __MigKernelSpecificCode */
10457 kern_return_t RetCode;
10458 io_object_t registry_entry;
10459
10460 __DeclareRcvRpc(2879, "io_registry_entry_get_property_bin")
10461 __BeforeRcvRpc(2879, "io_registry_entry_get_property_bin")
10462
10463#if defined(__MIG_check__Request__io_registry_entry_get_property_bin_t__defined)
10464 check_result = __MIG_check__Request__io_registry_entry_get_property_bin_t((__Request *)In0P, (__Request **)&In1P, (__Request **)&In2P);
10465 if (check_result != MACH_MSG_SUCCESS)
10466 { MIG_RETURN_ERROR(OutP, check_result); }
10467#endif /* defined(__MIG_check__Request__io_registry_entry_get_property_bin_t__defined) */
10468
10469#if UseStaticTemplates
10470 OutP->properties = propertiesTemplate;
10471#else /* UseStaticTemplates */
10472 OutP->properties.deallocate = FALSE;
10473 OutP->properties.copy = MACH_MSG_PHYSICAL_COPY;
10474 OutP->properties.pad1 = 0;
10475 OutP->properties.type = MACH_MSG_OOL_DESCRIPTOR;
10476#if defined(KERNEL) && !defined(__LP64__)
10477 OutP->properties.pad_end = 0;
10478#endif
10479#endif /* UseStaticTemplates */
10480
10481
10482 registry_entry = iokit_lookup_object_port(In0P->Head.msgh_request_port);
10483
10484 RetCode = is_io_registry_entry_get_property_bin(registry_entry, In0P->plane, In1P->property_name, In2P->options, (io_buf_ptr_t *)&(OutP->properties.address), &OutP->propertiesCnt);
10485 iokit_remove_reference(registry_entry);
10486 if (RetCode != KERN_SUCCESS) {
10487 MIG_RETURN_ERROR(OutP, RetCode);
10488 }
10489#if __MigKernelSpecificCode
10490#endif /* __MigKernelSpecificCode */
10491 OutP->properties.size = OutP->propertiesCnt;
10492
10493
10494 OutP->NDR = NDR_record;
10495
10496
10497 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
10498 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
10499 OutP->msgh_body.msgh_descriptor_count = 1;
10500 __AfterRcvRpc(2879, "io_registry_entry_get_property_bin")
10501}
10502
10503#if ( __MigTypeCheck )
10504#if __MIG_check__Request__iokit_subsystem__
10505#if !defined(__MIG_check__Request__io_service_get_matching_service_bin_t__defined)
10506#define __MIG_check__Request__io_service_get_matching_service_bin_t__defined
10507
10508mig_internal kern_return_t __MIG_check__Request__io_service_get_matching_service_bin_t(__attribute__((__unused__)) __Request__io_service_get_matching_service_bin_t *In0P)
10509{
10510
10511 typedef __Request__io_service_get_matching_service_bin_t __Request;
10512#if __MigTypeCheck
10513 unsigned int msgh_size;
10514#endif /* __MigTypeCheck */
10515
10516#if __MigTypeCheck
10517 msgh_size = In0P->Head.msgh_size;
10518 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
10519 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 4096)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
10520 return MIG_BAD_ARGUMENTS;
10521#endif /* __MigTypeCheck */
10522
10523#if defined(__NDR_convert__int_rep__Request__io_service_get_matching_service_bin_t__matchingCnt__defined)
10524 if (In0P->NDR.int_rep != NDR_record.int_rep)
10525 __NDR_convert__int_rep__Request__io_service_get_matching_service_bin_t__matchingCnt(&In0P->matchingCnt, In0P->NDR.int_rep);
10526#endif /* __NDR_convert__int_rep__Request__io_service_get_matching_service_bin_t__matchingCnt__defined */
10527#if __MigTypeCheck
10528 if ( In0P->matchingCnt > 4096 )
10529 return MIG_BAD_ARGUMENTS;
10530 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 4096)) < In0P->matchingCnt) ||
10531 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 4096) + _WALIGN_(In0P->matchingCnt)))
10532 return MIG_BAD_ARGUMENTS;
10533#endif /* __MigTypeCheck */
10534
10535 return MACH_MSG_SUCCESS;
10536}
10537#endif /* !defined(__MIG_check__Request__io_service_get_matching_service_bin_t__defined) */
10538#endif /* __MIG_check__Request__iokit_subsystem__ */
10539#endif /* ( __MigTypeCheck ) */
10540
10541
10542/* Routine io_service_get_matching_service_bin */
10543mig_internal novalue _Xio_service_get_matching_service_bin
10544 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
10545{
10546
10547#ifdef __MigPackStructs
10548#pragma pack(4)
10549#endif
10550 typedef struct {
10551 mach_msg_header_t Head;
10552 NDR_record_t NDR;
10553 mach_msg_type_number_t matchingCnt;
10554 char matching[4096];
10555 mach_msg_trailer_t trailer;
10556 } Request __attribute__((unused));
10557#ifdef __MigPackStructs
10558#pragma pack()
10559#endif
10560 typedef __Request__io_service_get_matching_service_bin_t __Request;
10561 typedef __Reply__io_service_get_matching_service_bin_t Reply __attribute__((unused));
10562
10563 /*
10564 * typedef struct {
10565 * mach_msg_header_t Head;
10566 * NDR_record_t NDR;
10567 * kern_return_t RetCode;
10568 * } mig_reply_error_t;
10569 */
10570
10571 Request *In0P = (Request *) InHeadP;
10572 Reply *OutP = (Reply *) OutHeadP;
10573#ifdef __MIG_check__Request__io_service_get_matching_service_bin_t__defined
10574 kern_return_t check_result;
10575#endif /* __MIG_check__Request__io_service_get_matching_service_bin_t__defined */
10576
10577#if __MigKernelSpecificCode
10578#if UseStaticTemplates
10579 const static mach_msg_port_descriptor_t serviceTemplate = {
10580 /* name = */ MACH_PORT_NULL,
10581 /* pad1 = */ 0,
10582 /* pad2 = */ 0,
10583 /* disp = */ 17,
10584 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
10585 };
10586#endif /* UseStaticTemplates */
10587
10588#else
10589#if UseStaticTemplates
10590 const static mach_msg_port_descriptor_t serviceTemplate = {
10591 /* name = */ MACH_PORT_NULL,
10592 /* pad1 = */ 0,
10593 /* pad2 = */ 0,
10594 /* disp = */ 19,
10595 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
10596 };
10597#endif /* UseStaticTemplates */
10598
10599#endif /* __MigKernelSpecificCode */
10600 kern_return_t RetCode;
10601 io_object_t service;
10602
10603 __DeclareRcvRpc(2880, "io_service_get_matching_service_bin")
10604 __BeforeRcvRpc(2880, "io_service_get_matching_service_bin")
10605
10606#if defined(__MIG_check__Request__io_service_get_matching_service_bin_t__defined)
10607 check_result = __MIG_check__Request__io_service_get_matching_service_bin_t((__Request *)In0P);
10608 if (check_result != MACH_MSG_SUCCESS)
10609 { MIG_RETURN_ERROR(OutP, check_result); }
10610#endif /* defined(__MIG_check__Request__io_service_get_matching_service_bin_t__defined) */
10611
10612#if UseStaticTemplates
10613 OutP->service = serviceTemplate;
10614#else /* UseStaticTemplates */
10615#if __MigKernelSpecificCode
10616 OutP->service.disposition = 17;
10617#else
10618 OutP->service.disposition = 19;
10619#endif /* __MigKernelSpecificCode */
10620#if !(defined(KERNEL) && defined(__LP64__))
10621 OutP->service.pad1 = 0;
10622#endif
10623 OutP->service.pad2 = 0;
10624 OutP->service.type = MACH_MSG_PORT_DESCRIPTOR;
10625#if defined(KERNEL)
10626 OutP->service.pad_end = 0;
10627#endif
10628#endif /* UseStaticTemplates */
10629
10630
10631 RetCode = is_io_service_get_matching_service_bin(In0P->Head.msgh_request_port, In0P->matching, In0P->matchingCnt, &service);
10632 if (RetCode != KERN_SUCCESS) {
10633 MIG_RETURN_ERROR(OutP, RetCode);
10634 }
10635#if __MigKernelSpecificCode
10636#endif /* __MigKernelSpecificCode */
10637 OutP->service.name = (mach_port_t)iokit_make_object_port(service);
10638
10639
10640 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
10641 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
10642 OutP->msgh_body.msgh_descriptor_count = 1;
10643 __AfterRcvRpc(2880, "io_service_get_matching_service_bin")
10644}
10645
10646#if ( __MigTypeCheck )
10647#if __MIG_check__Request__iokit_subsystem__
10648#if !defined(__MIG_check__Request__io_service_get_matching_services_bin_t__defined)
10649#define __MIG_check__Request__io_service_get_matching_services_bin_t__defined
10650
10651mig_internal kern_return_t __MIG_check__Request__io_service_get_matching_services_bin_t(__attribute__((__unused__)) __Request__io_service_get_matching_services_bin_t *In0P)
10652{
10653
10654 typedef __Request__io_service_get_matching_services_bin_t __Request;
10655#if __MigTypeCheck
10656 unsigned int msgh_size;
10657#endif /* __MigTypeCheck */
10658
10659#if __MigTypeCheck
10660 msgh_size = In0P->Head.msgh_size;
10661 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
10662 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 4096)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
10663 return MIG_BAD_ARGUMENTS;
10664#endif /* __MigTypeCheck */
10665
10666#if defined(__NDR_convert__int_rep__Request__io_service_get_matching_services_bin_t__matchingCnt__defined)
10667 if (In0P->NDR.int_rep != NDR_record.int_rep)
10668 __NDR_convert__int_rep__Request__io_service_get_matching_services_bin_t__matchingCnt(&In0P->matchingCnt, In0P->NDR.int_rep);
10669#endif /* __NDR_convert__int_rep__Request__io_service_get_matching_services_bin_t__matchingCnt__defined */
10670#if __MigTypeCheck
10671 if ( In0P->matchingCnt > 4096 )
10672 return MIG_BAD_ARGUMENTS;
10673 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 4096)) < In0P->matchingCnt) ||
10674 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 4096) + _WALIGN_(In0P->matchingCnt)))
10675 return MIG_BAD_ARGUMENTS;
10676#endif /* __MigTypeCheck */
10677
10678 return MACH_MSG_SUCCESS;
10679}
10680#endif /* !defined(__MIG_check__Request__io_service_get_matching_services_bin_t__defined) */
10681#endif /* __MIG_check__Request__iokit_subsystem__ */
10682#endif /* ( __MigTypeCheck ) */
10683
10684
10685/* Routine io_service_get_matching_services_bin */
10686mig_internal novalue _Xio_service_get_matching_services_bin
10687 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
10688{
10689
10690#ifdef __MigPackStructs
10691#pragma pack(4)
10692#endif
10693 typedef struct {
10694 mach_msg_header_t Head;
10695 NDR_record_t NDR;
10696 mach_msg_type_number_t matchingCnt;
10697 char matching[4096];
10698 mach_msg_trailer_t trailer;
10699 } Request __attribute__((unused));
10700#ifdef __MigPackStructs
10701#pragma pack()
10702#endif
10703 typedef __Request__io_service_get_matching_services_bin_t __Request;
10704 typedef __Reply__io_service_get_matching_services_bin_t Reply __attribute__((unused));
10705
10706 /*
10707 * typedef struct {
10708 * mach_msg_header_t Head;
10709 * NDR_record_t NDR;
10710 * kern_return_t RetCode;
10711 * } mig_reply_error_t;
10712 */
10713
10714 Request *In0P = (Request *) InHeadP;
10715 Reply *OutP = (Reply *) OutHeadP;
10716#ifdef __MIG_check__Request__io_service_get_matching_services_bin_t__defined
10717 kern_return_t check_result;
10718#endif /* __MIG_check__Request__io_service_get_matching_services_bin_t__defined */
10719
10720#if __MigKernelSpecificCode
10721#if UseStaticTemplates
10722 const static mach_msg_port_descriptor_t existingTemplate = {
10723 /* name = */ MACH_PORT_NULL,
10724 /* pad1 = */ 0,
10725 /* pad2 = */ 0,
10726 /* disp = */ 17,
10727 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
10728 };
10729#endif /* UseStaticTemplates */
10730
10731#else
10732#if UseStaticTemplates
10733 const static mach_msg_port_descriptor_t existingTemplate = {
10734 /* name = */ MACH_PORT_NULL,
10735 /* pad1 = */ 0,
10736 /* pad2 = */ 0,
10737 /* disp = */ 19,
10738 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
10739 };
10740#endif /* UseStaticTemplates */
10741
10742#endif /* __MigKernelSpecificCode */
10743 kern_return_t RetCode;
10744 io_object_t existing;
10745
10746 __DeclareRcvRpc(2881, "io_service_get_matching_services_bin")
10747 __BeforeRcvRpc(2881, "io_service_get_matching_services_bin")
10748
10749#if defined(__MIG_check__Request__io_service_get_matching_services_bin_t__defined)
10750 check_result = __MIG_check__Request__io_service_get_matching_services_bin_t((__Request *)In0P);
10751 if (check_result != MACH_MSG_SUCCESS)
10752 { MIG_RETURN_ERROR(OutP, check_result); }
10753#endif /* defined(__MIG_check__Request__io_service_get_matching_services_bin_t__defined) */
10754
10755#if UseStaticTemplates
10756 OutP->existing = existingTemplate;
10757#else /* UseStaticTemplates */
10758#if __MigKernelSpecificCode
10759 OutP->existing.disposition = 17;
10760#else
10761 OutP->existing.disposition = 19;
10762#endif /* __MigKernelSpecificCode */
10763#if !(defined(KERNEL) && defined(__LP64__))
10764 OutP->existing.pad1 = 0;
10765#endif
10766 OutP->existing.pad2 = 0;
10767 OutP->existing.type = MACH_MSG_PORT_DESCRIPTOR;
10768#if defined(KERNEL)
10769 OutP->existing.pad_end = 0;
10770#endif
10771#endif /* UseStaticTemplates */
10772
10773
10774 RetCode = is_io_service_get_matching_services_bin(In0P->Head.msgh_request_port, In0P->matching, In0P->matchingCnt, &existing);
10775 if (RetCode != KERN_SUCCESS) {
10776 MIG_RETURN_ERROR(OutP, RetCode);
10777 }
10778#if __MigKernelSpecificCode
10779#endif /* __MigKernelSpecificCode */
10780 OutP->existing.name = (mach_port_t)iokit_make_object_port(existing);
10781
10782
10783 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
10784 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
10785 OutP->msgh_body.msgh_descriptor_count = 1;
10786 __AfterRcvRpc(2881, "io_service_get_matching_services_bin")
10787}
10788
10789#if ( __MigTypeCheck )
10790#if __MIG_check__Request__iokit_subsystem__
10791#if !defined(__MIG_check__Request__io_service_match_property_table_bin_t__defined)
10792#define __MIG_check__Request__io_service_match_property_table_bin_t__defined
10793
10794mig_internal kern_return_t __MIG_check__Request__io_service_match_property_table_bin_t(__attribute__((__unused__)) __Request__io_service_match_property_table_bin_t *In0P)
10795{
10796
10797 typedef __Request__io_service_match_property_table_bin_t __Request;
10798#if __MigTypeCheck
10799 unsigned int msgh_size;
10800#endif /* __MigTypeCheck */
10801
10802#if __MigTypeCheck
10803 msgh_size = In0P->Head.msgh_size;
10804 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
10805 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 4096)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
10806 return MIG_BAD_ARGUMENTS;
10807#endif /* __MigTypeCheck */
10808
10809#if defined(__NDR_convert__int_rep__Request__io_service_match_property_table_bin_t__matchingCnt__defined)
10810 if (In0P->NDR.int_rep != NDR_record.int_rep)
10811 __NDR_convert__int_rep__Request__io_service_match_property_table_bin_t__matchingCnt(&In0P->matchingCnt, In0P->NDR.int_rep);
10812#endif /* __NDR_convert__int_rep__Request__io_service_match_property_table_bin_t__matchingCnt__defined */
10813#if __MigTypeCheck
10814 if ( In0P->matchingCnt > 4096 )
10815 return MIG_BAD_ARGUMENTS;
10816 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 4096)) < In0P->matchingCnt) ||
10817 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 4096) + _WALIGN_(In0P->matchingCnt)))
10818 return MIG_BAD_ARGUMENTS;
10819#endif /* __MigTypeCheck */
10820
10821 return MACH_MSG_SUCCESS;
10822}
10823#endif /* !defined(__MIG_check__Request__io_service_match_property_table_bin_t__defined) */
10824#endif /* __MIG_check__Request__iokit_subsystem__ */
10825#endif /* ( __MigTypeCheck ) */
10826
10827
10828/* Routine io_service_match_property_table_bin */
10829mig_internal novalue _Xio_service_match_property_table_bin
10830 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
10831{
10832
10833#ifdef __MigPackStructs
10834#pragma pack(4)
10835#endif
10836 typedef struct {
10837 mach_msg_header_t Head;
10838 NDR_record_t NDR;
10839 mach_msg_type_number_t matchingCnt;
10840 char matching[4096];
10841 mach_msg_trailer_t trailer;
10842 } Request __attribute__((unused));
10843#ifdef __MigPackStructs
10844#pragma pack()
10845#endif
10846 typedef __Request__io_service_match_property_table_bin_t __Request;
10847 typedef __Reply__io_service_match_property_table_bin_t Reply __attribute__((unused));
10848
10849 /*
10850 * typedef struct {
10851 * mach_msg_header_t Head;
10852 * NDR_record_t NDR;
10853 * kern_return_t RetCode;
10854 * } mig_reply_error_t;
10855 */
10856
10857 Request *In0P = (Request *) InHeadP;
10858 Reply *OutP = (Reply *) OutHeadP;
10859#ifdef __MIG_check__Request__io_service_match_property_table_bin_t__defined
10860 kern_return_t check_result;
10861#endif /* __MIG_check__Request__io_service_match_property_table_bin_t__defined */
10862
10863#if __MigKernelSpecificCode
10864#else
10865#endif /* __MigKernelSpecificCode */
10866 io_object_t service;
10867
10868 __DeclareRcvRpc(2882, "io_service_match_property_table_bin")
10869 __BeforeRcvRpc(2882, "io_service_match_property_table_bin")
10870
10871#if defined(__MIG_check__Request__io_service_match_property_table_bin_t__defined)
10872 check_result = __MIG_check__Request__io_service_match_property_table_bin_t((__Request *)In0P);
10873 if (check_result != MACH_MSG_SUCCESS)
10874 { MIG_RETURN_ERROR(OutP, check_result); }
10875#endif /* defined(__MIG_check__Request__io_service_match_property_table_bin_t__defined) */
10876
10877 service = iokit_lookup_object_port(In0P->Head.msgh_request_port);
10878
10879 OutP->RetCode = is_io_service_match_property_table_bin(service, In0P->matching, In0P->matchingCnt, &OutP->matches);
10880 iokit_remove_reference(service);
10881 if (OutP->RetCode != KERN_SUCCESS) {
10882 MIG_RETURN_ERROR(OutP, OutP->RetCode);
10883 }
10884#if __MigKernelSpecificCode
10885#endif /* __MigKernelSpecificCode */
10886
10887 OutP->NDR = NDR_record;
10888
10889
10890 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
10891 __AfterRcvRpc(2882, "io_service_match_property_table_bin")
10892}
10893
10894#if ( __MigTypeCheck )
10895#if __MIG_check__Request__iokit_subsystem__
10896#if !defined(__MIG_check__Request__io_service_add_notification_bin_t__defined)
10897#define __MIG_check__Request__io_service_add_notification_bin_t__defined
10898
10899mig_internal kern_return_t __MIG_check__Request__io_service_add_notification_bin_t(__attribute__((__unused__)) __Request__io_service_add_notification_bin_t *In0P, __attribute__((__unused__)) __Request__io_service_add_notification_bin_t **In1PP, __attribute__((__unused__)) __Request__io_service_add_notification_bin_t **In2PP)
10900{
10901
10902 typedef __Request__io_service_add_notification_bin_t __Request;
10903 __Request *In1P;
10904 __Request *In2P;
10905#if __MigTypeCheck
10906 unsigned int msgh_size;
10907#endif /* __MigTypeCheck */
10908 unsigned int msgh_size_delta;
10909
10910#if __MigTypeCheck
10911 msgh_size = In0P->Head.msgh_size;
10912 if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
10913 (In0P->msgh_body.msgh_descriptor_count != 1) ||
10914 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 4256)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
10915 return MIG_BAD_ARGUMENTS;
10916#endif /* __MigTypeCheck */
10917
10918#if __MigTypeCheck
10919 if (In0P->wake_port.type != MACH_MSG_PORT_DESCRIPTOR ||
10920 In0P->wake_port.disposition != 17)
10921 return MIG_TYPE_ERROR;
10922#endif /* __MigTypeCheck */
10923
10924#if defined(__NDR_convert__int_rep__Request__io_service_add_notification_bin_t__notification_typeCnt__defined)
10925 if (In0P->NDR.int_rep != NDR_record.int_rep)
10926 __NDR_convert__int_rep__Request__io_service_add_notification_bin_t__notification_typeCnt(&In0P->notification_typeCnt, In0P->NDR.int_rep);
10927#endif /* __NDR_convert__int_rep__Request__io_service_add_notification_bin_t__notification_typeCnt__defined */
10928 msgh_size_delta = _WALIGN_(In0P->notification_typeCnt);
10929#if __MigTypeCheck
10930 if ( In0P->notification_typeCnt > 128 )
10931 return MIG_BAD_ARGUMENTS;
10932 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 4256)) < In0P->notification_typeCnt) ||
10933 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 4256) + _WALIGN_(In0P->notification_typeCnt)))
10934 return MIG_BAD_ARGUMENTS;
10935 msgh_size -= msgh_size_delta;
10936#endif /* __MigTypeCheck */
10937
10938 *In1PP = In1P = (__Request *) ((pointer_t) In0P + msgh_size_delta - 128);
10939
10940#if defined(__NDR_convert__int_rep__Request__io_service_add_notification_bin_t__matchingCnt__defined)
10941 if (In0P->NDR.int_rep != NDR_record.int_rep)
10942 __NDR_convert__int_rep__Request__io_service_add_notification_bin_t__matchingCnt(&In1P->matchingCnt, In1P->NDR.int_rep);
10943#endif /* __NDR_convert__int_rep__Request__io_service_add_notification_bin_t__matchingCnt__defined */
10944 msgh_size_delta = _WALIGN_(In1P->matchingCnt);
10945#if __MigTypeCheck
10946 if ( In1P->matchingCnt > 4096 )
10947 return MIG_BAD_ARGUMENTS;
10948 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 4256)) < In1P->matchingCnt) ||
10949 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 4256) + _WALIGN_(In1P->matchingCnt)))
10950 return MIG_BAD_ARGUMENTS;
10951 msgh_size -= msgh_size_delta;
10952#endif /* __MigTypeCheck */
10953
10954 *In2PP = In2P = (__Request *) ((pointer_t) In1P + msgh_size_delta - 4096);
10955
10956#if defined(__NDR_convert__int_rep__Request__io_service_add_notification_bin_t__referenceCnt__defined)
10957 if (In0P->NDR.int_rep != NDR_record.int_rep)
10958 __NDR_convert__int_rep__Request__io_service_add_notification_bin_t__referenceCnt(&In2P->referenceCnt, In2P->NDR.int_rep);
10959#endif /* __NDR_convert__int_rep__Request__io_service_add_notification_bin_t__referenceCnt__defined */
10960#if __MigTypeCheck
10961 if ( In2P->referenceCnt > 8 )
10962 return MIG_BAD_ARGUMENTS;
10963 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 4256)) / 4 < In2P->referenceCnt) ||
10964 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 4256) + (4 * In2P->referenceCnt)))
10965 return MIG_BAD_ARGUMENTS;
10966#endif /* __MigTypeCheck */
10967
10968#if __MigTypeCheck
10969 {
10970 char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
10971#if __MigKernelSpecificCode
10972 size_t strnlen_limit;
10973#else
10974 size_t memchr_limit;
10975#endif /* __MigKernelSpecificCode */
10976
10977#if __MigKernelSpecificCode
10978 strnlen_limit = min((msg_limit - In0P->notification_type), 128);
10979 if (( strnlen(In0P->notification_type, strnlen_limit) >= 128 + 1 ))
10980 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
10981#else
10982 memchr_limit = min((msg_limit - In0P->notification_type), 128);
10983 if (( memchr(In0P->notification_type, '\0', memchr_limit) == NULL ))
10984 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
10985#endif /* __MigKernelSpecificCode */
10986 }
10987#endif /* __MigTypeCheck */
10988
10989 return MACH_MSG_SUCCESS;
10990}
10991#endif /* !defined(__MIG_check__Request__io_service_add_notification_bin_t__defined) */
10992#endif /* __MIG_check__Request__iokit_subsystem__ */
10993#endif /* ( __MigTypeCheck ) */
10994
10995
10996/* Routine io_service_add_notification_bin */
10997mig_internal novalue _Xio_service_add_notification_bin
10998 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
10999{
11000
11001#ifdef __MigPackStructs
11002#pragma pack(4)
11003#endif
11004 typedef struct {
11005 mach_msg_header_t Head;
11006 /* start of the kernel processed data */
11007 mach_msg_body_t msgh_body;
11008 mach_msg_port_descriptor_t wake_port;
11009 /* end of the kernel processed data */
11010 NDR_record_t NDR;
11011 mach_msg_type_number_t notification_typeOffset; /* MiG doesn't use it */
11012 mach_msg_type_number_t notification_typeCnt;
11013 char notification_type[128];
11014 mach_msg_type_number_t matchingCnt;
11015 char matching[4096];
11016 mach_msg_type_number_t referenceCnt;
11017 natural_t reference[8];
11018 mach_msg_trailer_t trailer;
11019 } Request __attribute__((unused));
11020#ifdef __MigPackStructs
11021#pragma pack()
11022#endif
11023 typedef __Request__io_service_add_notification_bin_t __Request;
11024 typedef __Reply__io_service_add_notification_bin_t Reply __attribute__((unused));
11025
11026 /*
11027 * typedef struct {
11028 * mach_msg_header_t Head;
11029 * NDR_record_t NDR;
11030 * kern_return_t RetCode;
11031 * } mig_reply_error_t;
11032 */
11033
11034 Request *In0P = (Request *) InHeadP;
11035 Request *In1P;
11036 Request *In2P;
11037 Reply *OutP = (Reply *) OutHeadP;
11038#ifdef __MIG_check__Request__io_service_add_notification_bin_t__defined
11039 kern_return_t check_result;
11040#endif /* __MIG_check__Request__io_service_add_notification_bin_t__defined */
11041
11042#if __MigKernelSpecificCode
11043#if UseStaticTemplates
11044 const static mach_msg_port_descriptor_t notificationTemplate = {
11045 /* name = */ MACH_PORT_NULL,
11046 /* pad1 = */ 0,
11047 /* pad2 = */ 0,
11048 /* disp = */ 17,
11049 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
11050 };
11051#endif /* UseStaticTemplates */
11052
11053#else
11054#if UseStaticTemplates
11055 const static mach_msg_port_descriptor_t notificationTemplate = {
11056 /* name = */ MACH_PORT_NULL,
11057 /* pad1 = */ 0,
11058 /* pad2 = */ 0,
11059 /* disp = */ 19,
11060 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
11061 };
11062#endif /* UseStaticTemplates */
11063
11064#endif /* __MigKernelSpecificCode */
11065 kern_return_t RetCode;
11066 io_object_t notification;
11067
11068 __DeclareRcvRpc(2883, "io_service_add_notification_bin")
11069 __BeforeRcvRpc(2883, "io_service_add_notification_bin")
11070
11071#if defined(__MIG_check__Request__io_service_add_notification_bin_t__defined)
11072 check_result = __MIG_check__Request__io_service_add_notification_bin_t((__Request *)In0P, (__Request **)&In1P, (__Request **)&In2P);
11073 if (check_result != MACH_MSG_SUCCESS)
11074 { MIG_RETURN_ERROR(OutP, check_result); }
11075#endif /* defined(__MIG_check__Request__io_service_add_notification_bin_t__defined) */
11076
11077#if UseStaticTemplates
11078 OutP->notification = notificationTemplate;
11079#else /* UseStaticTemplates */
11080#if __MigKernelSpecificCode
11081 OutP->notification.disposition = 17;
11082#else
11083 OutP->notification.disposition = 19;
11084#endif /* __MigKernelSpecificCode */
11085#if !(defined(KERNEL) && defined(__LP64__))
11086 OutP->notification.pad1 = 0;
11087#endif
11088 OutP->notification.pad2 = 0;
11089 OutP->notification.type = MACH_MSG_PORT_DESCRIPTOR;
11090#if defined(KERNEL)
11091 OutP->notification.pad_end = 0;
11092#endif
11093#endif /* UseStaticTemplates */
11094
11095
11096 RetCode = is_io_service_add_notification_bin(In0P->Head.msgh_request_port, In0P->notification_type, In1P->matching, In1P->matchingCnt, In0P->wake_port.name, In2P->reference, In2P->referenceCnt, &notification);
11097 if (RetCode != KERN_SUCCESS) {
11098 MIG_RETURN_ERROR(OutP, RetCode);
11099 }
11100#if __MigKernelSpecificCode
11101#endif /* __MigKernelSpecificCode */
11102 OutP->notification.name = (mach_port_t)iokit_make_object_port(notification);
11103
11104
11105 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
11106 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
11107 OutP->msgh_body.msgh_descriptor_count = 1;
11108 __AfterRcvRpc(2883, "io_service_add_notification_bin")
11109}
11110
11111#if ( __MigTypeCheck )
11112#if __MIG_check__Request__iokit_subsystem__
11113#if !defined(__MIG_check__Request__io_service_add_notification_bin_64_t__defined)
11114#define __MIG_check__Request__io_service_add_notification_bin_64_t__defined
11115
11116mig_internal kern_return_t __MIG_check__Request__io_service_add_notification_bin_64_t(__attribute__((__unused__)) __Request__io_service_add_notification_bin_64_t *In0P, __attribute__((__unused__)) __Request__io_service_add_notification_bin_64_t **In1PP, __attribute__((__unused__)) __Request__io_service_add_notification_bin_64_t **In2PP)
11117{
11118
11119 typedef __Request__io_service_add_notification_bin_64_t __Request;
11120 __Request *In1P;
11121 __Request *In2P;
11122#if __MigTypeCheck
11123 unsigned int msgh_size;
11124#endif /* __MigTypeCheck */
11125 unsigned int msgh_size_delta;
11126
11127#if __MigTypeCheck
11128 msgh_size = In0P->Head.msgh_size;
11129 if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
11130 (In0P->msgh_body.msgh_descriptor_count != 1) ||
11131 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 4288)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
11132 return MIG_BAD_ARGUMENTS;
11133#endif /* __MigTypeCheck */
11134
11135#if __MigTypeCheck
11136 if (In0P->wake_port.type != MACH_MSG_PORT_DESCRIPTOR ||
11137 In0P->wake_port.disposition != 17)
11138 return MIG_TYPE_ERROR;
11139#endif /* __MigTypeCheck */
11140
11141#if defined(__NDR_convert__int_rep__Request__io_service_add_notification_bin_64_t__notification_typeCnt__defined)
11142 if (In0P->NDR.int_rep != NDR_record.int_rep)
11143 __NDR_convert__int_rep__Request__io_service_add_notification_bin_64_t__notification_typeCnt(&In0P->notification_typeCnt, In0P->NDR.int_rep);
11144#endif /* __NDR_convert__int_rep__Request__io_service_add_notification_bin_64_t__notification_typeCnt__defined */
11145 msgh_size_delta = _WALIGN_(In0P->notification_typeCnt);
11146#if __MigTypeCheck
11147 if ( In0P->notification_typeCnt > 128 )
11148 return MIG_BAD_ARGUMENTS;
11149 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 4288)) < In0P->notification_typeCnt) ||
11150 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 4288) + _WALIGN_(In0P->notification_typeCnt)))
11151 return MIG_BAD_ARGUMENTS;
11152 msgh_size -= msgh_size_delta;
11153#endif /* __MigTypeCheck */
11154
11155 *In1PP = In1P = (__Request *) ((pointer_t) In0P + msgh_size_delta - 128);
11156
11157#if defined(__NDR_convert__int_rep__Request__io_service_add_notification_bin_64_t__matchingCnt__defined)
11158 if (In0P->NDR.int_rep != NDR_record.int_rep)
11159 __NDR_convert__int_rep__Request__io_service_add_notification_bin_64_t__matchingCnt(&In1P->matchingCnt, In1P->NDR.int_rep);
11160#endif /* __NDR_convert__int_rep__Request__io_service_add_notification_bin_64_t__matchingCnt__defined */
11161 msgh_size_delta = _WALIGN_(In1P->matchingCnt);
11162#if __MigTypeCheck
11163 if ( In1P->matchingCnt > 4096 )
11164 return MIG_BAD_ARGUMENTS;
11165 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 4288)) < In1P->matchingCnt) ||
11166 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 4288) + _WALIGN_(In1P->matchingCnt)))
11167 return MIG_BAD_ARGUMENTS;
11168 msgh_size -= msgh_size_delta;
11169#endif /* __MigTypeCheck */
11170
11171 *In2PP = In2P = (__Request *) ((pointer_t) In1P + msgh_size_delta - 4096);
11172
11173#if defined(__NDR_convert__int_rep__Request__io_service_add_notification_bin_64_t__referenceCnt__defined)
11174 if (In0P->NDR.int_rep != NDR_record.int_rep)
11175 __NDR_convert__int_rep__Request__io_service_add_notification_bin_64_t__referenceCnt(&In2P->referenceCnt, In2P->NDR.int_rep);
11176#endif /* __NDR_convert__int_rep__Request__io_service_add_notification_bin_64_t__referenceCnt__defined */
11177#if __MigTypeCheck
11178 if ( In2P->referenceCnt > 8 )
11179 return MIG_BAD_ARGUMENTS;
11180 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 4288)) / 8 < In2P->referenceCnt) ||
11181 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 4288) + (8 * In2P->referenceCnt)))
11182 return MIG_BAD_ARGUMENTS;
11183#endif /* __MigTypeCheck */
11184
11185#if __MigTypeCheck
11186 {
11187 char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
11188#if __MigKernelSpecificCode
11189 size_t strnlen_limit;
11190#else
11191 size_t memchr_limit;
11192#endif /* __MigKernelSpecificCode */
11193
11194#if __MigKernelSpecificCode
11195 strnlen_limit = min((msg_limit - In0P->notification_type), 128);
11196 if (( strnlen(In0P->notification_type, strnlen_limit) >= 128 + 1 ))
11197 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
11198#else
11199 memchr_limit = min((msg_limit - In0P->notification_type), 128);
11200 if (( memchr(In0P->notification_type, '\0', memchr_limit) == NULL ))
11201 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
11202#endif /* __MigKernelSpecificCode */
11203 }
11204#endif /* __MigTypeCheck */
11205
11206 return MACH_MSG_SUCCESS;
11207}
11208#endif /* !defined(__MIG_check__Request__io_service_add_notification_bin_64_t__defined) */
11209#endif /* __MIG_check__Request__iokit_subsystem__ */
11210#endif /* ( __MigTypeCheck ) */
11211
11212
11213/* Routine io_service_add_notification_bin_64 */
11214mig_internal novalue _Xio_service_add_notification_bin_64
11215 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
11216{
11217
11218#ifdef __MigPackStructs
11219#pragma pack(4)
11220#endif
11221 typedef struct {
11222 mach_msg_header_t Head;
11223 /* start of the kernel processed data */
11224 mach_msg_body_t msgh_body;
11225 mach_msg_port_descriptor_t wake_port;
11226 /* end of the kernel processed data */
11227 NDR_record_t NDR;
11228 mach_msg_type_number_t notification_typeOffset; /* MiG doesn't use it */
11229 mach_msg_type_number_t notification_typeCnt;
11230 char notification_type[128];
11231 mach_msg_type_number_t matchingCnt;
11232 char matching[4096];
11233 mach_msg_type_number_t referenceCnt;
11234 io_user_reference_t reference[8];
11235 mach_msg_trailer_t trailer;
11236 } Request __attribute__((unused));
11237#ifdef __MigPackStructs
11238#pragma pack()
11239#endif
11240 typedef __Request__io_service_add_notification_bin_64_t __Request;
11241 typedef __Reply__io_service_add_notification_bin_64_t Reply __attribute__((unused));
11242
11243 /*
11244 * typedef struct {
11245 * mach_msg_header_t Head;
11246 * NDR_record_t NDR;
11247 * kern_return_t RetCode;
11248 * } mig_reply_error_t;
11249 */
11250
11251 Request *In0P = (Request *) InHeadP;
11252 Request *In1P;
11253 Request *In2P;
11254 Reply *OutP = (Reply *) OutHeadP;
11255#ifdef __MIG_check__Request__io_service_add_notification_bin_64_t__defined
11256 kern_return_t check_result;
11257#endif /* __MIG_check__Request__io_service_add_notification_bin_64_t__defined */
11258
11259#if __MigKernelSpecificCode
11260#if UseStaticTemplates
11261 const static mach_msg_port_descriptor_t notificationTemplate = {
11262 /* name = */ MACH_PORT_NULL,
11263 /* pad1 = */ 0,
11264 /* pad2 = */ 0,
11265 /* disp = */ 17,
11266 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
11267 };
11268#endif /* UseStaticTemplates */
11269
11270#else
11271#if UseStaticTemplates
11272 const static mach_msg_port_descriptor_t notificationTemplate = {
11273 /* name = */ MACH_PORT_NULL,
11274 /* pad1 = */ 0,
11275 /* pad2 = */ 0,
11276 /* disp = */ 19,
11277 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
11278 };
11279#endif /* UseStaticTemplates */
11280
11281#endif /* __MigKernelSpecificCode */
11282 kern_return_t RetCode;
11283 io_object_t notification;
11284
11285 __DeclareRcvRpc(2884, "io_service_add_notification_bin_64")
11286 __BeforeRcvRpc(2884, "io_service_add_notification_bin_64")
11287
11288#if defined(__MIG_check__Request__io_service_add_notification_bin_64_t__defined)
11289 check_result = __MIG_check__Request__io_service_add_notification_bin_64_t((__Request *)In0P, (__Request **)&In1P, (__Request **)&In2P);
11290 if (check_result != MACH_MSG_SUCCESS)
11291 { MIG_RETURN_ERROR(OutP, check_result); }
11292#endif /* defined(__MIG_check__Request__io_service_add_notification_bin_64_t__defined) */
11293
11294#if UseStaticTemplates
11295 OutP->notification = notificationTemplate;
11296#else /* UseStaticTemplates */
11297#if __MigKernelSpecificCode
11298 OutP->notification.disposition = 17;
11299#else
11300 OutP->notification.disposition = 19;
11301#endif /* __MigKernelSpecificCode */
11302#if !(defined(KERNEL) && defined(__LP64__))
11303 OutP->notification.pad1 = 0;
11304#endif
11305 OutP->notification.pad2 = 0;
11306 OutP->notification.type = MACH_MSG_PORT_DESCRIPTOR;
11307#if defined(KERNEL)
11308 OutP->notification.pad_end = 0;
11309#endif
11310#endif /* UseStaticTemplates */
11311
11312
11313 RetCode = is_io_service_add_notification_bin_64(In0P->Head.msgh_request_port, In0P->notification_type, In1P->matching, In1P->matchingCnt, In0P->wake_port.name, In2P->reference, In2P->referenceCnt, &notification);
11314 if (RetCode != KERN_SUCCESS) {
11315 MIG_RETURN_ERROR(OutP, RetCode);
11316 }
11317#if __MigKernelSpecificCode
11318#endif /* __MigKernelSpecificCode */
11319 OutP->notification.name = (mach_port_t)iokit_make_object_port(notification);
11320
11321
11322 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
11323 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
11324 OutP->msgh_body.msgh_descriptor_count = 1;
11325 __AfterRcvRpc(2884, "io_service_add_notification_bin_64")
11326}
11327
11328#if ( __MigTypeCheck )
11329#if __MIG_check__Request__iokit_subsystem__
11330#if !defined(__MIG_check__Request__io_registry_entry_get_path_ool_t__defined)
11331#define __MIG_check__Request__io_registry_entry_get_path_ool_t__defined
11332
11333mig_internal kern_return_t __MIG_check__Request__io_registry_entry_get_path_ool_t(__attribute__((__unused__)) __Request__io_registry_entry_get_path_ool_t *In0P)
11334{
11335
11336 typedef __Request__io_registry_entry_get_path_ool_t __Request;
11337#if __MigTypeCheck
11338 unsigned int msgh_size;
11339#endif /* __MigTypeCheck */
11340
11341#if __MigTypeCheck
11342 msgh_size = In0P->Head.msgh_size;
11343 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
11344 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 128)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
11345 return MIG_BAD_ARGUMENTS;
11346#endif /* __MigTypeCheck */
11347
11348#if defined(__NDR_convert__int_rep__Request__io_registry_entry_get_path_ool_t__planeCnt__defined)
11349 if (In0P->NDR.int_rep != NDR_record.int_rep)
11350 __NDR_convert__int_rep__Request__io_registry_entry_get_path_ool_t__planeCnt(&In0P->planeCnt, In0P->NDR.int_rep);
11351#endif /* __NDR_convert__int_rep__Request__io_registry_entry_get_path_ool_t__planeCnt__defined */
11352#if __MigTypeCheck
11353 if ( In0P->planeCnt > 128 )
11354 return MIG_BAD_ARGUMENTS;
11355 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 128)) < In0P->planeCnt) ||
11356 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 128) + _WALIGN_(In0P->planeCnt)))
11357 return MIG_BAD_ARGUMENTS;
11358#endif /* __MigTypeCheck */
11359
11360#if __MigTypeCheck
11361 {
11362 char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
11363#if __MigKernelSpecificCode
11364 size_t strnlen_limit;
11365#else
11366 size_t memchr_limit;
11367#endif /* __MigKernelSpecificCode */
11368
11369#if __MigKernelSpecificCode
11370 strnlen_limit = min((msg_limit - In0P->plane), 128);
11371 if (( strnlen(In0P->plane, strnlen_limit) >= 128 + 1 ))
11372 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
11373#else
11374 memchr_limit = min((msg_limit - In0P->plane), 128);
11375 if (( memchr(In0P->plane, '\0', memchr_limit) == NULL ))
11376 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
11377#endif /* __MigKernelSpecificCode */
11378 }
11379#endif /* __MigTypeCheck */
11380
11381 return MACH_MSG_SUCCESS;
11382}
11383#endif /* !defined(__MIG_check__Request__io_registry_entry_get_path_ool_t__defined) */
11384#endif /* __MIG_check__Request__iokit_subsystem__ */
11385#endif /* ( __MigTypeCheck ) */
11386
11387
11388/* Routine io_registry_entry_get_path_ool */
11389mig_internal novalue _Xio_registry_entry_get_path_ool
11390 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
11391{
11392
11393#ifdef __MigPackStructs
11394#pragma pack(4)
11395#endif
11396 typedef struct {
11397 mach_msg_header_t Head;
11398 NDR_record_t NDR;
11399 mach_msg_type_number_t planeOffset; /* MiG doesn't use it */
11400 mach_msg_type_number_t planeCnt;
11401 char plane[128];
11402 mach_msg_trailer_t trailer;
11403 } Request __attribute__((unused));
11404#ifdef __MigPackStructs
11405#pragma pack()
11406#endif
11407 typedef __Request__io_registry_entry_get_path_ool_t __Request;
11408 typedef __Reply__io_registry_entry_get_path_ool_t Reply __attribute__((unused));
11409
11410 /*
11411 * typedef struct {
11412 * mach_msg_header_t Head;
11413 * NDR_record_t NDR;
11414 * kern_return_t RetCode;
11415 * } mig_reply_error_t;
11416 */
11417
11418 Request *In0P = (Request *) InHeadP;
11419 Reply *OutP = (Reply *) OutHeadP;
11420 unsigned int msgh_size_delta;
11421
11422#ifdef __MIG_check__Request__io_registry_entry_get_path_ool_t__defined
11423 kern_return_t check_result;
11424#endif /* __MIG_check__Request__io_registry_entry_get_path_ool_t__defined */
11425
11426#if __MigKernelSpecificCode
11427#if UseStaticTemplates
11428 const static mach_msg_ool_descriptor_t path_oolTemplate = {
11429 /* addr = */ (void *)0,
11430 /* size = */ 0,
11431 /* deal = */ FALSE,
11432 /* copy = */ MACH_MSG_PHYSICAL_COPY,
11433 /* pad2 = */ 0,
11434 /* type = */ MACH_MSG_OOL_DESCRIPTOR,
11435 };
11436#endif /* UseStaticTemplates */
11437
11438#else
11439#if UseStaticTemplates
11440 const static mach_msg_ool_descriptor_t path_oolTemplate = {
11441 /* addr = */ (void *)0,
11442 /* size = */ 0,
11443 /* deal = */ FALSE,
11444 /* copy = */ MACH_MSG_PHYSICAL_COPY,
11445 /* pad2 = */ 0,
11446 /* type = */ MACH_MSG_OOL_DESCRIPTOR,
11447 };
11448#endif /* UseStaticTemplates */
11449
11450#endif /* __MigKernelSpecificCode */
11451 kern_return_t RetCode;
11452 io_object_t registry_entry;
11453 mach_msg_type_number_t path_oolCnt;
11454
11455 __DeclareRcvRpc(2885, "io_registry_entry_get_path_ool")
11456 __BeforeRcvRpc(2885, "io_registry_entry_get_path_ool")
11457
11458#if defined(__MIG_check__Request__io_registry_entry_get_path_ool_t__defined)
11459 check_result = __MIG_check__Request__io_registry_entry_get_path_ool_t((__Request *)In0P);
11460 if (check_result != MACH_MSG_SUCCESS)
11461 { MIG_RETURN_ERROR(OutP, check_result); }
11462#endif /* defined(__MIG_check__Request__io_registry_entry_get_path_ool_t__defined) */
11463
11464#if UseStaticTemplates
11465 OutP->path_ool = path_oolTemplate;
11466#else /* UseStaticTemplates */
11467 OutP->path_ool.deallocate = FALSE;
11468 OutP->path_ool.copy = MACH_MSG_PHYSICAL_COPY;
11469 OutP->path_ool.pad1 = 0;
11470 OutP->path_ool.type = MACH_MSG_OOL_DESCRIPTOR;
11471#if defined(KERNEL) && !defined(__LP64__)
11472 OutP->path_ool.pad_end = 0;
11473#endif
11474#endif /* UseStaticTemplates */
11475
11476
11477 registry_entry = iokit_lookup_object_port(In0P->Head.msgh_request_port);
11478
11479 RetCode = is_io_registry_entry_get_path_ool(registry_entry, In0P->plane, OutP->path, (io_buf_ptr_t *)&(OutP->path_ool.address), &path_oolCnt);
11480 iokit_remove_reference(registry_entry);
11481 if (RetCode != KERN_SUCCESS) {
11482 MIG_RETURN_ERROR(OutP, RetCode);
11483 }
11484#if __MigKernelSpecificCode
11485#endif /* __MigKernelSpecificCode */
11486 OutP->path_ool.size = path_oolCnt;
11487
11488
11489 OutP->NDR = NDR_record;
11490
11491#ifdef __LP64__
11492 {
11493 size_t strLength = strlen(OutP->path) + 1;
11494 if (strLength > 0xffffffff)
11495 MIG_RETURN_ERROR(OutP, MIG_BAD_ARGUMENTS);
11496 OutP->pathCnt = (mach_msg_type_number_t) strLength;
11497 }
11498#else
11499 OutP->pathCnt = (mach_msg_type_number_t) strlen(OutP->path) + 1;
11500#endif /* __LP64__ */
11501 msgh_size_delta = _WALIGN_((OutP->pathCnt + 3) & ~3);
11502 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 4096) + msgh_size_delta;
11503 OutP = (Reply *) ((pointer_t) OutP + msgh_size_delta - 4096);
11504 OutP->path_oolCnt = path_oolCnt;
11505
11506 OutP = (Reply *) OutHeadP;
11507 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
11508 OutP->msgh_body.msgh_descriptor_count = 1;
11509 __AfterRcvRpc(2885, "io_registry_entry_get_path_ool")
11510}
11511
11512#if ( __MigTypeCheck )
11513#if __MIG_check__Request__iokit_subsystem__
11514#if !defined(__MIG_check__Request__io_registry_entry_from_path_ool_t__defined)
11515#define __MIG_check__Request__io_registry_entry_from_path_ool_t__defined
11516
11517mig_internal kern_return_t __MIG_check__Request__io_registry_entry_from_path_ool_t(__attribute__((__unused__)) __Request__io_registry_entry_from_path_ool_t *In0P, __attribute__((__unused__)) __Request__io_registry_entry_from_path_ool_t **In1PP)
11518{
11519
11520 typedef __Request__io_registry_entry_from_path_ool_t __Request;
11521 __Request *In1P;
11522#if __MigTypeCheck
11523 unsigned int msgh_size;
11524#endif /* __MigTypeCheck */
11525 unsigned int msgh_size_delta;
11526
11527#if __MigTypeCheck
11528 msgh_size = In0P->Head.msgh_size;
11529 if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
11530 (In0P->msgh_body.msgh_descriptor_count != 1) ||
11531 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 4096)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
11532 return MIG_BAD_ARGUMENTS;
11533#endif /* __MigTypeCheck */
11534
11535#if __MigTypeCheck
11536 if (In0P->path_ool.type != MACH_MSG_OOL_DESCRIPTOR)
11537 return MIG_TYPE_ERROR;
11538#endif /* __MigTypeCheck */
11539
11540#if defined(__NDR_convert__int_rep__Request__io_registry_entry_from_path_ool_t__pathCnt__defined)
11541 if (In0P->NDR.int_rep != NDR_record.int_rep)
11542 __NDR_convert__int_rep__Request__io_registry_entry_from_path_ool_t__pathCnt(&In0P->pathCnt, In0P->NDR.int_rep);
11543#endif /* __NDR_convert__int_rep__Request__io_registry_entry_from_path_ool_t__pathCnt__defined */
11544 msgh_size_delta = _WALIGN_(In0P->pathCnt);
11545#if __MigTypeCheck
11546 if ( In0P->pathCnt > 4096 )
11547 return MIG_BAD_ARGUMENTS;
11548 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 4096)) < In0P->pathCnt) ||
11549 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 4096) + _WALIGN_(In0P->pathCnt)))
11550 return MIG_BAD_ARGUMENTS;
11551#endif /* __MigTypeCheck */
11552
11553 *In1PP = In1P = (__Request *) ((pointer_t) In0P + msgh_size_delta - 4096);
11554
11555#if __MigTypeCheck
11556 if (In0P->path_ool.size != In1P->path_oolCnt)
11557 return MIG_TYPE_ERROR;
11558#endif /* __MigTypeCheck */
11559
11560#if __MigTypeCheck
11561 {
11562 char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
11563#if __MigKernelSpecificCode
11564 size_t strnlen_limit;
11565#else
11566 size_t memchr_limit;
11567#endif /* __MigKernelSpecificCode */
11568
11569#if __MigKernelSpecificCode
11570 strnlen_limit = min((msg_limit - In0P->path), 4096);
11571 if (( strnlen(In0P->path, strnlen_limit) >= 4096 + 1 ))
11572 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
11573#else
11574 memchr_limit = min((msg_limit - In0P->path), 4096);
11575 if (( memchr(In0P->path, '\0', memchr_limit) == NULL ))
11576 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
11577#endif /* __MigKernelSpecificCode */
11578 }
11579#endif /* __MigTypeCheck */
11580
11581 return MACH_MSG_SUCCESS;
11582}
11583#endif /* !defined(__MIG_check__Request__io_registry_entry_from_path_ool_t__defined) */
11584#endif /* __MIG_check__Request__iokit_subsystem__ */
11585#endif /* ( __MigTypeCheck ) */
11586
11587
11588/* Routine io_registry_entry_from_path_ool */
11589mig_internal novalue _Xio_registry_entry_from_path_ool
11590 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
11591{
11592
11593#ifdef __MigPackStructs
11594#pragma pack(4)
11595#endif
11596 typedef struct {
11597 mach_msg_header_t Head;
11598 /* start of the kernel processed data */
11599 mach_msg_body_t msgh_body;
11600 mach_msg_ool_descriptor_t path_ool;
11601 /* end of the kernel processed data */
11602 NDR_record_t NDR;
11603 mach_msg_type_number_t pathOffset; /* MiG doesn't use it */
11604 mach_msg_type_number_t pathCnt;
11605 char path[4096];
11606 mach_msg_type_number_t path_oolCnt;
11607 mach_msg_trailer_t trailer;
11608 } Request __attribute__((unused));
11609#ifdef __MigPackStructs
11610#pragma pack()
11611#endif
11612 typedef __Request__io_registry_entry_from_path_ool_t __Request;
11613 typedef __Reply__io_registry_entry_from_path_ool_t Reply __attribute__((unused));
11614
11615 /*
11616 * typedef struct {
11617 * mach_msg_header_t Head;
11618 * NDR_record_t NDR;
11619 * kern_return_t RetCode;
11620 * } mig_reply_error_t;
11621 */
11622
11623 Request *In0P = (Request *) InHeadP;
11624 Request *In1P;
11625 Reply *OutP = (Reply *) OutHeadP;
11626#ifdef __MIG_check__Request__io_registry_entry_from_path_ool_t__defined
11627 kern_return_t check_result;
11628#endif /* __MIG_check__Request__io_registry_entry_from_path_ool_t__defined */
11629
11630#if __MigKernelSpecificCode
11631#if UseStaticTemplates
11632 const static mach_msg_port_descriptor_t registry_entryTemplate = {
11633 /* name = */ MACH_PORT_NULL,
11634 /* pad1 = */ 0,
11635 /* pad2 = */ 0,
11636 /* disp = */ 17,
11637 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
11638 };
11639#endif /* UseStaticTemplates */
11640
11641#else
11642#if UseStaticTemplates
11643 const static mach_msg_port_descriptor_t registry_entryTemplate = {
11644 /* name = */ MACH_PORT_NULL,
11645 /* pad1 = */ 0,
11646 /* pad2 = */ 0,
11647 /* disp = */ 19,
11648 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
11649 };
11650#endif /* UseStaticTemplates */
11651
11652#endif /* __MigKernelSpecificCode */
11653 kern_return_t RetCode;
11654 io_object_t registry_entry;
11655
11656 __DeclareRcvRpc(2886, "io_registry_entry_from_path_ool")
11657 __BeforeRcvRpc(2886, "io_registry_entry_from_path_ool")
11658
11659#if defined(__MIG_check__Request__io_registry_entry_from_path_ool_t__defined)
11660 check_result = __MIG_check__Request__io_registry_entry_from_path_ool_t((__Request *)In0P, (__Request **)&In1P);
11661 if (check_result != MACH_MSG_SUCCESS)
11662 { MIG_RETURN_ERROR(OutP, check_result); }
11663#endif /* defined(__MIG_check__Request__io_registry_entry_from_path_ool_t__defined) */
11664
11665#if UseStaticTemplates
11666 OutP->registry_entry = registry_entryTemplate;
11667#else /* UseStaticTemplates */
11668#if __MigKernelSpecificCode
11669 OutP->registry_entry.disposition = 17;
11670#else
11671 OutP->registry_entry.disposition = 19;
11672#endif /* __MigKernelSpecificCode */
11673#if !(defined(KERNEL) && defined(__LP64__))
11674 OutP->registry_entry.pad1 = 0;
11675#endif
11676 OutP->registry_entry.pad2 = 0;
11677 OutP->registry_entry.type = MACH_MSG_PORT_DESCRIPTOR;
11678#if defined(KERNEL)
11679 OutP->registry_entry.pad_end = 0;
11680#endif
11681#endif /* UseStaticTemplates */
11682
11683
11684 RetCode = is_io_registry_entry_from_path_ool(In0P->Head.msgh_request_port, In0P->path, (io_buf_ptr_t)(In0P->path_ool.address), In0P->path_ool.size, &OutP->result, &registry_entry);
11685 if (RetCode != KERN_SUCCESS) {
11686 MIG_RETURN_ERROR(OutP, RetCode);
11687 }
11688#if __MigKernelSpecificCode
11689#endif /* __MigKernelSpecificCode */
11690 OutP->registry_entry.name = (mach_port_t)iokit_make_object_port(registry_entry);
11691
11692
11693 OutP->NDR = NDR_record;
11694
11695
11696 OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
11697 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
11698 OutP->msgh_body.msgh_descriptor_count = 1;
11699 __AfterRcvRpc(2886, "io_registry_entry_from_path_ool")
11700}
11701
11702#if ( __MigTypeCheck )
11703#if __MIG_check__Request__iokit_subsystem__
11704#if !defined(__MIG_check__Request__io_device_tree_entry_exists_with_name_t__defined)
11705#define __MIG_check__Request__io_device_tree_entry_exists_with_name_t__defined
11706
11707mig_internal kern_return_t __MIG_check__Request__io_device_tree_entry_exists_with_name_t(__attribute__((__unused__)) __Request__io_device_tree_entry_exists_with_name_t *In0P)
11708{
11709
11710 typedef __Request__io_device_tree_entry_exists_with_name_t __Request;
11711#if __MigTypeCheck
11712 unsigned int msgh_size;
11713#endif /* __MigTypeCheck */
11714
11715#if __MigTypeCheck
11716 msgh_size = In0P->Head.msgh_size;
11717 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
11718 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 128)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
11719 return MIG_BAD_ARGUMENTS;
11720#endif /* __MigTypeCheck */
11721
11722#if defined(__NDR_convert__int_rep__Request__io_device_tree_entry_exists_with_name_t__nameCnt__defined)
11723 if (In0P->NDR.int_rep != NDR_record.int_rep)
11724 __NDR_convert__int_rep__Request__io_device_tree_entry_exists_with_name_t__nameCnt(&In0P->nameCnt, In0P->NDR.int_rep);
11725#endif /* __NDR_convert__int_rep__Request__io_device_tree_entry_exists_with_name_t__nameCnt__defined */
11726#if __MigTypeCheck
11727 if ( In0P->nameCnt > 128 )
11728 return MIG_BAD_ARGUMENTS;
11729 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 128)) < In0P->nameCnt) ||
11730 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 128) + _WALIGN_(In0P->nameCnt)))
11731 return MIG_BAD_ARGUMENTS;
11732#endif /* __MigTypeCheck */
11733
11734#if __MigTypeCheck
11735 {
11736 char * msg_limit = ((char *) In0P) + In0P->Head.msgh_size;
11737#if __MigKernelSpecificCode
11738 size_t strnlen_limit;
11739#else
11740 size_t memchr_limit;
11741#endif /* __MigKernelSpecificCode */
11742
11743#if __MigKernelSpecificCode
11744 strnlen_limit = min((msg_limit - In0P->name), 128);
11745 if (( strnlen(In0P->name, strnlen_limit) >= 128 + 1 ))
11746 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
11747#else
11748 memchr_limit = min((msg_limit - In0P->name), 128);
11749 if (( memchr(In0P->name, '\0', memchr_limit) == NULL ))
11750 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
11751#endif /* __MigKernelSpecificCode */
11752 }
11753#endif /* __MigTypeCheck */
11754
11755 return MACH_MSG_SUCCESS;
11756}
11757#endif /* !defined(__MIG_check__Request__io_device_tree_entry_exists_with_name_t__defined) */
11758#endif /* __MIG_check__Request__iokit_subsystem__ */
11759#endif /* ( __MigTypeCheck ) */
11760
11761
11762/* Routine io_device_tree_entry_exists_with_name */
11763mig_internal novalue _Xio_device_tree_entry_exists_with_name
11764 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
11765{
11766
11767#ifdef __MigPackStructs
11768#pragma pack(4)
11769#endif
11770 typedef struct {
11771 mach_msg_header_t Head;
11772 NDR_record_t NDR;
11773 mach_msg_type_number_t nameOffset; /* MiG doesn't use it */
11774 mach_msg_type_number_t nameCnt;
11775 char name[128];
11776 mach_msg_trailer_t trailer;
11777 } Request __attribute__((unused));
11778#ifdef __MigPackStructs
11779#pragma pack()
11780#endif
11781 typedef __Request__io_device_tree_entry_exists_with_name_t __Request;
11782 typedef __Reply__io_device_tree_entry_exists_with_name_t Reply __attribute__((unused));
11783
11784 /*
11785 * typedef struct {
11786 * mach_msg_header_t Head;
11787 * NDR_record_t NDR;
11788 * kern_return_t RetCode;
11789 * } mig_reply_error_t;
11790 */
11791
11792 Request *In0P = (Request *) InHeadP;
11793 Reply *OutP = (Reply *) OutHeadP;
11794#ifdef __MIG_check__Request__io_device_tree_entry_exists_with_name_t__defined
11795 kern_return_t check_result;
11796#endif /* __MIG_check__Request__io_device_tree_entry_exists_with_name_t__defined */
11797
11798#if __MigKernelSpecificCode
11799#else
11800#endif /* __MigKernelSpecificCode */
11801 __DeclareRcvRpc(2887, "io_device_tree_entry_exists_with_name")
11802 __BeforeRcvRpc(2887, "io_device_tree_entry_exists_with_name")
11803
11804#if defined(__MIG_check__Request__io_device_tree_entry_exists_with_name_t__defined)
11805 check_result = __MIG_check__Request__io_device_tree_entry_exists_with_name_t((__Request *)In0P);
11806 if (check_result != MACH_MSG_SUCCESS)
11807 { MIG_RETURN_ERROR(OutP, check_result); }
11808#endif /* defined(__MIG_check__Request__io_device_tree_entry_exists_with_name_t__defined) */
11809
11810 OutP->RetCode = is_io_device_tree_entry_exists_with_name(In0P->Head.msgh_request_port, In0P->name, &OutP->exists);
11811 if (OutP->RetCode != KERN_SUCCESS) {
11812 MIG_RETURN_ERROR(OutP, OutP->RetCode);
11813 }
11814#if __MigKernelSpecificCode
11815#endif /* __MigKernelSpecificCode */
11816
11817 OutP->NDR = NDR_record;
11818
11819
11820 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
11821 __AfterRcvRpc(2887, "io_device_tree_entry_exists_with_name")
11822}
11823
11824
11825
11826/* Description of this subsystem, for use in direct RPC */
11827const struct is_iokit_subsystem is_iokit_subsystem = {
11828 iokit_server_routine,
11829 2800,
11830 2888,
11831 (mach_msg_size_t)sizeof(union __ReplyUnion__is_iokit_subsystem),
11832 (vm_address_t)0,
11833 {
11834 { (mig_impl_routine_t) 0,
11835 (mig_stub_routine_t) _Xio_object_get_class, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_object_get_class_t)},
11836 { (mig_impl_routine_t) 0,
11837 (mig_stub_routine_t) _Xio_object_conforms_to, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_object_conforms_to_t)},
11838 { (mig_impl_routine_t) 0,
11839 (mig_stub_routine_t) _Xio_iterator_next, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_iterator_next_t)},
11840 { (mig_impl_routine_t) 0,
11841 (mig_stub_routine_t) _Xio_iterator_reset, 1, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_iterator_reset_t)},
11842 { (mig_impl_routine_t) 0,
11843 (mig_stub_routine_t) _Xio_service_get_matching_services, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_service_get_matching_services_t)},
11844 { (mig_impl_routine_t) 0,
11845 (mig_stub_routine_t) _Xio_registry_entry_get_property, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_registry_entry_get_property_t)},
11846 { (mig_impl_routine_t) 0,
11847 (mig_stub_routine_t) _Xio_registry_create_iterator, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_registry_create_iterator_t)},
11848 { (mig_impl_routine_t) 0,
11849 (mig_stub_routine_t) _Xio_registry_iterator_enter_entry, 1, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_registry_iterator_enter_entry_t)},
11850 { (mig_impl_routine_t) 0,
11851 (mig_stub_routine_t) _Xio_registry_iterator_exit_entry, 1, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_registry_iterator_exit_entry_t)},
11852 { (mig_impl_routine_t) 0,
11853 (mig_stub_routine_t) _Xio_registry_entry_from_path, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_registry_entry_from_path_t)},
11854 { (mig_impl_routine_t) 0,
11855 (mig_stub_routine_t) _Xio_registry_entry_get_name, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_registry_entry_get_name_t)},
11856 { (mig_impl_routine_t) 0,
11857 (mig_stub_routine_t) _Xio_registry_entry_get_properties, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_registry_entry_get_properties_t)},
11858 { (mig_impl_routine_t) 0,
11859 (mig_stub_routine_t) _Xio_registry_entry_get_property_bytes, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_registry_entry_get_property_bytes_t)},
11860 { (mig_impl_routine_t) 0,
11861 (mig_stub_routine_t) _Xio_registry_entry_get_child_iterator, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_registry_entry_get_child_iterator_t)},
11862 { (mig_impl_routine_t) 0,
11863 (mig_stub_routine_t) _Xio_registry_entry_get_parent_iterator, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_registry_entry_get_parent_iterator_t)},
11864 {0, 0, 0, 0, 0, 0},
11865 { (mig_impl_routine_t) 0,
11866 (mig_stub_routine_t) _Xio_service_close, 1, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_service_close_t)},
11867 { (mig_impl_routine_t) 0,
11868 (mig_stub_routine_t) _Xio_connect_get_service, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_connect_get_service_t)},
11869 { (mig_impl_routine_t) 0,
11870 (mig_stub_routine_t) _Xio_connect_set_notification_port, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_connect_set_notification_port_t)},
11871 { (mig_impl_routine_t) 0,
11872 (mig_stub_routine_t) _Xio_connect_map_memory, 6, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_connect_map_memory_t)},
11873 { (mig_impl_routine_t) 0,
11874 (mig_stub_routine_t) _Xio_connect_add_client, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_connect_add_client_t)},
11875 { (mig_impl_routine_t) 0,
11876 (mig_stub_routine_t) _Xio_connect_set_properties, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_connect_set_properties_t)},
11877 { (mig_impl_routine_t) 0,
11878 (mig_stub_routine_t) _Xio_connect_method_scalarI_scalarO, 6, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_connect_method_scalarI_scalarO_t)},
11879 { (mig_impl_routine_t) 0,
11880 (mig_stub_routine_t) _Xio_connect_method_scalarI_structureO, 6, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_connect_method_scalarI_structureO_t)},
11881 { (mig_impl_routine_t) 0,
11882 (mig_stub_routine_t) _Xio_connect_method_scalarI_structureI, 6, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_connect_method_scalarI_structureI_t)},
11883 { (mig_impl_routine_t) 0,
11884 (mig_stub_routine_t) _Xio_connect_method_structureI_structureO, 6, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_connect_method_structureI_structureO_t)},
11885 { (mig_impl_routine_t) 0,
11886 (mig_stub_routine_t) _Xio_registry_entry_get_path, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_registry_entry_get_path_t)},
11887 { (mig_impl_routine_t) 0,
11888 (mig_stub_routine_t) _Xio_registry_get_root_entry, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_registry_get_root_entry_t)},
11889 { (mig_impl_routine_t) 0,
11890 (mig_stub_routine_t) _Xio_registry_entry_set_properties, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_registry_entry_set_properties_t)},
11891 { (mig_impl_routine_t) 0,
11892 (mig_stub_routine_t) _Xio_registry_entry_in_plane, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_registry_entry_in_plane_t)},
11893 { (mig_impl_routine_t) 0,
11894 (mig_stub_routine_t) _Xio_object_get_retain_count, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_object_get_retain_count_t)},
11895 { (mig_impl_routine_t) 0,
11896 (mig_stub_routine_t) _Xio_service_get_busy_state, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_service_get_busy_state_t)},
11897 { (mig_impl_routine_t) 0,
11898 (mig_stub_routine_t) _Xio_service_wait_quiet, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_service_wait_quiet_t)},
11899 { (mig_impl_routine_t) 0,
11900 (mig_stub_routine_t) _Xio_registry_entry_create_iterator, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_registry_entry_create_iterator_t)},
11901 { (mig_impl_routine_t) 0,
11902 (mig_stub_routine_t) _Xio_iterator_is_valid, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_iterator_is_valid_t)},
11903 {0, 0, 0, 0, 0, 0},
11904 { (mig_impl_routine_t) 0,
11905 (mig_stub_routine_t) _Xio_catalog_send_data, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_catalog_send_data_t)},
11906 { (mig_impl_routine_t) 0,
11907 (mig_stub_routine_t) _Xio_catalog_terminate, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_catalog_terminate_t)},
11908 { (mig_impl_routine_t) 0,
11909 (mig_stub_routine_t) _Xio_catalog_get_data, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_catalog_get_data_t)},
11910 { (mig_impl_routine_t) 0,
11911 (mig_stub_routine_t) _Xio_catalog_get_gen_count, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_catalog_get_gen_count_t)},
11912 { (mig_impl_routine_t) 0,
11913 (mig_stub_routine_t) _Xio_catalog_module_loaded, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_catalog_module_loaded_t)},
11914 { (mig_impl_routine_t) 0,
11915 (mig_stub_routine_t) _Xio_catalog_reset, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_catalog_reset_t)},
11916 { (mig_impl_routine_t) 0,
11917 (mig_stub_routine_t) _Xio_service_request_probe, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_service_request_probe_t)},
11918 { (mig_impl_routine_t) 0,
11919 (mig_stub_routine_t) _Xio_registry_entry_get_name_in_plane, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_registry_entry_get_name_in_plane_t)},
11920 { (mig_impl_routine_t) 0,
11921 (mig_stub_routine_t) _Xio_service_match_property_table, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_service_match_property_table_t)},
11922 { (mig_impl_routine_t) 0,
11923 (mig_stub_routine_t) _Xio_async_method_scalarI_scalarO, 9, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_async_method_scalarI_scalarO_t)},
11924 { (mig_impl_routine_t) 0,
11925 (mig_stub_routine_t) _Xio_async_method_scalarI_structureO, 9, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_async_method_scalarI_structureO_t)},
11926 { (mig_impl_routine_t) 0,
11927 (mig_stub_routine_t) _Xio_async_method_scalarI_structureI, 9, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_async_method_scalarI_structureI_t)},
11928 { (mig_impl_routine_t) 0,
11929 (mig_stub_routine_t) _Xio_async_method_structureI_structureO, 9, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_async_method_structureI_structureO_t)},
11930 { (mig_impl_routine_t) 0,
11931 (mig_stub_routine_t) _Xio_service_add_notification, 7, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_service_add_notification_t)},
11932 { (mig_impl_routine_t) 0,
11933 (mig_stub_routine_t) _Xio_service_add_interest_notification, 6, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_service_add_interest_notification_t)},
11934 { (mig_impl_routine_t) 0,
11935 (mig_stub_routine_t) _Xio_service_acknowledge_notification, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_service_acknowledge_notification_t)},
11936 { (mig_impl_routine_t) 0,
11937 (mig_stub_routine_t) _Xio_connect_get_notification_semaphore, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_connect_get_notification_semaphore_t)},
11938 { (mig_impl_routine_t) 0,
11939 (mig_stub_routine_t) _Xio_connect_unmap_memory, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_connect_unmap_memory_t)},
11940 { (mig_impl_routine_t) 0,
11941 (mig_stub_routine_t) _Xio_registry_entry_get_location_in_plane, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_registry_entry_get_location_in_plane_t)},
11942 { (mig_impl_routine_t) 0,
11943 (mig_stub_routine_t) _Xio_registry_entry_get_property_recursively, 6, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_registry_entry_get_property_recursively_t)},
11944 { (mig_impl_routine_t) 0,
11945 (mig_stub_routine_t) _Xio_service_get_state, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_service_get_state_t)},
11946 { (mig_impl_routine_t) 0,
11947 (mig_stub_routine_t) _Xio_service_get_matching_services_ool, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_service_get_matching_services_ool_t)},
11948 { (mig_impl_routine_t) 0,
11949 (mig_stub_routine_t) _Xio_service_match_property_table_ool, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_service_match_property_table_ool_t)},
11950 { (mig_impl_routine_t) 0,
11951 (mig_stub_routine_t) _Xio_service_add_notification_ool, 9, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_service_add_notification_ool_t)},
11952 { (mig_impl_routine_t) 0,
11953 (mig_stub_routine_t) _Xio_object_get_superclass, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_object_get_superclass_t)},
11954 { (mig_impl_routine_t) 0,
11955 (mig_stub_routine_t) _Xio_object_get_bundle_identifier, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_object_get_bundle_identifier_t)},
11956 { (mig_impl_routine_t) 0,
11957 (mig_stub_routine_t) _Xio_service_open_extended, 8, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_service_open_extended_t)},
11958 { (mig_impl_routine_t) 0,
11959 (mig_stub_routine_t) _Xio_connect_map_memory_into_task, 6, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_connect_map_memory_into_task_t)},
11960 { (mig_impl_routine_t) 0,
11961 (mig_stub_routine_t) _Xio_connect_unmap_memory_from_task, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_connect_unmap_memory_from_task_t)},
11962 { (mig_impl_routine_t) 0,
11963 (mig_stub_routine_t) _Xio_connect_method, 17, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_connect_method_t)},
11964 { (mig_impl_routine_t) 0,
11965 (mig_stub_routine_t) _Xio_connect_async_method, 20, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_connect_async_method_t)},
11966 { (mig_impl_routine_t) 0,
11967 (mig_stub_routine_t) _Xio_connect_set_notification_port_64, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_connect_set_notification_port_64_t)},
11968 { (mig_impl_routine_t) 0,
11969 (mig_stub_routine_t) _Xio_service_add_notification_64, 7, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_service_add_notification_64_t)},
11970 { (mig_impl_routine_t) 0,
11971 (mig_stub_routine_t) _Xio_service_add_interest_notification_64, 6, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_service_add_interest_notification_64_t)},
11972 { (mig_impl_routine_t) 0,
11973 (mig_stub_routine_t) _Xio_service_add_notification_ool_64, 9, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_service_add_notification_ool_64_t)},
11974 { (mig_impl_routine_t) 0,
11975 (mig_stub_routine_t) _Xio_registry_entry_get_registry_entry_id, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_registry_entry_get_registry_entry_id_t)},
11976 { (mig_impl_routine_t) 0,
11977 (mig_stub_routine_t) _Xio_connect_method_var_output, 16, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_connect_method_var_output_t)},
11978 { (mig_impl_routine_t) 0,
11979 (mig_stub_routine_t) _Xio_service_get_matching_service, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_service_get_matching_service_t)},
11980 { (mig_impl_routine_t) 0,
11981 (mig_stub_routine_t) _Xio_service_get_matching_service_ool, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_service_get_matching_service_ool_t)},
11982 { (mig_impl_routine_t) 0,
11983 (mig_stub_routine_t) _Xio_service_get_authorization_id, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_service_get_authorization_id_t)},
11984 { (mig_impl_routine_t) 0,
11985 (mig_stub_routine_t) _Xio_service_set_authorization_id, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_service_set_authorization_id_t)},
11986 { (mig_impl_routine_t) 0,
11987 (mig_stub_routine_t) _Xio_server_version, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_server_version_t)},
11988 { (mig_impl_routine_t) 0,
11989 (mig_stub_routine_t) _Xio_registry_entry_get_properties_bin, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_registry_entry_get_properties_bin_t)},
11990 { (mig_impl_routine_t) 0,
11991 (mig_stub_routine_t) _Xio_registry_entry_get_property_bin, 6, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_registry_entry_get_property_bin_t)},
11992 { (mig_impl_routine_t) 0,
11993 (mig_stub_routine_t) _Xio_service_get_matching_service_bin, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_service_get_matching_service_bin_t)},
11994 { (mig_impl_routine_t) 0,
11995 (mig_stub_routine_t) _Xio_service_get_matching_services_bin, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_service_get_matching_services_bin_t)},
11996 { (mig_impl_routine_t) 0,
11997 (mig_stub_routine_t) _Xio_service_match_property_table_bin, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_service_match_property_table_bin_t)},
11998 { (mig_impl_routine_t) 0,
11999 (mig_stub_routine_t) _Xio_service_add_notification_bin, 8, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_service_add_notification_bin_t)},
12000 { (mig_impl_routine_t) 0,
12001 (mig_stub_routine_t) _Xio_service_add_notification_bin_64, 8, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_service_add_notification_bin_64_t)},
12002 { (mig_impl_routine_t) 0,
12003 (mig_stub_routine_t) _Xio_registry_entry_get_path_ool, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_registry_entry_get_path_ool_t)},
12004 { (mig_impl_routine_t) 0,
12005 (mig_stub_routine_t) _Xio_registry_entry_from_path_ool, 6, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_registry_entry_from_path_ool_t)},
12006 { (mig_impl_routine_t) 0,
12007 (mig_stub_routine_t) _Xio_device_tree_entry_exists_with_name, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__io_device_tree_entry_exists_with_name_t)},
12008 }
12009};
12010
12011mig_external boolean_t iokit_server
12012 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
12013{
12014 /*
12015 * typedef struct {
12016 * mach_msg_header_t Head;
12017 * NDR_record_t NDR;
12018 * kern_return_t RetCode;
12019 * } mig_reply_error_t;
12020 */
12021
12022 register mig_routine_t routine;
12023
12024 OutHeadP->msgh_bits = MACH_MSGH_BITS(MACH_MSGH_BITS_REPLY(InHeadP->msgh_bits), 0);
12025 OutHeadP->msgh_remote_port = InHeadP->msgh_reply_port;
12026 /* Minimal size: routine() will update it if different */
12027 OutHeadP->msgh_size = (mach_msg_size_t)sizeof(mig_reply_error_t);
12028 OutHeadP->msgh_local_port = MACH_PORT_NULL;
12029 OutHeadP->msgh_id = InHeadP->msgh_id + 100;
12030 OutHeadP->msgh_reserved = 0;
12031
12032 if ((InHeadP->msgh_id > 2887) || (InHeadP->msgh_id < 2800) ||
12033 ((routine = is_iokit_subsystem.routine[InHeadP->msgh_id - 2800].stub_routine) == 0)) {
12034 ((mig_reply_error_t *)OutHeadP)->NDR = NDR_record;
12035 ((mig_reply_error_t *)OutHeadP)->RetCode = MIG_BAD_ID;
12036 return FALSE;
12037 }
12038 (*routine) (InHeadP, OutHeadP);
12039 return TRUE;
12040}
12041
12042mig_external mig_routine_t iokit_server_routine
12043 (mach_msg_header_t *InHeadP)
12044{
12045 register int msgh_id;
12046
12047 msgh_id = InHeadP->msgh_id - 2800;
12048
12049 if ((msgh_id > 87) || (msgh_id < 0))
12050 return 0;
12051
12052 return is_iokit_subsystem.routine[msgh_id].stub_routine;
12053}
12054