1/*
2 * IDENTIFICATION:
3 * stub generated by bootstrap_cmds-133
4 * OPTIONS:
5 * KernelServer
6 */
7
8/* Module iokit */
9
10#define __MIG_check__Request__iokit_subsystem__ 1
11
12#include "device_server.h"
13
14#ifndef mig_internal
15#define mig_internal static __inline__
16#endif /* mig_internal */
17
18#ifndef mig_external
19#define mig_external
20#endif /* mig_external */
21
22#if !defined(__MigTypeCheck) && defined(TypeCheck)
23#define __MigTypeCheck TypeCheck /* Legacy setting */
24#endif /* !defined(__MigTypeCheck) */
25
26#if !defined(__MigKernelSpecificCode) && defined(_MIG_KERNEL_SPECIFIC_CODE_)
27#define __MigKernelSpecificCode _MIG_KERNEL_SPECIFIC_CODE_ /* Legacy setting */
28#endif /* !defined(__MigKernelSpecificCode) */
29
30#ifndef LimitCheck
31#define LimitCheck 0
32#endif /* LimitCheck */
33
34#ifndef min
35#define min(a,b) ( ((a) < (b))? (a): (b) )
36#endif /* min */
37
38#if !defined(_WALIGN_)
39#define _WALIGN_(x) (((x) + 3) & ~3)
40#endif /* !defined(_WALIGN_) */
41
42#if !defined(_WALIGNSZ_)
43#define _WALIGNSZ_(x) _WALIGN_(sizeof(x))
44#endif /* !defined(_WALIGNSZ_) */
45
46#ifndef UseStaticTemplates
47#define UseStaticTemplates 0
48#endif /* UseStaticTemplates */
49
50#ifndef MIG_SERVER_ROUTINE
51#define MIG_SERVER_ROUTINE
52#endif
53
54#ifndef __DeclareRcvRpc
55#define __DeclareRcvRpc(_NUM_, _NAME_)
56#endif /* __DeclareRcvRpc */
57
58#ifndef __BeforeRcvRpc
59#define __BeforeRcvRpc(_NUM_, _NAME_)
60#endif /* __BeforeRcvRpc */
61
62#ifndef __AfterRcvRpc
63#define __AfterRcvRpc(_NUM_, _NAME_)
64#endif /* __AfterRcvRpc */
65
66#ifndef __DeclareRcvSimple
67#define __DeclareRcvSimple(_NUM_, _NAME_)
68#endif /* __DeclareRcvSimple */
69
70#ifndef __BeforeRcvSimple
71#define __BeforeRcvSimple(_NUM_, _NAME_)
72#endif /* __BeforeRcvSimple */
73
74#ifndef __AfterRcvSimple
75#define __AfterRcvSimple(_NUM_, _NAME_)
76#endif /* __AfterRcvSimple */
77
78#define novalue void
79
80#if __MigKernelSpecificCode
81#define msgh_request_port msgh_remote_port
82#define MACH_MSGH_BITS_REQUEST(bits) MACH_MSGH_BITS_REMOTE(bits)
83#define msgh_reply_port msgh_local_port
84#define MACH_MSGH_BITS_REPLY(bits) MACH_MSGH_BITS_LOCAL(bits)
85#else
86#define msgh_request_port msgh_local_port
87#define MACH_MSGH_BITS_REQUEST(bits) MACH_MSGH_BITS_LOCAL(bits)
88#define msgh_reply_port msgh_remote_port
89#define MACH_MSGH_BITS_REPLY(bits) MACH_MSGH_BITS_REMOTE(bits)
90#endif /* __MigKernelSpecificCode */
91
92#define MIG_RETURN_ERROR(X, code) {\
93 ((mig_reply_error_t *)X)->RetCode = code;\
94 ((mig_reply_error_t *)X)->NDR = NDR_record;\
95 return;\
96 }
97
98/* Forward Declarations */
99
100
101mig_internal novalue _Xio_object_get_class
102 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
103
104mig_internal novalue _Xio_object_conforms_to
105 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
106
107mig_internal novalue _Xio_iterator_next
108 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
109
110mig_internal novalue _Xio_iterator_reset
111 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
112
113mig_internal novalue _Xio_service_get_matching_services
114 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
115
116mig_internal novalue _Xio_registry_entry_get_property
117 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
118
119mig_internal novalue _Xio_registry_create_iterator
120 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
121
122mig_internal novalue _Xio_registry_iterator_enter_entry
123 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
124
125mig_internal novalue _Xio_registry_iterator_exit_entry
126 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
127
128mig_internal novalue _Xio_registry_entry_from_path
129 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
130
131mig_internal novalue _Xio_registry_entry_get_name
132 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
133
134mig_internal novalue _Xio_registry_entry_get_properties
135 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
136
137mig_internal novalue _Xio_registry_entry_get_property_bytes
138 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
139
140mig_internal novalue _Xio_registry_entry_get_child_iterator
141 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
142
143mig_internal novalue _Xio_registry_entry_get_parent_iterator
144 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
145
146mig_internal novalue _Xio_service_close
147 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
148
149mig_internal novalue _Xio_connect_get_service
150 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
151
152mig_internal novalue _Xio_connect_set_notification_port
153 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
154
155mig_internal novalue _Xio_connect_map_memory
156 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
157
158mig_internal novalue _Xio_connect_add_client
159 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
160
161mig_internal novalue _Xio_connect_set_properties
162 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
163
164mig_internal novalue _Xio_connect_method_scalarI_scalarO
165 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
166
167mig_internal novalue _Xio_connect_method_scalarI_structureO
168 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
169
170mig_internal novalue _Xio_connect_method_scalarI_structureI
171 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
172
173mig_internal novalue _Xio_connect_method_structureI_structureO
174 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
175
176mig_internal novalue _Xio_registry_entry_get_path
177 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
178
179mig_internal novalue _Xio_registry_get_root_entry
180 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
181
182mig_internal novalue _Xio_registry_entry_set_properties
183 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
184
185mig_internal novalue _Xio_registry_entry_in_plane
186 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
187
188mig_internal novalue _Xio_object_get_retain_count
189 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
190
191mig_internal novalue _Xio_service_get_busy_state
192 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
193
194mig_internal novalue _Xio_service_wait_quiet
195 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
196
197mig_internal novalue _Xio_registry_entry_create_iterator
198 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
199
200mig_internal novalue _Xio_iterator_is_valid
201 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
202
203mig_internal novalue _Xio_catalog_send_data
204 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
205
206mig_internal novalue _Xio_catalog_terminate
207 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
208
209mig_internal novalue _Xio_catalog_get_data
210 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
211
212mig_internal novalue _Xio_catalog_get_gen_count
213 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
214
215mig_internal novalue _Xio_catalog_module_loaded
216 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
217
218mig_internal novalue _Xio_catalog_reset
219 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
220
221mig_internal novalue _Xio_service_request_probe
222 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
223
224mig_internal novalue _Xio_registry_entry_get_name_in_plane
225 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
226
227mig_internal novalue _Xio_service_match_property_table
228 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
229
230mig_internal novalue _Xio_async_method_scalarI_scalarO
231 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
232
233mig_internal novalue _Xio_async_method_scalarI_structureO
234 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
235
236mig_internal novalue _Xio_async_method_scalarI_structureI
237 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
238
239mig_internal novalue _Xio_async_method_structureI_structureO
240 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
241
242mig_internal novalue _Xio_service_add_notification
243 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
244
245mig_internal novalue _Xio_service_add_interest_notification
246 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
247
248mig_internal novalue _Xio_service_acknowledge_notification
249 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
250
251mig_internal novalue _Xio_connect_get_notification_semaphore
252 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
253
254mig_internal novalue _Xio_connect_unmap_memory
255 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
256
257mig_internal novalue _Xio_registry_entry_get_location_in_plane
258 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
259
260mig_internal novalue _Xio_registry_entry_get_property_recursively
261 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
262
263mig_internal novalue _Xio_service_get_state
264 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
265
266mig_internal novalue _Xio_service_get_matching_services_ool
267 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
268
269mig_internal novalue _Xio_service_match_property_table_ool
270 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
271
272mig_internal novalue _Xio_service_add_notification_ool
273 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
274
275mig_internal novalue _Xio_object_get_superclass
276 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
277
278mig_internal novalue _Xio_object_get_bundle_identifier
279 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
280
281mig_internal novalue _Xio_service_open_extended
282 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
283
284mig_internal novalue _Xio_connect_map_memory_into_task
285 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
286
287mig_internal novalue _Xio_connect_unmap_memory_from_task
288 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
289
290mig_internal novalue _Xio_connect_method
291 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
292
293mig_internal novalue _Xio_connect_async_method
294 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
295
296mig_internal novalue _Xio_connect_set_notification_port_64
297 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
298
299mig_internal novalue _Xio_service_add_notification_64
300 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
301
302mig_internal novalue _Xio_service_add_interest_notification_64
303 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
304
305mig_internal novalue _Xio_service_add_notification_ool_64
306 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
307
308mig_internal novalue _Xio_registry_entry_get_registry_entry_id
309 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
310
311mig_internal novalue _Xio_connect_method_var_output
312 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
313
314mig_internal novalue _Xio_service_get_matching_service
315 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
316
317mig_internal novalue _Xio_service_get_matching_service_ool
318 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
319
320mig_internal novalue _Xio_service_get_authorization_id
321 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
322
323mig_internal novalue _Xio_service_set_authorization_id
324 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
325
326mig_internal novalue _Xio_server_version
327 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
328
329mig_internal novalue _Xio_registry_entry_get_properties_bin
330 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
331
332mig_internal novalue _Xio_registry_entry_get_property_bin
333 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
334
335mig_internal novalue _Xio_service_get_matching_service_bin
336 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
337
338mig_internal novalue _Xio_service_get_matching_services_bin
339 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
340
341mig_internal novalue _Xio_service_match_property_table_bin
342 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
343
344mig_internal novalue _Xio_service_add_notification_bin
345 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
346
347mig_internal novalue _Xio_service_add_notification_bin_64
348 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
349
350mig_internal novalue _Xio_registry_entry_get_path_ool
351 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
352
353mig_internal novalue _Xio_registry_entry_from_path_ool
354 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
355
356mig_internal novalue _Xio_device_tree_entry_exists_with_name
357 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
358
359mig_internal novalue _Xio_registry_entry_get_properties_bin_buf
360 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
361
362mig_internal novalue _Xio_registry_entry_get_property_bin_buf
363 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
364
365mig_internal novalue _Xio_service_wait_quiet_with_options
366 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
367
368
369#if ( __MigTypeCheck )
370#if __MIG_check__Request__iokit_subsystem__
371#if !defined(__MIG_check__Request__io_object_get_class_t__defined)
372#define __MIG_check__Request__io_object_get_class_t__defined
373
374mig_internal kern_return_t __MIG_check__Request__io_object_get_class_t(
375 __attribute__((__unused__)) __RequestKData__io_object_get_class_t *InKP,
376 __attribute__((__unused__)) __RequestUData__io_object_get_class_t *In0UP,
377 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
378{
379
380 typedef __Request__io_object_get_class_t __Request;
381 typedef __RequestUData__io_object_get_class_t __RequestU __attribute__((unused));
382#if __MigTypeCheck
383 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
384 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
385 return MIG_BAD_ARGUMENTS;
386#endif /* __MigTypeCheck */
387
388 return MACH_MSG_SUCCESS;
389}
390#endif /* !defined(__MIG_check__Request__io_object_get_class_t__defined) */
391#endif /* __MIG_check__Request__iokit_subsystem__ */
392#endif /* ( __MigTypeCheck ) */
393
394
395/* Routine io_object_get_class */
396mig_internal novalue _Xio_object_get_class
397 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
398 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
399 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
400{
401
402#ifdef __MigPackStructs
403#pragma pack(push, 4)
404#endif
405 typedef struct {
406 mach_msg_trailer_t trailer;
407 char padding[0]; /* Avoid generating empty UData structs */
408 } RequestU __attribute__((unused));
409#ifdef __MigPackStructs
410#pragma pack(pop)
411#endif
412 typedef __RequestKData__io_object_get_class_t RequestK;
413 typedef __RequestUData__io_object_get_class_t __RequestU;
414 typedef __ReplyKData__io_object_get_class_t ReplyK __attribute__((unused));
415 typedef __ReplyUData__io_object_get_class_t ReplyU __attribute__((unused));
416 typedef __Reply__io_object_get_class_t Reply __attribute__((unused));
417 typedef __Request__io_object_get_class_t __Request __attribute__((unused));
418
419 /*
420 * typedef struct {
421 * mach_msg_header_t Head;
422 * NDR_record_t NDR;
423 * kern_return_t RetCode;
424 * } mig_reply_error_t;
425 */
426
427 RequestK *InKP = (RequestK *) InHeadP;
428 RequestU *In0UP = (RequestU *) InDataP;
429 ReplyK *OutKP = (ReplyK *) OutHeadP;
430 ReplyU *OutUP = (ReplyU *) OutDataP;
431 (void)OutUP;
432#ifdef __MIG_check__Request__io_object_get_class_t__defined
433 kern_return_t check_result;
434#endif /* __MIG_check__Request__io_object_get_class_t__defined */
435
436#if __MigKernelSpecificCode
437#else
438#endif /* __MigKernelSpecificCode */
439 io_object_t object;
440
441 __DeclareRcvRpc(2800, "io_object_get_class")
442 __BeforeRcvRpc(2800, "io_object_get_class")
443
444#if defined(__MIG_check__Request__io_object_get_class_t__defined)
445 check_result = __MIG_check__Request__io_object_get_class_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
446 if (check_result != MACH_MSG_SUCCESS)
447 { MIG_RETURN_ERROR(OutKP, check_result); }
448#endif /* defined(__MIG_check__Request__io_object_get_class_t__defined) */
449
450 object = iokit_lookup_object_port(port: InKP->Head.msgh_request_port);
451
452 OutUP->RetCode = is_io_object_get_class(object, className: OutUP->className);
453 iokit_remove_reference(obj: object);
454 if (OutUP->RetCode != KERN_SUCCESS) {
455 MIG_RETURN_ERROR(OutKP, OutUP->RetCode);
456 }
457#if __MigKernelSpecificCode
458#endif /* __MigKernelSpecificCode */
459
460 OutUP->NDR = NDR_record;
461
462#ifdef __LP64__
463 {
464 size_t strLength = strlen(s: OutUP->className) + 1;
465 if (strLength > 0xffffffff)
466 MIG_RETURN_ERROR(OutKP, MIG_BAD_ARGUMENTS);
467 OutUP->classNameCnt = (mach_msg_type_number_t) strLength;
468 }
469#else
470 OutUP->classNameCnt = (mach_msg_type_number_t) strlen(OutUP->className) + 1;
471#endif /* __LP64__ */
472 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 128) + (_WALIGN_((OutUP->classNameCnt + 3) & ~3));
473
474 __AfterRcvRpc(2800, "io_object_get_class")
475}
476
477#if ( __MigTypeCheck )
478#if __MIG_check__Request__iokit_subsystem__
479#if !defined(__MIG_check__Request__io_object_conforms_to_t__defined)
480#define __MIG_check__Request__io_object_conforms_to_t__defined
481
482mig_internal kern_return_t __MIG_check__Request__io_object_conforms_to_t(
483 __attribute__((__unused__)) __RequestKData__io_object_conforms_to_t *InKP,
484 __attribute__((__unused__)) __RequestUData__io_object_conforms_to_t *In0UP,
485 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
486{
487
488 typedef __Request__io_object_conforms_to_t __Request;
489 typedef __RequestUData__io_object_conforms_to_t __RequestU __attribute__((unused));
490#if __MigTypeCheck
491 unsigned int msgh_size;
492#endif /* __MigTypeCheck */
493
494#if __MigTypeCheck
495 msgh_size = InKP->Head.msgh_size;
496 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
497 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 128)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
498 return MIG_BAD_ARGUMENTS;
499#endif /* __MigTypeCheck */
500
501#if defined(__NDR_convert__int_rep__Request__io_object_conforms_to_t__classNameCnt__defined)
502 if (In0UP->NDR.int_rep != NDR_record.int_rep)
503 __NDR_convert__int_rep__Request__io_object_conforms_to_t__classNameCnt(&In0UP->classNameCnt, In0UP->NDR.int_rep);
504#endif /* __NDR_convert__int_rep__Request__io_object_conforms_to_t__classNameCnt__defined */
505#if __MigTypeCheck
506 if (In0UP->classNameCnt > 128)
507 return MIG_BAD_ARGUMENTS;
508 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 128)) < In0UP->classNameCnt) ||
509 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 128) + _WALIGN_(In0UP->classNameCnt)))
510 return MIG_BAD_ARGUMENTS;
511#endif /* __MigTypeCheck */
512
513#if __MigTypeCheck
514 {
515 char * msg_limit = (char *) InTrailerP;
516#if __MigKernelSpecificCode
517 size_t strnlen_limit;
518#else
519 size_t memchr_limit;
520#endif /* __MigKernelSpecificCode */
521
522#if __MigKernelSpecificCode
523 strnlen_limit = min((msg_limit - In0UP->className), 128);
524 if (( strnlen(s: In0UP->className, n: strnlen_limit) >= 128 + 1 ))
525 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
526#else
527 memchr_limit = min((msg_limit - In0UP->className), 128);
528 if (( memchr(In0UP->className, '\0', memchr_limit) == NULL ))
529 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
530#endif /* __MigKernelSpecificCode */
531 }
532#endif /* __MigTypeCheck */
533
534 return MACH_MSG_SUCCESS;
535}
536#endif /* !defined(__MIG_check__Request__io_object_conforms_to_t__defined) */
537#endif /* __MIG_check__Request__iokit_subsystem__ */
538#endif /* ( __MigTypeCheck ) */
539
540
541/* Routine io_object_conforms_to */
542mig_internal novalue _Xio_object_conforms_to
543 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
544 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
545 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
546{
547
548#ifdef __MigPackStructs
549#pragma pack(push, 4)
550#endif
551 typedef struct {
552 NDR_record_t NDR;
553 mach_msg_type_number_t classNameOffset; /* MiG doesn't use it */
554 mach_msg_type_number_t classNameCnt;
555 char className[128];
556 mach_msg_trailer_t trailer;
557 char padding[0]; /* Avoid generating empty UData structs */
558 } RequestU __attribute__((unused));
559#ifdef __MigPackStructs
560#pragma pack(pop)
561#endif
562 typedef __RequestKData__io_object_conforms_to_t RequestK;
563 typedef __RequestUData__io_object_conforms_to_t __RequestU;
564 typedef __ReplyKData__io_object_conforms_to_t ReplyK __attribute__((unused));
565 typedef __ReplyUData__io_object_conforms_to_t ReplyU __attribute__((unused));
566 typedef __Reply__io_object_conforms_to_t Reply __attribute__((unused));
567 typedef __Request__io_object_conforms_to_t __Request __attribute__((unused));
568
569 /*
570 * typedef struct {
571 * mach_msg_header_t Head;
572 * NDR_record_t NDR;
573 * kern_return_t RetCode;
574 * } mig_reply_error_t;
575 */
576
577 RequestK *InKP = (RequestK *) InHeadP;
578 RequestU *In0UP = (RequestU *) InDataP;
579 ReplyK *OutKP = (ReplyK *) OutHeadP;
580 ReplyU *OutUP = (ReplyU *) OutDataP;
581 (void)OutUP;
582#ifdef __MIG_check__Request__io_object_conforms_to_t__defined
583 kern_return_t check_result;
584#endif /* __MIG_check__Request__io_object_conforms_to_t__defined */
585
586#if __MigKernelSpecificCode
587#else
588#endif /* __MigKernelSpecificCode */
589 io_object_t object;
590
591 __DeclareRcvRpc(2801, "io_object_conforms_to")
592 __BeforeRcvRpc(2801, "io_object_conforms_to")
593
594#if defined(__MIG_check__Request__io_object_conforms_to_t__defined)
595 check_result = __MIG_check__Request__io_object_conforms_to_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
596 if (check_result != MACH_MSG_SUCCESS)
597 { MIG_RETURN_ERROR(OutKP, check_result); }
598#endif /* defined(__MIG_check__Request__io_object_conforms_to_t__defined) */
599
600 object = iokit_lookup_object_port(port: InKP->Head.msgh_request_port);
601
602 OutUP->RetCode = is_io_object_conforms_to(object, className: In0UP->className, conforms: &OutUP->conforms);
603 iokit_remove_reference(obj: object);
604 if (OutUP->RetCode != KERN_SUCCESS) {
605 MIG_RETURN_ERROR(OutKP, OutUP->RetCode);
606 }
607#if __MigKernelSpecificCode
608#endif /* __MigKernelSpecificCode */
609
610 OutUP->NDR = NDR_record;
611
612
613 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
614 __AfterRcvRpc(2801, "io_object_conforms_to")
615}
616
617#if ( __MigTypeCheck )
618#if __MIG_check__Request__iokit_subsystem__
619#if !defined(__MIG_check__Request__io_iterator_next_t__defined)
620#define __MIG_check__Request__io_iterator_next_t__defined
621
622mig_internal kern_return_t __MIG_check__Request__io_iterator_next_t(
623 __attribute__((__unused__)) __RequestKData__io_iterator_next_t *InKP,
624 __attribute__((__unused__)) __RequestUData__io_iterator_next_t *In0UP,
625 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
626{
627
628 typedef __Request__io_iterator_next_t __Request;
629 typedef __RequestUData__io_iterator_next_t __RequestU __attribute__((unused));
630#if __MigTypeCheck
631 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
632 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
633 return MIG_BAD_ARGUMENTS;
634#endif /* __MigTypeCheck */
635
636 return MACH_MSG_SUCCESS;
637}
638#endif /* !defined(__MIG_check__Request__io_iterator_next_t__defined) */
639#endif /* __MIG_check__Request__iokit_subsystem__ */
640#endif /* ( __MigTypeCheck ) */
641
642
643/* Routine io_iterator_next */
644mig_internal novalue _Xio_iterator_next
645 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
646 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
647 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
648{
649
650#ifdef __MigPackStructs
651#pragma pack(push, 4)
652#endif
653 typedef struct {
654 mach_msg_trailer_t trailer;
655 char padding[0]; /* Avoid generating empty UData structs */
656 } RequestU __attribute__((unused));
657#ifdef __MigPackStructs
658#pragma pack(pop)
659#endif
660 typedef __RequestKData__io_iterator_next_t RequestK;
661 typedef __RequestUData__io_iterator_next_t __RequestU;
662 typedef __ReplyKData__io_iterator_next_t ReplyK __attribute__((unused));
663 typedef __ReplyUData__io_iterator_next_t ReplyU __attribute__((unused));
664 typedef __Reply__io_iterator_next_t Reply __attribute__((unused));
665 typedef __Request__io_iterator_next_t __Request __attribute__((unused));
666
667 /*
668 * typedef struct {
669 * mach_msg_header_t Head;
670 * NDR_record_t NDR;
671 * kern_return_t RetCode;
672 * } mig_reply_error_t;
673 */
674
675 RequestK *InKP = (RequestK *) InHeadP;
676 RequestU *In0UP = (RequestU *) InDataP;
677 ReplyK *OutKP = (ReplyK *) OutHeadP;
678 ReplyU *OutUP = (ReplyU *) OutDataP;
679 (void)OutUP;
680#ifdef __MIG_check__Request__io_iterator_next_t__defined
681 kern_return_t check_result;
682#endif /* __MIG_check__Request__io_iterator_next_t__defined */
683
684#if __MigKernelSpecificCode
685#if UseStaticTemplates
686 const static mach_msg_port_descriptor_t objectTemplate = {
687 /* name = */ MACH_PORT_NULL,
688 /* pad1 = */ 0,
689 /* pad2 = */ 0,
690 /* disp = */ 17,
691 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
692 };
693#endif /* UseStaticTemplates */
694
695#else
696#if UseStaticTemplates
697 const static mach_msg_port_descriptor_t objectTemplate = {
698 /* name = */ MACH_PORT_NULL,
699 /* pad1 = */ 0,
700 /* pad2 = */ 0,
701 /* disp = */ 19,
702 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
703 };
704#endif /* UseStaticTemplates */
705
706#endif /* __MigKernelSpecificCode */
707 kern_return_t RetCode;
708 io_object_t iterator;
709 io_object_t object;
710
711 __DeclareRcvRpc(2802, "io_iterator_next")
712 __BeforeRcvRpc(2802, "io_iterator_next")
713
714#if defined(__MIG_check__Request__io_iterator_next_t__defined)
715 check_result = __MIG_check__Request__io_iterator_next_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
716 if (check_result != MACH_MSG_SUCCESS)
717 { MIG_RETURN_ERROR(OutKP, check_result); }
718#endif /* defined(__MIG_check__Request__io_iterator_next_t__defined) */
719
720#if UseStaticTemplates
721 OutKP->object = objectTemplate;
722#else /* UseStaticTemplates */
723#if __MigKernelSpecificCode
724 OutKP->object.disposition = 17;
725#else
726 OutKP->object.disposition = 19;
727#endif /* __MigKernelSpecificCode */
728#if !(defined(KERNEL) && defined(__LP64__))
729 OutKP->object.pad1 = 0;
730#endif
731 OutKP->object.pad2 = 0;
732 OutKP->object.type = MACH_MSG_PORT_DESCRIPTOR;
733#if defined(KERNEL)
734 OutKP->object.pad_end = 0;
735#endif
736#endif /* UseStaticTemplates */
737
738
739 iterator = iokit_lookup_object_port(port: InKP->Head.msgh_request_port);
740
741 RetCode = is_io_iterator_next(iterator, object: &object);
742 iokit_remove_reference(obj: iterator);
743 if (RetCode != KERN_SUCCESS) {
744 MIG_RETURN_ERROR(OutKP, RetCode);
745 }
746#if __MigKernelSpecificCode
747#endif /* __MigKernelSpecificCode */
748 OutKP->object.name = (mach_port_t)iokit_make_object_port(obj: object);
749
750
751 OutKP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
752 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
753 OutKP->msgh_body.msgh_descriptor_count = 1;
754 __AfterRcvRpc(2802, "io_iterator_next")
755}
756
757#if ( __MigTypeCheck )
758#if __MIG_check__Request__iokit_subsystem__
759#if !defined(__MIG_check__Request__io_iterator_reset_t__defined)
760#define __MIG_check__Request__io_iterator_reset_t__defined
761
762mig_internal kern_return_t __MIG_check__Request__io_iterator_reset_t(
763 __attribute__((__unused__)) __RequestKData__io_iterator_reset_t *InKP,
764 __attribute__((__unused__)) __RequestUData__io_iterator_reset_t *In0UP,
765 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
766{
767
768 typedef __Request__io_iterator_reset_t __Request;
769 typedef __RequestUData__io_iterator_reset_t __RequestU __attribute__((unused));
770#if __MigTypeCheck
771 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
772 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
773 return MIG_BAD_ARGUMENTS;
774#endif /* __MigTypeCheck */
775
776 return MACH_MSG_SUCCESS;
777}
778#endif /* !defined(__MIG_check__Request__io_iterator_reset_t__defined) */
779#endif /* __MIG_check__Request__iokit_subsystem__ */
780#endif /* ( __MigTypeCheck ) */
781
782
783/* Routine io_iterator_reset */
784mig_internal novalue _Xio_iterator_reset
785 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
786 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
787 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
788{
789
790#ifdef __MigPackStructs
791#pragma pack(push, 4)
792#endif
793 typedef struct {
794 mach_msg_trailer_t trailer;
795 char padding[0]; /* Avoid generating empty UData structs */
796 } RequestU __attribute__((unused));
797#ifdef __MigPackStructs
798#pragma pack(pop)
799#endif
800 typedef __RequestKData__io_iterator_reset_t RequestK;
801 typedef __RequestUData__io_iterator_reset_t __RequestU;
802 typedef __ReplyKData__io_iterator_reset_t ReplyK __attribute__((unused));
803 typedef __ReplyUData__io_iterator_reset_t ReplyU __attribute__((unused));
804 typedef __Reply__io_iterator_reset_t Reply __attribute__((unused));
805 typedef __Request__io_iterator_reset_t __Request __attribute__((unused));
806
807 /*
808 * typedef struct {
809 * mach_msg_header_t Head;
810 * NDR_record_t NDR;
811 * kern_return_t RetCode;
812 * } mig_reply_error_t;
813 */
814
815 RequestK *InKP = (RequestK *) InHeadP;
816 RequestU *In0UP = (RequestU *) InDataP;
817 ReplyK *OutKP = (ReplyK *) OutHeadP;
818 ReplyU *OutUP = (ReplyU *) OutDataP;
819 (void)OutUP;
820#ifdef __MIG_check__Request__io_iterator_reset_t__defined
821 kern_return_t check_result;
822#endif /* __MIG_check__Request__io_iterator_reset_t__defined */
823
824#if __MigKernelSpecificCode
825#else
826#endif /* __MigKernelSpecificCode */
827 io_object_t iterator;
828
829 __DeclareRcvRpc(2803, "io_iterator_reset")
830 __BeforeRcvRpc(2803, "io_iterator_reset")
831
832#if defined(__MIG_check__Request__io_iterator_reset_t__defined)
833 check_result = __MIG_check__Request__io_iterator_reset_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
834 if (check_result != MACH_MSG_SUCCESS)
835 { MIG_RETURN_ERROR(OutKP, check_result); }
836#endif /* defined(__MIG_check__Request__io_iterator_reset_t__defined) */
837
838 iterator = iokit_lookup_object_port(port: InKP->Head.msgh_request_port);
839
840 OutUP->RetCode = is_io_iterator_reset(iterator);
841 iokit_remove_reference(obj: iterator);
842#if __MigKernelSpecificCode
843#endif /* __MigKernelSpecificCode */
844
845 OutUP->NDR = NDR_record;
846
847
848 __AfterRcvRpc(2803, "io_iterator_reset")
849}
850
851#if ( __MigTypeCheck )
852#if __MIG_check__Request__iokit_subsystem__
853#if !defined(__MIG_check__Request__io_service_get_matching_services_t__defined)
854#define __MIG_check__Request__io_service_get_matching_services_t__defined
855
856mig_internal kern_return_t __MIG_check__Request__io_service_get_matching_services_t(
857 __attribute__((__unused__)) __RequestKData__io_service_get_matching_services_t *InKP,
858 __attribute__((__unused__)) __RequestUData__io_service_get_matching_services_t *In0UP,
859 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
860{
861
862 typedef __Request__io_service_get_matching_services_t __Request;
863 typedef __RequestUData__io_service_get_matching_services_t __RequestU __attribute__((unused));
864#if __MigTypeCheck
865 unsigned int msgh_size;
866#endif /* __MigTypeCheck */
867
868#if __MigTypeCheck
869 msgh_size = InKP->Head.msgh_size;
870 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
871 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 512)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
872 return MIG_BAD_ARGUMENTS;
873#endif /* __MigTypeCheck */
874
875#if defined(__NDR_convert__int_rep__Request__io_service_get_matching_services_t__matchingCnt__defined)
876 if (In0UP->NDR.int_rep != NDR_record.int_rep)
877 __NDR_convert__int_rep__Request__io_service_get_matching_services_t__matchingCnt(&In0UP->matchingCnt, In0UP->NDR.int_rep);
878#endif /* __NDR_convert__int_rep__Request__io_service_get_matching_services_t__matchingCnt__defined */
879#if __MigTypeCheck
880 if (In0UP->matchingCnt > 512)
881 return MIG_BAD_ARGUMENTS;
882 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 512)) < In0UP->matchingCnt) ||
883 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 512) + _WALIGN_(In0UP->matchingCnt)))
884 return MIG_BAD_ARGUMENTS;
885#endif /* __MigTypeCheck */
886
887#if __MigTypeCheck
888 {
889 char * msg_limit = (char *) InTrailerP;
890#if __MigKernelSpecificCode
891 size_t strnlen_limit;
892#else
893 size_t memchr_limit;
894#endif /* __MigKernelSpecificCode */
895
896#if __MigKernelSpecificCode
897 strnlen_limit = min((msg_limit - In0UP->matching), 512);
898 if (( strnlen(s: In0UP->matching, n: strnlen_limit) >= 512 + 1 ))
899 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
900#else
901 memchr_limit = min((msg_limit - In0UP->matching), 512);
902 if (( memchr(In0UP->matching, '\0', memchr_limit) == NULL ))
903 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
904#endif /* __MigKernelSpecificCode */
905 }
906#endif /* __MigTypeCheck */
907
908 return MACH_MSG_SUCCESS;
909}
910#endif /* !defined(__MIG_check__Request__io_service_get_matching_services_t__defined) */
911#endif /* __MIG_check__Request__iokit_subsystem__ */
912#endif /* ( __MigTypeCheck ) */
913
914
915/* Routine io_service_get_matching_services */
916mig_internal novalue _Xio_service_get_matching_services
917 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
918 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
919 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
920{
921
922#ifdef __MigPackStructs
923#pragma pack(push, 4)
924#endif
925 typedef struct {
926 NDR_record_t NDR;
927 mach_msg_type_number_t matchingOffset; /* MiG doesn't use it */
928 mach_msg_type_number_t matchingCnt;
929 char matching[512];
930 mach_msg_trailer_t trailer;
931 char padding[0]; /* Avoid generating empty UData structs */
932 } RequestU __attribute__((unused));
933#ifdef __MigPackStructs
934#pragma pack(pop)
935#endif
936 typedef __RequestKData__io_service_get_matching_services_t RequestK;
937 typedef __RequestUData__io_service_get_matching_services_t __RequestU;
938 typedef __ReplyKData__io_service_get_matching_services_t ReplyK __attribute__((unused));
939 typedef __ReplyUData__io_service_get_matching_services_t ReplyU __attribute__((unused));
940 typedef __Reply__io_service_get_matching_services_t Reply __attribute__((unused));
941 typedef __Request__io_service_get_matching_services_t __Request __attribute__((unused));
942
943 /*
944 * typedef struct {
945 * mach_msg_header_t Head;
946 * NDR_record_t NDR;
947 * kern_return_t RetCode;
948 * } mig_reply_error_t;
949 */
950
951 RequestK *InKP = (RequestK *) InHeadP;
952 RequestU *In0UP = (RequestU *) InDataP;
953 ReplyK *OutKP = (ReplyK *) OutHeadP;
954 ReplyU *OutUP = (ReplyU *) OutDataP;
955 (void)OutUP;
956#ifdef __MIG_check__Request__io_service_get_matching_services_t__defined
957 kern_return_t check_result;
958#endif /* __MIG_check__Request__io_service_get_matching_services_t__defined */
959
960#if __MigKernelSpecificCode
961#if UseStaticTemplates
962 const static mach_msg_port_descriptor_t existingTemplate = {
963 /* name = */ MACH_PORT_NULL,
964 /* pad1 = */ 0,
965 /* pad2 = */ 0,
966 /* disp = */ 17,
967 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
968 };
969#endif /* UseStaticTemplates */
970
971#else
972#if UseStaticTemplates
973 const static mach_msg_port_descriptor_t existingTemplate = {
974 /* name = */ MACH_PORT_NULL,
975 /* pad1 = */ 0,
976 /* pad2 = */ 0,
977 /* disp = */ 19,
978 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
979 };
980#endif /* UseStaticTemplates */
981
982#endif /* __MigKernelSpecificCode */
983 kern_return_t RetCode;
984 io_object_t existing;
985
986 __DeclareRcvRpc(2804, "io_service_get_matching_services")
987 __BeforeRcvRpc(2804, "io_service_get_matching_services")
988
989#if defined(__MIG_check__Request__io_service_get_matching_services_t__defined)
990 check_result = __MIG_check__Request__io_service_get_matching_services_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
991 if (check_result != MACH_MSG_SUCCESS)
992 { MIG_RETURN_ERROR(OutKP, check_result); }
993#endif /* defined(__MIG_check__Request__io_service_get_matching_services_t__defined) */
994
995#if UseStaticTemplates
996 OutKP->existing = existingTemplate;
997#else /* UseStaticTemplates */
998#if __MigKernelSpecificCode
999 OutKP->existing.disposition = 17;
1000#else
1001 OutKP->existing.disposition = 19;
1002#endif /* __MigKernelSpecificCode */
1003#if !(defined(KERNEL) && defined(__LP64__))
1004 OutKP->existing.pad1 = 0;
1005#endif
1006 OutKP->existing.pad2 = 0;
1007 OutKP->existing.type = MACH_MSG_PORT_DESCRIPTOR;
1008#if defined(KERNEL)
1009 OutKP->existing.pad_end = 0;
1010#endif
1011#endif /* UseStaticTemplates */
1012
1013
1014 RetCode = is_io_service_get_matching_services(main_port: InKP->Head.msgh_request_port, matching: In0UP->matching, existing: &existing);
1015 if (RetCode != KERN_SUCCESS) {
1016 MIG_RETURN_ERROR(OutKP, RetCode);
1017 }
1018#if __MigKernelSpecificCode
1019#endif /* __MigKernelSpecificCode */
1020 OutKP->existing.name = (mach_port_t)iokit_make_object_port(obj: existing);
1021
1022
1023 OutKP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
1024 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
1025 OutKP->msgh_body.msgh_descriptor_count = 1;
1026 __AfterRcvRpc(2804, "io_service_get_matching_services")
1027}
1028
1029#if ( __MigTypeCheck )
1030#if __MIG_check__Request__iokit_subsystem__
1031#if !defined(__MIG_check__Request__io_registry_entry_get_property_t__defined)
1032#define __MIG_check__Request__io_registry_entry_get_property_t__defined
1033
1034mig_internal kern_return_t __MIG_check__Request__io_registry_entry_get_property_t(
1035 __attribute__((__unused__)) __RequestKData__io_registry_entry_get_property_t *InKP,
1036 __attribute__((__unused__)) __RequestUData__io_registry_entry_get_property_t *In0UP,
1037 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
1038{
1039
1040 typedef __Request__io_registry_entry_get_property_t __Request;
1041 typedef __RequestUData__io_registry_entry_get_property_t __RequestU __attribute__((unused));
1042#if __MigTypeCheck
1043 unsigned int msgh_size;
1044#endif /* __MigTypeCheck */
1045
1046#if __MigTypeCheck
1047 msgh_size = InKP->Head.msgh_size;
1048 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
1049 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 128)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
1050 return MIG_BAD_ARGUMENTS;
1051#endif /* __MigTypeCheck */
1052
1053#if defined(__NDR_convert__int_rep__Request__io_registry_entry_get_property_t__property_nameCnt__defined)
1054 if (In0UP->NDR.int_rep != NDR_record.int_rep)
1055 __NDR_convert__int_rep__Request__io_registry_entry_get_property_t__property_nameCnt(&In0UP->property_nameCnt, In0UP->NDR.int_rep);
1056#endif /* __NDR_convert__int_rep__Request__io_registry_entry_get_property_t__property_nameCnt__defined */
1057#if __MigTypeCheck
1058 if (In0UP->property_nameCnt > 128)
1059 return MIG_BAD_ARGUMENTS;
1060 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 128)) < In0UP->property_nameCnt) ||
1061 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 128) + _WALIGN_(In0UP->property_nameCnt)))
1062 return MIG_BAD_ARGUMENTS;
1063#endif /* __MigTypeCheck */
1064
1065#if __MigTypeCheck
1066 {
1067 char * msg_limit = (char *) InTrailerP;
1068#if __MigKernelSpecificCode
1069 size_t strnlen_limit;
1070#else
1071 size_t memchr_limit;
1072#endif /* __MigKernelSpecificCode */
1073
1074#if __MigKernelSpecificCode
1075 strnlen_limit = min((msg_limit - In0UP->property_name), 128);
1076 if (( strnlen(s: In0UP->property_name, n: strnlen_limit) >= 128 + 1 ))
1077 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
1078#else
1079 memchr_limit = min((msg_limit - In0UP->property_name), 128);
1080 if (( memchr(In0UP->property_name, '\0', memchr_limit) == NULL ))
1081 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
1082#endif /* __MigKernelSpecificCode */
1083 }
1084#endif /* __MigTypeCheck */
1085
1086 return MACH_MSG_SUCCESS;
1087}
1088#endif /* !defined(__MIG_check__Request__io_registry_entry_get_property_t__defined) */
1089#endif /* __MIG_check__Request__iokit_subsystem__ */
1090#endif /* ( __MigTypeCheck ) */
1091
1092
1093/* Routine io_registry_entry_get_property */
1094mig_internal novalue _Xio_registry_entry_get_property
1095 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
1096 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
1097 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
1098{
1099
1100#ifdef __MigPackStructs
1101#pragma pack(push, 4)
1102#endif
1103 typedef struct {
1104 NDR_record_t NDR;
1105 mach_msg_type_number_t property_nameOffset; /* MiG doesn't use it */
1106 mach_msg_type_number_t property_nameCnt;
1107 char property_name[128];
1108 mach_msg_trailer_t trailer;
1109 char padding[0]; /* Avoid generating empty UData structs */
1110 } RequestU __attribute__((unused));
1111#ifdef __MigPackStructs
1112#pragma pack(pop)
1113#endif
1114 typedef __RequestKData__io_registry_entry_get_property_t RequestK;
1115 typedef __RequestUData__io_registry_entry_get_property_t __RequestU;
1116 typedef __ReplyKData__io_registry_entry_get_property_t ReplyK __attribute__((unused));
1117 typedef __ReplyUData__io_registry_entry_get_property_t ReplyU __attribute__((unused));
1118 typedef __Reply__io_registry_entry_get_property_t Reply __attribute__((unused));
1119 typedef __Request__io_registry_entry_get_property_t __Request __attribute__((unused));
1120
1121 /*
1122 * typedef struct {
1123 * mach_msg_header_t Head;
1124 * NDR_record_t NDR;
1125 * kern_return_t RetCode;
1126 * } mig_reply_error_t;
1127 */
1128
1129 RequestK *InKP = (RequestK *) InHeadP;
1130 RequestU *In0UP = (RequestU *) InDataP;
1131 ReplyK *OutKP = (ReplyK *) OutHeadP;
1132 ReplyU *OutUP = (ReplyU *) OutDataP;
1133 (void)OutUP;
1134#ifdef __MIG_check__Request__io_registry_entry_get_property_t__defined
1135 kern_return_t check_result;
1136#endif /* __MIG_check__Request__io_registry_entry_get_property_t__defined */
1137
1138#if __MigKernelSpecificCode
1139#if UseStaticTemplates
1140 const static mach_msg_ool_descriptor_t propertiesTemplate = {
1141 /* addr = */ (void *)0,
1142 /* size = */ 0,
1143 /* deal = */ FALSE,
1144 /* copy = */ MACH_MSG_PHYSICAL_COPY,
1145 /* pad2 = */ 0,
1146 /* type = */ MACH_MSG_OOL_DESCRIPTOR,
1147 };
1148#endif /* UseStaticTemplates */
1149
1150#else
1151#if UseStaticTemplates
1152 const static mach_msg_ool_descriptor_t propertiesTemplate = {
1153 /* addr = */ (void *)0,
1154 /* size = */ 0,
1155 /* deal = */ FALSE,
1156 /* copy = */ MACH_MSG_PHYSICAL_COPY,
1157 /* pad2 = */ 0,
1158 /* type = */ MACH_MSG_OOL_DESCRIPTOR,
1159 };
1160#endif /* UseStaticTemplates */
1161
1162#endif /* __MigKernelSpecificCode */
1163 kern_return_t RetCode;
1164 io_object_t registry_entry;
1165
1166 __DeclareRcvRpc(2805, "io_registry_entry_get_property")
1167 __BeforeRcvRpc(2805, "io_registry_entry_get_property")
1168
1169#if defined(__MIG_check__Request__io_registry_entry_get_property_t__defined)
1170 check_result = __MIG_check__Request__io_registry_entry_get_property_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
1171 if (check_result != MACH_MSG_SUCCESS)
1172 { MIG_RETURN_ERROR(OutKP, check_result); }
1173#endif /* defined(__MIG_check__Request__io_registry_entry_get_property_t__defined) */
1174
1175#if UseStaticTemplates
1176 OutKP->properties = propertiesTemplate;
1177#else /* UseStaticTemplates */
1178 OutKP->properties.deallocate = FALSE;
1179 OutKP->properties.copy = MACH_MSG_PHYSICAL_COPY;
1180 OutKP->properties.pad1 = 0;
1181 OutKP->properties.type = MACH_MSG_OOL_DESCRIPTOR;
1182#if defined(KERNEL) && !defined(__LP64__)
1183 OutKP->properties.pad_end = 0;
1184#endif
1185#endif /* UseStaticTemplates */
1186
1187
1188 registry_entry = iokit_lookup_object_port(port: InKP->Head.msgh_request_port);
1189
1190 RetCode = is_io_registry_entry_get_property(registry_entry, property_name: In0UP->property_name, properties: (io_buf_ptr_t *)&(OutKP->properties.address), propertiesCnt: &OutUP->propertiesCnt);
1191 iokit_remove_reference(obj: registry_entry);
1192 if (RetCode != KERN_SUCCESS) {
1193 MIG_RETURN_ERROR(OutKP, RetCode);
1194 }
1195#if __MigKernelSpecificCode
1196#endif /* __MigKernelSpecificCode */
1197 OutKP->properties.size = OutUP->propertiesCnt;
1198
1199
1200 OutUP->NDR = NDR_record;
1201
1202
1203 OutKP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
1204 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
1205 OutKP->msgh_body.msgh_descriptor_count = 1;
1206 __AfterRcvRpc(2805, "io_registry_entry_get_property")
1207}
1208
1209#if ( __MigTypeCheck )
1210#if __MIG_check__Request__iokit_subsystem__
1211#if !defined(__MIG_check__Request__io_registry_create_iterator_t__defined)
1212#define __MIG_check__Request__io_registry_create_iterator_t__defined
1213
1214mig_internal kern_return_t __MIG_check__Request__io_registry_create_iterator_t(
1215 __attribute__((__unused__)) __RequestKData__io_registry_create_iterator_t *InKP,
1216 __attribute__((__unused__)) __RequestUData__io_registry_create_iterator_t *In0UP,
1217 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
1218 __attribute__((__unused__)) __RequestUData__io_registry_create_iterator_t **In1UPP)
1219{
1220
1221 typedef __Request__io_registry_create_iterator_t __Request;
1222 typedef __RequestUData__io_registry_create_iterator_t __RequestU __attribute__((unused));
1223 __RequestU *In1UP;
1224#if __MigTypeCheck
1225 unsigned int msgh_size;
1226#endif /* __MigTypeCheck */
1227 unsigned int msgh_size_delta;
1228
1229#if __MigTypeCheck
1230 msgh_size = InKP->Head.msgh_size;
1231 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
1232 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 128)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
1233 return MIG_BAD_ARGUMENTS;
1234#endif /* __MigTypeCheck */
1235
1236#if defined(__NDR_convert__int_rep__Request__io_registry_create_iterator_t__planeCnt__defined)
1237 if (In0UP->NDR.int_rep != NDR_record.int_rep)
1238 __NDR_convert__int_rep__Request__io_registry_create_iterator_t__planeCnt(&In0UP->planeCnt, In0UP->NDR.int_rep);
1239#endif /* __NDR_convert__int_rep__Request__io_registry_create_iterator_t__planeCnt__defined */
1240 msgh_size_delta = _WALIGN_(In0UP->planeCnt);
1241#if __MigTypeCheck
1242 if (In0UP->planeCnt > 128)
1243 return MIG_BAD_ARGUMENTS;
1244 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 128)) < In0UP->planeCnt) ||
1245 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 128) + _WALIGN_(In0UP->planeCnt)))
1246 return MIG_BAD_ARGUMENTS;
1247#endif /* __MigTypeCheck */
1248
1249 *In1UPP = In1UP = (__RequestU *) ((pointer_t) In0UP + msgh_size_delta - 128);
1250
1251#if __MigTypeCheck
1252 {
1253 char * msg_limit = (char *) InTrailerP;
1254#if __MigKernelSpecificCode
1255 size_t strnlen_limit;
1256#else
1257 size_t memchr_limit;
1258#endif /* __MigKernelSpecificCode */
1259
1260#if __MigKernelSpecificCode
1261 strnlen_limit = min((msg_limit - In0UP->plane), 128);
1262 if (( strnlen(s: In0UP->plane, n: strnlen_limit) >= 128 + 1 ))
1263 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
1264#else
1265 memchr_limit = min((msg_limit - In0UP->plane), 128);
1266 if (( memchr(In0UP->plane, '\0', memchr_limit) == NULL ))
1267 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
1268#endif /* __MigKernelSpecificCode */
1269 }
1270#endif /* __MigTypeCheck */
1271
1272 return MACH_MSG_SUCCESS;
1273}
1274#endif /* !defined(__MIG_check__Request__io_registry_create_iterator_t__defined) */
1275#endif /* __MIG_check__Request__iokit_subsystem__ */
1276#endif /* ( __MigTypeCheck ) */
1277
1278
1279/* Routine io_registry_create_iterator */
1280mig_internal novalue _Xio_registry_create_iterator
1281 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
1282 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
1283 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
1284{
1285
1286#ifdef __MigPackStructs
1287#pragma pack(push, 4)
1288#endif
1289 typedef struct {
1290 NDR_record_t NDR;
1291 mach_msg_type_number_t planeOffset; /* MiG doesn't use it */
1292 mach_msg_type_number_t planeCnt;
1293 char plane[128];
1294 uint32_t options;
1295 mach_msg_trailer_t trailer;
1296 char padding[0]; /* Avoid generating empty UData structs */
1297 } RequestU __attribute__((unused));
1298#ifdef __MigPackStructs
1299#pragma pack(pop)
1300#endif
1301 typedef __RequestKData__io_registry_create_iterator_t RequestK;
1302 typedef __RequestUData__io_registry_create_iterator_t __RequestU;
1303 typedef __ReplyKData__io_registry_create_iterator_t ReplyK __attribute__((unused));
1304 typedef __ReplyUData__io_registry_create_iterator_t ReplyU __attribute__((unused));
1305 typedef __Reply__io_registry_create_iterator_t Reply __attribute__((unused));
1306 typedef __Request__io_registry_create_iterator_t __Request __attribute__((unused));
1307
1308 /*
1309 * typedef struct {
1310 * mach_msg_header_t Head;
1311 * NDR_record_t NDR;
1312 * kern_return_t RetCode;
1313 * } mig_reply_error_t;
1314 */
1315
1316 RequestK *InKP = (RequestK *) InHeadP;
1317 RequestU *In0UP = (RequestU *) InDataP;
1318 RequestU *In1UP;
1319 ReplyK *OutKP = (ReplyK *) OutHeadP;
1320 ReplyU *OutUP = (ReplyU *) OutDataP;
1321 (void)OutUP;
1322#ifdef __MIG_check__Request__io_registry_create_iterator_t__defined
1323 kern_return_t check_result;
1324#endif /* __MIG_check__Request__io_registry_create_iterator_t__defined */
1325
1326#if __MigKernelSpecificCode
1327#if UseStaticTemplates
1328 const static mach_msg_port_descriptor_t iteratorTemplate = {
1329 /* name = */ MACH_PORT_NULL,
1330 /* pad1 = */ 0,
1331 /* pad2 = */ 0,
1332 /* disp = */ 17,
1333 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
1334 };
1335#endif /* UseStaticTemplates */
1336
1337#else
1338#if UseStaticTemplates
1339 const static mach_msg_port_descriptor_t iteratorTemplate = {
1340 /* name = */ MACH_PORT_NULL,
1341 /* pad1 = */ 0,
1342 /* pad2 = */ 0,
1343 /* disp = */ 19,
1344 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
1345 };
1346#endif /* UseStaticTemplates */
1347
1348#endif /* __MigKernelSpecificCode */
1349 kern_return_t RetCode;
1350 io_object_t iterator;
1351
1352 __DeclareRcvRpc(2806, "io_registry_create_iterator")
1353 __BeforeRcvRpc(2806, "io_registry_create_iterator")
1354
1355#if defined(__MIG_check__Request__io_registry_create_iterator_t__defined)
1356 check_result = __MIG_check__Request__io_registry_create_iterator_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP, In1UPP: (__RequestU **)&In1UP);
1357 if (check_result != MACH_MSG_SUCCESS)
1358 { MIG_RETURN_ERROR(OutKP, check_result); }
1359#endif /* defined(__MIG_check__Request__io_registry_create_iterator_t__defined) */
1360
1361#if UseStaticTemplates
1362 OutKP->iterator = iteratorTemplate;
1363#else /* UseStaticTemplates */
1364#if __MigKernelSpecificCode
1365 OutKP->iterator.disposition = 17;
1366#else
1367 OutKP->iterator.disposition = 19;
1368#endif /* __MigKernelSpecificCode */
1369#if !(defined(KERNEL) && defined(__LP64__))
1370 OutKP->iterator.pad1 = 0;
1371#endif
1372 OutKP->iterator.pad2 = 0;
1373 OutKP->iterator.type = MACH_MSG_PORT_DESCRIPTOR;
1374#if defined(KERNEL)
1375 OutKP->iterator.pad_end = 0;
1376#endif
1377#endif /* UseStaticTemplates */
1378
1379
1380 RetCode = is_io_registry_create_iterator(main_port: InKP->Head.msgh_request_port, plane: In0UP->plane, options: In1UP->options, iterator: &iterator);
1381 if (RetCode != KERN_SUCCESS) {
1382 MIG_RETURN_ERROR(OutKP, RetCode);
1383 }
1384#if __MigKernelSpecificCode
1385#endif /* __MigKernelSpecificCode */
1386 OutKP->iterator.name = (mach_port_t)iokit_make_object_port(obj: iterator);
1387
1388
1389 OutKP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
1390 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
1391 OutKP->msgh_body.msgh_descriptor_count = 1;
1392 __AfterRcvRpc(2806, "io_registry_create_iterator")
1393}
1394
1395#if ( __MigTypeCheck )
1396#if __MIG_check__Request__iokit_subsystem__
1397#if !defined(__MIG_check__Request__io_registry_iterator_enter_entry_t__defined)
1398#define __MIG_check__Request__io_registry_iterator_enter_entry_t__defined
1399
1400mig_internal kern_return_t __MIG_check__Request__io_registry_iterator_enter_entry_t(
1401 __attribute__((__unused__)) __RequestKData__io_registry_iterator_enter_entry_t *InKP,
1402 __attribute__((__unused__)) __RequestUData__io_registry_iterator_enter_entry_t *In0UP,
1403 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
1404{
1405
1406 typedef __Request__io_registry_iterator_enter_entry_t __Request;
1407 typedef __RequestUData__io_registry_iterator_enter_entry_t __RequestU __attribute__((unused));
1408#if __MigTypeCheck
1409 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
1410 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
1411 return MIG_BAD_ARGUMENTS;
1412#endif /* __MigTypeCheck */
1413
1414 return MACH_MSG_SUCCESS;
1415}
1416#endif /* !defined(__MIG_check__Request__io_registry_iterator_enter_entry_t__defined) */
1417#endif /* __MIG_check__Request__iokit_subsystem__ */
1418#endif /* ( __MigTypeCheck ) */
1419
1420
1421/* Routine io_registry_iterator_enter_entry */
1422mig_internal novalue _Xio_registry_iterator_enter_entry
1423 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
1424 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
1425 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
1426{
1427
1428#ifdef __MigPackStructs
1429#pragma pack(push, 4)
1430#endif
1431 typedef struct {
1432 mach_msg_trailer_t trailer;
1433 char padding[0]; /* Avoid generating empty UData structs */
1434 } RequestU __attribute__((unused));
1435#ifdef __MigPackStructs
1436#pragma pack(pop)
1437#endif
1438 typedef __RequestKData__io_registry_iterator_enter_entry_t RequestK;
1439 typedef __RequestUData__io_registry_iterator_enter_entry_t __RequestU;
1440 typedef __ReplyKData__io_registry_iterator_enter_entry_t ReplyK __attribute__((unused));
1441 typedef __ReplyUData__io_registry_iterator_enter_entry_t ReplyU __attribute__((unused));
1442 typedef __Reply__io_registry_iterator_enter_entry_t Reply __attribute__((unused));
1443 typedef __Request__io_registry_iterator_enter_entry_t __Request __attribute__((unused));
1444
1445 /*
1446 * typedef struct {
1447 * mach_msg_header_t Head;
1448 * NDR_record_t NDR;
1449 * kern_return_t RetCode;
1450 * } mig_reply_error_t;
1451 */
1452
1453 RequestK *InKP = (RequestK *) InHeadP;
1454 RequestU *In0UP = (RequestU *) InDataP;
1455 ReplyK *OutKP = (ReplyK *) OutHeadP;
1456 ReplyU *OutUP = (ReplyU *) OutDataP;
1457 (void)OutUP;
1458#ifdef __MIG_check__Request__io_registry_iterator_enter_entry_t__defined
1459 kern_return_t check_result;
1460#endif /* __MIG_check__Request__io_registry_iterator_enter_entry_t__defined */
1461
1462#if __MigKernelSpecificCode
1463#else
1464#endif /* __MigKernelSpecificCode */
1465 io_object_t iterator;
1466
1467 __DeclareRcvRpc(2807, "io_registry_iterator_enter_entry")
1468 __BeforeRcvRpc(2807, "io_registry_iterator_enter_entry")
1469
1470#if defined(__MIG_check__Request__io_registry_iterator_enter_entry_t__defined)
1471 check_result = __MIG_check__Request__io_registry_iterator_enter_entry_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
1472 if (check_result != MACH_MSG_SUCCESS)
1473 { MIG_RETURN_ERROR(OutKP, check_result); }
1474#endif /* defined(__MIG_check__Request__io_registry_iterator_enter_entry_t__defined) */
1475
1476 iterator = iokit_lookup_object_port(port: InKP->Head.msgh_request_port);
1477
1478 OutUP->RetCode = is_io_registry_iterator_enter_entry(iterator);
1479 iokit_remove_reference(obj: iterator);
1480#if __MigKernelSpecificCode
1481#endif /* __MigKernelSpecificCode */
1482
1483 OutUP->NDR = NDR_record;
1484
1485
1486 __AfterRcvRpc(2807, "io_registry_iterator_enter_entry")
1487}
1488
1489#if ( __MigTypeCheck )
1490#if __MIG_check__Request__iokit_subsystem__
1491#if !defined(__MIG_check__Request__io_registry_iterator_exit_entry_t__defined)
1492#define __MIG_check__Request__io_registry_iterator_exit_entry_t__defined
1493
1494mig_internal kern_return_t __MIG_check__Request__io_registry_iterator_exit_entry_t(
1495 __attribute__((__unused__)) __RequestKData__io_registry_iterator_exit_entry_t *InKP,
1496 __attribute__((__unused__)) __RequestUData__io_registry_iterator_exit_entry_t *In0UP,
1497 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
1498{
1499
1500 typedef __Request__io_registry_iterator_exit_entry_t __Request;
1501 typedef __RequestUData__io_registry_iterator_exit_entry_t __RequestU __attribute__((unused));
1502#if __MigTypeCheck
1503 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
1504 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
1505 return MIG_BAD_ARGUMENTS;
1506#endif /* __MigTypeCheck */
1507
1508 return MACH_MSG_SUCCESS;
1509}
1510#endif /* !defined(__MIG_check__Request__io_registry_iterator_exit_entry_t__defined) */
1511#endif /* __MIG_check__Request__iokit_subsystem__ */
1512#endif /* ( __MigTypeCheck ) */
1513
1514
1515/* Routine io_registry_iterator_exit_entry */
1516mig_internal novalue _Xio_registry_iterator_exit_entry
1517 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
1518 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
1519 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
1520{
1521
1522#ifdef __MigPackStructs
1523#pragma pack(push, 4)
1524#endif
1525 typedef struct {
1526 mach_msg_trailer_t trailer;
1527 char padding[0]; /* Avoid generating empty UData structs */
1528 } RequestU __attribute__((unused));
1529#ifdef __MigPackStructs
1530#pragma pack(pop)
1531#endif
1532 typedef __RequestKData__io_registry_iterator_exit_entry_t RequestK;
1533 typedef __RequestUData__io_registry_iterator_exit_entry_t __RequestU;
1534 typedef __ReplyKData__io_registry_iterator_exit_entry_t ReplyK __attribute__((unused));
1535 typedef __ReplyUData__io_registry_iterator_exit_entry_t ReplyU __attribute__((unused));
1536 typedef __Reply__io_registry_iterator_exit_entry_t Reply __attribute__((unused));
1537 typedef __Request__io_registry_iterator_exit_entry_t __Request __attribute__((unused));
1538
1539 /*
1540 * typedef struct {
1541 * mach_msg_header_t Head;
1542 * NDR_record_t NDR;
1543 * kern_return_t RetCode;
1544 * } mig_reply_error_t;
1545 */
1546
1547 RequestK *InKP = (RequestK *) InHeadP;
1548 RequestU *In0UP = (RequestU *) InDataP;
1549 ReplyK *OutKP = (ReplyK *) OutHeadP;
1550 ReplyU *OutUP = (ReplyU *) OutDataP;
1551 (void)OutUP;
1552#ifdef __MIG_check__Request__io_registry_iterator_exit_entry_t__defined
1553 kern_return_t check_result;
1554#endif /* __MIG_check__Request__io_registry_iterator_exit_entry_t__defined */
1555
1556#if __MigKernelSpecificCode
1557#else
1558#endif /* __MigKernelSpecificCode */
1559 io_object_t iterator;
1560
1561 __DeclareRcvRpc(2808, "io_registry_iterator_exit_entry")
1562 __BeforeRcvRpc(2808, "io_registry_iterator_exit_entry")
1563
1564#if defined(__MIG_check__Request__io_registry_iterator_exit_entry_t__defined)
1565 check_result = __MIG_check__Request__io_registry_iterator_exit_entry_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
1566 if (check_result != MACH_MSG_SUCCESS)
1567 { MIG_RETURN_ERROR(OutKP, check_result); }
1568#endif /* defined(__MIG_check__Request__io_registry_iterator_exit_entry_t__defined) */
1569
1570 iterator = iokit_lookup_object_port(port: InKP->Head.msgh_request_port);
1571
1572 OutUP->RetCode = is_io_registry_iterator_exit_entry(iterator);
1573 iokit_remove_reference(obj: iterator);
1574#if __MigKernelSpecificCode
1575#endif /* __MigKernelSpecificCode */
1576
1577 OutUP->NDR = NDR_record;
1578
1579
1580 __AfterRcvRpc(2808, "io_registry_iterator_exit_entry")
1581}
1582
1583#if ( __MigTypeCheck )
1584#if __MIG_check__Request__iokit_subsystem__
1585#if !defined(__MIG_check__Request__io_registry_entry_from_path_t__defined)
1586#define __MIG_check__Request__io_registry_entry_from_path_t__defined
1587
1588mig_internal kern_return_t __MIG_check__Request__io_registry_entry_from_path_t(
1589 __attribute__((__unused__)) __RequestKData__io_registry_entry_from_path_t *InKP,
1590 __attribute__((__unused__)) __RequestUData__io_registry_entry_from_path_t *In0UP,
1591 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
1592{
1593
1594 typedef __Request__io_registry_entry_from_path_t __Request;
1595 typedef __RequestUData__io_registry_entry_from_path_t __RequestU __attribute__((unused));
1596#if __MigTypeCheck
1597 unsigned int msgh_size;
1598#endif /* __MigTypeCheck */
1599
1600#if __MigTypeCheck
1601 msgh_size = InKP->Head.msgh_size;
1602 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
1603 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 512)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
1604 return MIG_BAD_ARGUMENTS;
1605#endif /* __MigTypeCheck */
1606
1607#if defined(__NDR_convert__int_rep__Request__io_registry_entry_from_path_t__pathCnt__defined)
1608 if (In0UP->NDR.int_rep != NDR_record.int_rep)
1609 __NDR_convert__int_rep__Request__io_registry_entry_from_path_t__pathCnt(&In0UP->pathCnt, In0UP->NDR.int_rep);
1610#endif /* __NDR_convert__int_rep__Request__io_registry_entry_from_path_t__pathCnt__defined */
1611#if __MigTypeCheck
1612 if (In0UP->pathCnt > 512)
1613 return MIG_BAD_ARGUMENTS;
1614 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 512)) < In0UP->pathCnt) ||
1615 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 512) + _WALIGN_(In0UP->pathCnt)))
1616 return MIG_BAD_ARGUMENTS;
1617#endif /* __MigTypeCheck */
1618
1619#if __MigTypeCheck
1620 {
1621 char * msg_limit = (char *) InTrailerP;
1622#if __MigKernelSpecificCode
1623 size_t strnlen_limit;
1624#else
1625 size_t memchr_limit;
1626#endif /* __MigKernelSpecificCode */
1627
1628#if __MigKernelSpecificCode
1629 strnlen_limit = min((msg_limit - In0UP->path), 512);
1630 if (( strnlen(s: In0UP->path, n: strnlen_limit) >= 512 + 1 ))
1631 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
1632#else
1633 memchr_limit = min((msg_limit - In0UP->path), 512);
1634 if (( memchr(In0UP->path, '\0', memchr_limit) == NULL ))
1635 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
1636#endif /* __MigKernelSpecificCode */
1637 }
1638#endif /* __MigTypeCheck */
1639
1640 return MACH_MSG_SUCCESS;
1641}
1642#endif /* !defined(__MIG_check__Request__io_registry_entry_from_path_t__defined) */
1643#endif /* __MIG_check__Request__iokit_subsystem__ */
1644#endif /* ( __MigTypeCheck ) */
1645
1646
1647/* Routine io_registry_entry_from_path */
1648mig_internal novalue _Xio_registry_entry_from_path
1649 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
1650 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
1651 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
1652{
1653
1654#ifdef __MigPackStructs
1655#pragma pack(push, 4)
1656#endif
1657 typedef struct {
1658 NDR_record_t NDR;
1659 mach_msg_type_number_t pathOffset; /* MiG doesn't use it */
1660 mach_msg_type_number_t pathCnt;
1661 char path[512];
1662 mach_msg_trailer_t trailer;
1663 char padding[0]; /* Avoid generating empty UData structs */
1664 } RequestU __attribute__((unused));
1665#ifdef __MigPackStructs
1666#pragma pack(pop)
1667#endif
1668 typedef __RequestKData__io_registry_entry_from_path_t RequestK;
1669 typedef __RequestUData__io_registry_entry_from_path_t __RequestU;
1670 typedef __ReplyKData__io_registry_entry_from_path_t ReplyK __attribute__((unused));
1671 typedef __ReplyUData__io_registry_entry_from_path_t ReplyU __attribute__((unused));
1672 typedef __Reply__io_registry_entry_from_path_t Reply __attribute__((unused));
1673 typedef __Request__io_registry_entry_from_path_t __Request __attribute__((unused));
1674
1675 /*
1676 * typedef struct {
1677 * mach_msg_header_t Head;
1678 * NDR_record_t NDR;
1679 * kern_return_t RetCode;
1680 * } mig_reply_error_t;
1681 */
1682
1683 RequestK *InKP = (RequestK *) InHeadP;
1684 RequestU *In0UP = (RequestU *) InDataP;
1685 ReplyK *OutKP = (ReplyK *) OutHeadP;
1686 ReplyU *OutUP = (ReplyU *) OutDataP;
1687 (void)OutUP;
1688#ifdef __MIG_check__Request__io_registry_entry_from_path_t__defined
1689 kern_return_t check_result;
1690#endif /* __MIG_check__Request__io_registry_entry_from_path_t__defined */
1691
1692#if __MigKernelSpecificCode
1693#if UseStaticTemplates
1694 const static mach_msg_port_descriptor_t registry_entryTemplate = {
1695 /* name = */ MACH_PORT_NULL,
1696 /* pad1 = */ 0,
1697 /* pad2 = */ 0,
1698 /* disp = */ 17,
1699 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
1700 };
1701#endif /* UseStaticTemplates */
1702
1703#else
1704#if UseStaticTemplates
1705 const static mach_msg_port_descriptor_t registry_entryTemplate = {
1706 /* name = */ MACH_PORT_NULL,
1707 /* pad1 = */ 0,
1708 /* pad2 = */ 0,
1709 /* disp = */ 19,
1710 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
1711 };
1712#endif /* UseStaticTemplates */
1713
1714#endif /* __MigKernelSpecificCode */
1715 kern_return_t RetCode;
1716 io_object_t registry_entry;
1717
1718 __DeclareRcvRpc(2809, "io_registry_entry_from_path")
1719 __BeforeRcvRpc(2809, "io_registry_entry_from_path")
1720
1721#if defined(__MIG_check__Request__io_registry_entry_from_path_t__defined)
1722 check_result = __MIG_check__Request__io_registry_entry_from_path_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
1723 if (check_result != MACH_MSG_SUCCESS)
1724 { MIG_RETURN_ERROR(OutKP, check_result); }
1725#endif /* defined(__MIG_check__Request__io_registry_entry_from_path_t__defined) */
1726
1727#if UseStaticTemplates
1728 OutKP->registry_entry = registry_entryTemplate;
1729#else /* UseStaticTemplates */
1730#if __MigKernelSpecificCode
1731 OutKP->registry_entry.disposition = 17;
1732#else
1733 OutKP->registry_entry.disposition = 19;
1734#endif /* __MigKernelSpecificCode */
1735#if !(defined(KERNEL) && defined(__LP64__))
1736 OutKP->registry_entry.pad1 = 0;
1737#endif
1738 OutKP->registry_entry.pad2 = 0;
1739 OutKP->registry_entry.type = MACH_MSG_PORT_DESCRIPTOR;
1740#if defined(KERNEL)
1741 OutKP->registry_entry.pad_end = 0;
1742#endif
1743#endif /* UseStaticTemplates */
1744
1745
1746 RetCode = is_io_registry_entry_from_path(main_port: InKP->Head.msgh_request_port, path: In0UP->path, registry_entry: &registry_entry);
1747 if (RetCode != KERN_SUCCESS) {
1748 MIG_RETURN_ERROR(OutKP, RetCode);
1749 }
1750#if __MigKernelSpecificCode
1751#endif /* __MigKernelSpecificCode */
1752 OutKP->registry_entry.name = (mach_port_t)iokit_make_object_port(obj: registry_entry);
1753
1754
1755 OutKP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
1756 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
1757 OutKP->msgh_body.msgh_descriptor_count = 1;
1758 __AfterRcvRpc(2809, "io_registry_entry_from_path")
1759}
1760
1761#if ( __MigTypeCheck )
1762#if __MIG_check__Request__iokit_subsystem__
1763#if !defined(__MIG_check__Request__io_registry_entry_get_name_t__defined)
1764#define __MIG_check__Request__io_registry_entry_get_name_t__defined
1765
1766mig_internal kern_return_t __MIG_check__Request__io_registry_entry_get_name_t(
1767 __attribute__((__unused__)) __RequestKData__io_registry_entry_get_name_t *InKP,
1768 __attribute__((__unused__)) __RequestUData__io_registry_entry_get_name_t *In0UP,
1769 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
1770{
1771
1772 typedef __Request__io_registry_entry_get_name_t __Request;
1773 typedef __RequestUData__io_registry_entry_get_name_t __RequestU __attribute__((unused));
1774#if __MigTypeCheck
1775 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
1776 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
1777 return MIG_BAD_ARGUMENTS;
1778#endif /* __MigTypeCheck */
1779
1780 return MACH_MSG_SUCCESS;
1781}
1782#endif /* !defined(__MIG_check__Request__io_registry_entry_get_name_t__defined) */
1783#endif /* __MIG_check__Request__iokit_subsystem__ */
1784#endif /* ( __MigTypeCheck ) */
1785
1786
1787/* Routine io_registry_entry_get_name */
1788mig_internal novalue _Xio_registry_entry_get_name
1789 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
1790 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
1791 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
1792{
1793
1794#ifdef __MigPackStructs
1795#pragma pack(push, 4)
1796#endif
1797 typedef struct {
1798 mach_msg_trailer_t trailer;
1799 char padding[0]; /* Avoid generating empty UData structs */
1800 } RequestU __attribute__((unused));
1801#ifdef __MigPackStructs
1802#pragma pack(pop)
1803#endif
1804 typedef __RequestKData__io_registry_entry_get_name_t RequestK;
1805 typedef __RequestUData__io_registry_entry_get_name_t __RequestU;
1806 typedef __ReplyKData__io_registry_entry_get_name_t ReplyK __attribute__((unused));
1807 typedef __ReplyUData__io_registry_entry_get_name_t ReplyU __attribute__((unused));
1808 typedef __Reply__io_registry_entry_get_name_t Reply __attribute__((unused));
1809 typedef __Request__io_registry_entry_get_name_t __Request __attribute__((unused));
1810
1811 /*
1812 * typedef struct {
1813 * mach_msg_header_t Head;
1814 * NDR_record_t NDR;
1815 * kern_return_t RetCode;
1816 * } mig_reply_error_t;
1817 */
1818
1819 RequestK *InKP = (RequestK *) InHeadP;
1820 RequestU *In0UP = (RequestU *) InDataP;
1821 ReplyK *OutKP = (ReplyK *) OutHeadP;
1822 ReplyU *OutUP = (ReplyU *) OutDataP;
1823 (void)OutUP;
1824#ifdef __MIG_check__Request__io_registry_entry_get_name_t__defined
1825 kern_return_t check_result;
1826#endif /* __MIG_check__Request__io_registry_entry_get_name_t__defined */
1827
1828#if __MigKernelSpecificCode
1829#else
1830#endif /* __MigKernelSpecificCode */
1831 io_object_t registry_entry;
1832
1833 __DeclareRcvRpc(2810, "io_registry_entry_get_name")
1834 __BeforeRcvRpc(2810, "io_registry_entry_get_name")
1835
1836#if defined(__MIG_check__Request__io_registry_entry_get_name_t__defined)
1837 check_result = __MIG_check__Request__io_registry_entry_get_name_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
1838 if (check_result != MACH_MSG_SUCCESS)
1839 { MIG_RETURN_ERROR(OutKP, check_result); }
1840#endif /* defined(__MIG_check__Request__io_registry_entry_get_name_t__defined) */
1841
1842 registry_entry = iokit_lookup_object_port(port: InKP->Head.msgh_request_port);
1843
1844 OutUP->RetCode = is_io_registry_entry_get_name(registry_entry, name: OutUP->name);
1845 iokit_remove_reference(obj: registry_entry);
1846 if (OutUP->RetCode != KERN_SUCCESS) {
1847 MIG_RETURN_ERROR(OutKP, OutUP->RetCode);
1848 }
1849#if __MigKernelSpecificCode
1850#endif /* __MigKernelSpecificCode */
1851
1852 OutUP->NDR = NDR_record;
1853
1854#ifdef __LP64__
1855 {
1856 size_t strLength = strlen(s: OutUP->name) + 1;
1857 if (strLength > 0xffffffff)
1858 MIG_RETURN_ERROR(OutKP, MIG_BAD_ARGUMENTS);
1859 OutUP->nameCnt = (mach_msg_type_number_t) strLength;
1860 }
1861#else
1862 OutUP->nameCnt = (mach_msg_type_number_t) strlen(OutUP->name) + 1;
1863#endif /* __LP64__ */
1864 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 128) + (_WALIGN_((OutUP->nameCnt + 3) & ~3));
1865
1866 __AfterRcvRpc(2810, "io_registry_entry_get_name")
1867}
1868
1869#if ( __MigTypeCheck )
1870#if __MIG_check__Request__iokit_subsystem__
1871#if !defined(__MIG_check__Request__io_registry_entry_get_properties_t__defined)
1872#define __MIG_check__Request__io_registry_entry_get_properties_t__defined
1873
1874mig_internal kern_return_t __MIG_check__Request__io_registry_entry_get_properties_t(
1875 __attribute__((__unused__)) __RequestKData__io_registry_entry_get_properties_t *InKP,
1876 __attribute__((__unused__)) __RequestUData__io_registry_entry_get_properties_t *In0UP,
1877 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
1878{
1879
1880 typedef __Request__io_registry_entry_get_properties_t __Request;
1881 typedef __RequestUData__io_registry_entry_get_properties_t __RequestU __attribute__((unused));
1882#if __MigTypeCheck
1883 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
1884 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
1885 return MIG_BAD_ARGUMENTS;
1886#endif /* __MigTypeCheck */
1887
1888 return MACH_MSG_SUCCESS;
1889}
1890#endif /* !defined(__MIG_check__Request__io_registry_entry_get_properties_t__defined) */
1891#endif /* __MIG_check__Request__iokit_subsystem__ */
1892#endif /* ( __MigTypeCheck ) */
1893
1894
1895/* Routine io_registry_entry_get_properties */
1896mig_internal novalue _Xio_registry_entry_get_properties
1897 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
1898 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
1899 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
1900{
1901
1902#ifdef __MigPackStructs
1903#pragma pack(push, 4)
1904#endif
1905 typedef struct {
1906 mach_msg_trailer_t trailer;
1907 char padding[0]; /* Avoid generating empty UData structs */
1908 } RequestU __attribute__((unused));
1909#ifdef __MigPackStructs
1910#pragma pack(pop)
1911#endif
1912 typedef __RequestKData__io_registry_entry_get_properties_t RequestK;
1913 typedef __RequestUData__io_registry_entry_get_properties_t __RequestU;
1914 typedef __ReplyKData__io_registry_entry_get_properties_t ReplyK __attribute__((unused));
1915 typedef __ReplyUData__io_registry_entry_get_properties_t ReplyU __attribute__((unused));
1916 typedef __Reply__io_registry_entry_get_properties_t Reply __attribute__((unused));
1917 typedef __Request__io_registry_entry_get_properties_t __Request __attribute__((unused));
1918
1919 /*
1920 * typedef struct {
1921 * mach_msg_header_t Head;
1922 * NDR_record_t NDR;
1923 * kern_return_t RetCode;
1924 * } mig_reply_error_t;
1925 */
1926
1927 RequestK *InKP = (RequestK *) InHeadP;
1928 RequestU *In0UP = (RequestU *) InDataP;
1929 ReplyK *OutKP = (ReplyK *) OutHeadP;
1930 ReplyU *OutUP = (ReplyU *) OutDataP;
1931 (void)OutUP;
1932#ifdef __MIG_check__Request__io_registry_entry_get_properties_t__defined
1933 kern_return_t check_result;
1934#endif /* __MIG_check__Request__io_registry_entry_get_properties_t__defined */
1935
1936#if __MigKernelSpecificCode
1937#if UseStaticTemplates
1938 const static mach_msg_ool_descriptor_t propertiesTemplate = {
1939 /* addr = */ (void *)0,
1940 /* size = */ 0,
1941 /* deal = */ FALSE,
1942 /* copy = */ MACH_MSG_PHYSICAL_COPY,
1943 /* pad2 = */ 0,
1944 /* type = */ MACH_MSG_OOL_DESCRIPTOR,
1945 };
1946#endif /* UseStaticTemplates */
1947
1948#else
1949#if UseStaticTemplates
1950 const static mach_msg_ool_descriptor_t propertiesTemplate = {
1951 /* addr = */ (void *)0,
1952 /* size = */ 0,
1953 /* deal = */ FALSE,
1954 /* copy = */ MACH_MSG_PHYSICAL_COPY,
1955 /* pad2 = */ 0,
1956 /* type = */ MACH_MSG_OOL_DESCRIPTOR,
1957 };
1958#endif /* UseStaticTemplates */
1959
1960#endif /* __MigKernelSpecificCode */
1961 kern_return_t RetCode;
1962 io_object_t registry_entry;
1963
1964 __DeclareRcvRpc(2811, "io_registry_entry_get_properties")
1965 __BeforeRcvRpc(2811, "io_registry_entry_get_properties")
1966
1967#if defined(__MIG_check__Request__io_registry_entry_get_properties_t__defined)
1968 check_result = __MIG_check__Request__io_registry_entry_get_properties_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
1969 if (check_result != MACH_MSG_SUCCESS)
1970 { MIG_RETURN_ERROR(OutKP, check_result); }
1971#endif /* defined(__MIG_check__Request__io_registry_entry_get_properties_t__defined) */
1972
1973#if UseStaticTemplates
1974 OutKP->properties = propertiesTemplate;
1975#else /* UseStaticTemplates */
1976 OutKP->properties.deallocate = FALSE;
1977 OutKP->properties.copy = MACH_MSG_PHYSICAL_COPY;
1978 OutKP->properties.pad1 = 0;
1979 OutKP->properties.type = MACH_MSG_OOL_DESCRIPTOR;
1980#if defined(KERNEL) && !defined(__LP64__)
1981 OutKP->properties.pad_end = 0;
1982#endif
1983#endif /* UseStaticTemplates */
1984
1985
1986 registry_entry = iokit_lookup_object_port(port: InKP->Head.msgh_request_port);
1987
1988 RetCode = is_io_registry_entry_get_properties(registry_entry, properties: (io_buf_ptr_t *)&(OutKP->properties.address), propertiesCnt: &OutUP->propertiesCnt);
1989 iokit_remove_reference(obj: registry_entry);
1990 if (RetCode != KERN_SUCCESS) {
1991 MIG_RETURN_ERROR(OutKP, RetCode);
1992 }
1993#if __MigKernelSpecificCode
1994#endif /* __MigKernelSpecificCode */
1995 OutKP->properties.size = OutUP->propertiesCnt;
1996
1997
1998 OutUP->NDR = NDR_record;
1999
2000
2001 OutKP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
2002 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
2003 OutKP->msgh_body.msgh_descriptor_count = 1;
2004 __AfterRcvRpc(2811, "io_registry_entry_get_properties")
2005}
2006
2007#if ( __MigTypeCheck )
2008#if __MIG_check__Request__iokit_subsystem__
2009#if !defined(__MIG_check__Request__io_registry_entry_get_property_bytes_t__defined)
2010#define __MIG_check__Request__io_registry_entry_get_property_bytes_t__defined
2011
2012mig_internal kern_return_t __MIG_check__Request__io_registry_entry_get_property_bytes_t(
2013 __attribute__((__unused__)) __RequestKData__io_registry_entry_get_property_bytes_t *InKP,
2014 __attribute__((__unused__)) __RequestUData__io_registry_entry_get_property_bytes_t *In0UP,
2015 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
2016 __attribute__((__unused__)) __RequestUData__io_registry_entry_get_property_bytes_t **In1UPP)
2017{
2018
2019 typedef __Request__io_registry_entry_get_property_bytes_t __Request;
2020 typedef __RequestUData__io_registry_entry_get_property_bytes_t __RequestU __attribute__((unused));
2021 __RequestU *In1UP;
2022#if __MigTypeCheck
2023 unsigned int msgh_size;
2024#endif /* __MigTypeCheck */
2025 unsigned int msgh_size_delta;
2026
2027#if __MigTypeCheck
2028 msgh_size = InKP->Head.msgh_size;
2029 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
2030 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 128)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
2031 return MIG_BAD_ARGUMENTS;
2032#endif /* __MigTypeCheck */
2033
2034#if defined(__NDR_convert__int_rep__Request__io_registry_entry_get_property_bytes_t__property_nameCnt__defined)
2035 if (In0UP->NDR.int_rep != NDR_record.int_rep)
2036 __NDR_convert__int_rep__Request__io_registry_entry_get_property_bytes_t__property_nameCnt(&In0UP->property_nameCnt, In0UP->NDR.int_rep);
2037#endif /* __NDR_convert__int_rep__Request__io_registry_entry_get_property_bytes_t__property_nameCnt__defined */
2038 msgh_size_delta = _WALIGN_(In0UP->property_nameCnt);
2039#if __MigTypeCheck
2040 if (In0UP->property_nameCnt > 128)
2041 return MIG_BAD_ARGUMENTS;
2042 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 128)) < In0UP->property_nameCnt) ||
2043 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 128) + _WALIGN_(In0UP->property_nameCnt)))
2044 return MIG_BAD_ARGUMENTS;
2045#endif /* __MigTypeCheck */
2046
2047 *In1UPP = In1UP = (__RequestU *) ((pointer_t) In0UP + msgh_size_delta - 128);
2048
2049#if __MigTypeCheck
2050 {
2051 char * msg_limit = (char *) InTrailerP;
2052#if __MigKernelSpecificCode
2053 size_t strnlen_limit;
2054#else
2055 size_t memchr_limit;
2056#endif /* __MigKernelSpecificCode */
2057
2058#if __MigKernelSpecificCode
2059 strnlen_limit = min((msg_limit - In0UP->property_name), 128);
2060 if (( strnlen(s: In0UP->property_name, n: strnlen_limit) >= 128 + 1 ))
2061 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
2062#else
2063 memchr_limit = min((msg_limit - In0UP->property_name), 128);
2064 if (( memchr(In0UP->property_name, '\0', memchr_limit) == NULL ))
2065 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
2066#endif /* __MigKernelSpecificCode */
2067 }
2068#endif /* __MigTypeCheck */
2069
2070 return MACH_MSG_SUCCESS;
2071}
2072#endif /* !defined(__MIG_check__Request__io_registry_entry_get_property_bytes_t__defined) */
2073#endif /* __MIG_check__Request__iokit_subsystem__ */
2074#endif /* ( __MigTypeCheck ) */
2075
2076
2077/* Routine io_registry_entry_get_property_bytes */
2078mig_internal novalue _Xio_registry_entry_get_property_bytes
2079 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
2080 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
2081 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
2082{
2083
2084#ifdef __MigPackStructs
2085#pragma pack(push, 4)
2086#endif
2087 typedef struct {
2088 NDR_record_t NDR;
2089 mach_msg_type_number_t property_nameOffset; /* MiG doesn't use it */
2090 mach_msg_type_number_t property_nameCnt;
2091 char property_name[128];
2092 mach_msg_type_number_t dataCnt;
2093 mach_msg_trailer_t trailer;
2094 char padding[0]; /* Avoid generating empty UData structs */
2095 } RequestU __attribute__((unused));
2096#ifdef __MigPackStructs
2097#pragma pack(pop)
2098#endif
2099 typedef __RequestKData__io_registry_entry_get_property_bytes_t RequestK;
2100 typedef __RequestUData__io_registry_entry_get_property_bytes_t __RequestU;
2101 typedef __ReplyKData__io_registry_entry_get_property_bytes_t ReplyK __attribute__((unused));
2102 typedef __ReplyUData__io_registry_entry_get_property_bytes_t ReplyU __attribute__((unused));
2103 typedef __Reply__io_registry_entry_get_property_bytes_t Reply __attribute__((unused));
2104 typedef __Request__io_registry_entry_get_property_bytes_t __Request __attribute__((unused));
2105
2106 /*
2107 * typedef struct {
2108 * mach_msg_header_t Head;
2109 * NDR_record_t NDR;
2110 * kern_return_t RetCode;
2111 * } mig_reply_error_t;
2112 */
2113
2114 RequestK *InKP = (RequestK *) InHeadP;
2115 RequestU *In0UP = (RequestU *) InDataP;
2116 RequestU *In1UP;
2117 ReplyK *OutKP = (ReplyK *) OutHeadP;
2118 ReplyU *OutUP = (ReplyU *) OutDataP;
2119 (void)OutUP;
2120#ifdef __MIG_check__Request__io_registry_entry_get_property_bytes_t__defined
2121 kern_return_t check_result;
2122#endif /* __MIG_check__Request__io_registry_entry_get_property_bytes_t__defined */
2123
2124#if __MigKernelSpecificCode
2125#else
2126#endif /* __MigKernelSpecificCode */
2127 io_object_t registry_entry;
2128
2129 __DeclareRcvRpc(2812, "io_registry_entry_get_property_bytes")
2130 __BeforeRcvRpc(2812, "io_registry_entry_get_property_bytes")
2131
2132#if defined(__MIG_check__Request__io_registry_entry_get_property_bytes_t__defined)
2133 check_result = __MIG_check__Request__io_registry_entry_get_property_bytes_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP, In1UPP: (__RequestU **)&In1UP);
2134 if (check_result != MACH_MSG_SUCCESS)
2135 { MIG_RETURN_ERROR(OutKP, check_result); }
2136#endif /* defined(__MIG_check__Request__io_registry_entry_get_property_bytes_t__defined) */
2137
2138 registry_entry = iokit_lookup_object_port(port: InKP->Head.msgh_request_port);
2139
2140 OutUP->dataCnt = 4096;
2141 if (In1UP->dataCnt < OutUP->dataCnt)
2142 OutUP->dataCnt = In1UP->dataCnt;
2143
2144 OutUP->RetCode = is_io_registry_entry_get_property_bytes(registry_entry, property_name: In0UP->property_name, data: OutUP->data, dataCnt: &OutUP->dataCnt);
2145 iokit_remove_reference(obj: registry_entry);
2146 if (OutUP->RetCode != KERN_SUCCESS) {
2147 MIG_RETURN_ERROR(OutKP, OutUP->RetCode);
2148 }
2149#if __MigKernelSpecificCode
2150#endif /* __MigKernelSpecificCode */
2151
2152 OutUP->NDR = NDR_record;
2153
2154 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 4096) + (_WALIGN_((OutUP->dataCnt + 3) & ~3));
2155
2156 __AfterRcvRpc(2812, "io_registry_entry_get_property_bytes")
2157}
2158
2159#if ( __MigTypeCheck )
2160#if __MIG_check__Request__iokit_subsystem__
2161#if !defined(__MIG_check__Request__io_registry_entry_get_child_iterator_t__defined)
2162#define __MIG_check__Request__io_registry_entry_get_child_iterator_t__defined
2163
2164mig_internal kern_return_t __MIG_check__Request__io_registry_entry_get_child_iterator_t(
2165 __attribute__((__unused__)) __RequestKData__io_registry_entry_get_child_iterator_t *InKP,
2166 __attribute__((__unused__)) __RequestUData__io_registry_entry_get_child_iterator_t *In0UP,
2167 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
2168{
2169
2170 typedef __Request__io_registry_entry_get_child_iterator_t __Request;
2171 typedef __RequestUData__io_registry_entry_get_child_iterator_t __RequestU __attribute__((unused));
2172#if __MigTypeCheck
2173 unsigned int msgh_size;
2174#endif /* __MigTypeCheck */
2175
2176#if __MigTypeCheck
2177 msgh_size = InKP->Head.msgh_size;
2178 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
2179 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 128)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
2180 return MIG_BAD_ARGUMENTS;
2181#endif /* __MigTypeCheck */
2182
2183#if defined(__NDR_convert__int_rep__Request__io_registry_entry_get_child_iterator_t__planeCnt__defined)
2184 if (In0UP->NDR.int_rep != NDR_record.int_rep)
2185 __NDR_convert__int_rep__Request__io_registry_entry_get_child_iterator_t__planeCnt(&In0UP->planeCnt, In0UP->NDR.int_rep);
2186#endif /* __NDR_convert__int_rep__Request__io_registry_entry_get_child_iterator_t__planeCnt__defined */
2187#if __MigTypeCheck
2188 if (In0UP->planeCnt > 128)
2189 return MIG_BAD_ARGUMENTS;
2190 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 128)) < In0UP->planeCnt) ||
2191 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 128) + _WALIGN_(In0UP->planeCnt)))
2192 return MIG_BAD_ARGUMENTS;
2193#endif /* __MigTypeCheck */
2194
2195#if __MigTypeCheck
2196 {
2197 char * msg_limit = (char *) InTrailerP;
2198#if __MigKernelSpecificCode
2199 size_t strnlen_limit;
2200#else
2201 size_t memchr_limit;
2202#endif /* __MigKernelSpecificCode */
2203
2204#if __MigKernelSpecificCode
2205 strnlen_limit = min((msg_limit - In0UP->plane), 128);
2206 if (( strnlen(s: In0UP->plane, n: strnlen_limit) >= 128 + 1 ))
2207 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
2208#else
2209 memchr_limit = min((msg_limit - In0UP->plane), 128);
2210 if (( memchr(In0UP->plane, '\0', memchr_limit) == NULL ))
2211 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
2212#endif /* __MigKernelSpecificCode */
2213 }
2214#endif /* __MigTypeCheck */
2215
2216 return MACH_MSG_SUCCESS;
2217}
2218#endif /* !defined(__MIG_check__Request__io_registry_entry_get_child_iterator_t__defined) */
2219#endif /* __MIG_check__Request__iokit_subsystem__ */
2220#endif /* ( __MigTypeCheck ) */
2221
2222
2223/* Routine io_registry_entry_get_child_iterator */
2224mig_internal novalue _Xio_registry_entry_get_child_iterator
2225 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
2226 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
2227 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
2228{
2229
2230#ifdef __MigPackStructs
2231#pragma pack(push, 4)
2232#endif
2233 typedef struct {
2234 NDR_record_t NDR;
2235 mach_msg_type_number_t planeOffset; /* MiG doesn't use it */
2236 mach_msg_type_number_t planeCnt;
2237 char plane[128];
2238 mach_msg_trailer_t trailer;
2239 char padding[0]; /* Avoid generating empty UData structs */
2240 } RequestU __attribute__((unused));
2241#ifdef __MigPackStructs
2242#pragma pack(pop)
2243#endif
2244 typedef __RequestKData__io_registry_entry_get_child_iterator_t RequestK;
2245 typedef __RequestUData__io_registry_entry_get_child_iterator_t __RequestU;
2246 typedef __ReplyKData__io_registry_entry_get_child_iterator_t ReplyK __attribute__((unused));
2247 typedef __ReplyUData__io_registry_entry_get_child_iterator_t ReplyU __attribute__((unused));
2248 typedef __Reply__io_registry_entry_get_child_iterator_t Reply __attribute__((unused));
2249 typedef __Request__io_registry_entry_get_child_iterator_t __Request __attribute__((unused));
2250
2251 /*
2252 * typedef struct {
2253 * mach_msg_header_t Head;
2254 * NDR_record_t NDR;
2255 * kern_return_t RetCode;
2256 * } mig_reply_error_t;
2257 */
2258
2259 RequestK *InKP = (RequestK *) InHeadP;
2260 RequestU *In0UP = (RequestU *) InDataP;
2261 ReplyK *OutKP = (ReplyK *) OutHeadP;
2262 ReplyU *OutUP = (ReplyU *) OutDataP;
2263 (void)OutUP;
2264#ifdef __MIG_check__Request__io_registry_entry_get_child_iterator_t__defined
2265 kern_return_t check_result;
2266#endif /* __MIG_check__Request__io_registry_entry_get_child_iterator_t__defined */
2267
2268#if __MigKernelSpecificCode
2269#if UseStaticTemplates
2270 const static mach_msg_port_descriptor_t iteratorTemplate = {
2271 /* name = */ MACH_PORT_NULL,
2272 /* pad1 = */ 0,
2273 /* pad2 = */ 0,
2274 /* disp = */ 17,
2275 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
2276 };
2277#endif /* UseStaticTemplates */
2278
2279#else
2280#if UseStaticTemplates
2281 const static mach_msg_port_descriptor_t iteratorTemplate = {
2282 /* name = */ MACH_PORT_NULL,
2283 /* pad1 = */ 0,
2284 /* pad2 = */ 0,
2285 /* disp = */ 19,
2286 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
2287 };
2288#endif /* UseStaticTemplates */
2289
2290#endif /* __MigKernelSpecificCode */
2291 kern_return_t RetCode;
2292 io_object_t registry_entry;
2293 io_object_t iterator;
2294
2295 __DeclareRcvRpc(2813, "io_registry_entry_get_child_iterator")
2296 __BeforeRcvRpc(2813, "io_registry_entry_get_child_iterator")
2297
2298#if defined(__MIG_check__Request__io_registry_entry_get_child_iterator_t__defined)
2299 check_result = __MIG_check__Request__io_registry_entry_get_child_iterator_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
2300 if (check_result != MACH_MSG_SUCCESS)
2301 { MIG_RETURN_ERROR(OutKP, check_result); }
2302#endif /* defined(__MIG_check__Request__io_registry_entry_get_child_iterator_t__defined) */
2303
2304#if UseStaticTemplates
2305 OutKP->iterator = iteratorTemplate;
2306#else /* UseStaticTemplates */
2307#if __MigKernelSpecificCode
2308 OutKP->iterator.disposition = 17;
2309#else
2310 OutKP->iterator.disposition = 19;
2311#endif /* __MigKernelSpecificCode */
2312#if !(defined(KERNEL) && defined(__LP64__))
2313 OutKP->iterator.pad1 = 0;
2314#endif
2315 OutKP->iterator.pad2 = 0;
2316 OutKP->iterator.type = MACH_MSG_PORT_DESCRIPTOR;
2317#if defined(KERNEL)
2318 OutKP->iterator.pad_end = 0;
2319#endif
2320#endif /* UseStaticTemplates */
2321
2322
2323 registry_entry = iokit_lookup_object_port(port: InKP->Head.msgh_request_port);
2324
2325 RetCode = is_io_registry_entry_get_child_iterator(registry_entry, plane: In0UP->plane, iterator: &iterator);
2326 iokit_remove_reference(obj: registry_entry);
2327 if (RetCode != KERN_SUCCESS) {
2328 MIG_RETURN_ERROR(OutKP, RetCode);
2329 }
2330#if __MigKernelSpecificCode
2331#endif /* __MigKernelSpecificCode */
2332 OutKP->iterator.name = (mach_port_t)iokit_make_object_port(obj: iterator);
2333
2334
2335 OutKP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
2336 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
2337 OutKP->msgh_body.msgh_descriptor_count = 1;
2338 __AfterRcvRpc(2813, "io_registry_entry_get_child_iterator")
2339}
2340
2341#if ( __MigTypeCheck )
2342#if __MIG_check__Request__iokit_subsystem__
2343#if !defined(__MIG_check__Request__io_registry_entry_get_parent_iterator_t__defined)
2344#define __MIG_check__Request__io_registry_entry_get_parent_iterator_t__defined
2345
2346mig_internal kern_return_t __MIG_check__Request__io_registry_entry_get_parent_iterator_t(
2347 __attribute__((__unused__)) __RequestKData__io_registry_entry_get_parent_iterator_t *InKP,
2348 __attribute__((__unused__)) __RequestUData__io_registry_entry_get_parent_iterator_t *In0UP,
2349 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
2350{
2351
2352 typedef __Request__io_registry_entry_get_parent_iterator_t __Request;
2353 typedef __RequestUData__io_registry_entry_get_parent_iterator_t __RequestU __attribute__((unused));
2354#if __MigTypeCheck
2355 unsigned int msgh_size;
2356#endif /* __MigTypeCheck */
2357
2358#if __MigTypeCheck
2359 msgh_size = InKP->Head.msgh_size;
2360 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
2361 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 128)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
2362 return MIG_BAD_ARGUMENTS;
2363#endif /* __MigTypeCheck */
2364
2365#if defined(__NDR_convert__int_rep__Request__io_registry_entry_get_parent_iterator_t__planeCnt__defined)
2366 if (In0UP->NDR.int_rep != NDR_record.int_rep)
2367 __NDR_convert__int_rep__Request__io_registry_entry_get_parent_iterator_t__planeCnt(&In0UP->planeCnt, In0UP->NDR.int_rep);
2368#endif /* __NDR_convert__int_rep__Request__io_registry_entry_get_parent_iterator_t__planeCnt__defined */
2369#if __MigTypeCheck
2370 if (In0UP->planeCnt > 128)
2371 return MIG_BAD_ARGUMENTS;
2372 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 128)) < In0UP->planeCnt) ||
2373 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 128) + _WALIGN_(In0UP->planeCnt)))
2374 return MIG_BAD_ARGUMENTS;
2375#endif /* __MigTypeCheck */
2376
2377#if __MigTypeCheck
2378 {
2379 char * msg_limit = (char *) InTrailerP;
2380#if __MigKernelSpecificCode
2381 size_t strnlen_limit;
2382#else
2383 size_t memchr_limit;
2384#endif /* __MigKernelSpecificCode */
2385
2386#if __MigKernelSpecificCode
2387 strnlen_limit = min((msg_limit - In0UP->plane), 128);
2388 if (( strnlen(s: In0UP->plane, n: strnlen_limit) >= 128 + 1 ))
2389 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
2390#else
2391 memchr_limit = min((msg_limit - In0UP->plane), 128);
2392 if (( memchr(In0UP->plane, '\0', memchr_limit) == NULL ))
2393 return MIG_BAD_ARGUMENTS; // string length exceeds buffer length!
2394#endif /* __MigKernelSpecificCode */
2395 }
2396#endif /* __MigTypeCheck */
2397
2398 return MACH_MSG_SUCCESS;
2399}
2400#endif /* !defined(__MIG_check__Request__io_registry_entry_get_parent_iterator_t__defined) */
2401#endif /* __MIG_check__Request__iokit_subsystem__ */
2402#endif /* ( __MigTypeCheck ) */
2403
2404
2405/* Routine io_registry_entry_get_parent_iterator */
2406mig_internal novalue _Xio_registry_entry_get_parent_iterator
2407 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
2408 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
2409 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
2410{
2411
2412#ifdef __MigPackStructs
2413#pragma pack(push, 4)
2414#endif
2415 typedef struct {
2416 NDR_record_t NDR;
2417 mach_msg_type_number_t planeOffset; /* MiG doesn't use it */
2418 mach_msg_type_number_t planeCnt;
2419 char plane[128];
2420 mach_msg_trailer_t trailer;
2421 char padding[0]; /* Avoid generating empty UData structs */
2422 } RequestU __attribute__((unused));
2423#ifdef __MigPackStructs
2424#pragma pack(pop)
2425#endif
2426 typedef __RequestKData__io_registry_entry_get_parent_iterator_t RequestK;
2427 typedef __RequestUData__io_registry_entry_get_parent_iterator_t __RequestU;
2428 typedef __ReplyKData__io_registry_entry_get_parent_iterator_t ReplyK __attribute__((unused));
2429 typedef __ReplyUData__io_registry_entry_get_parent_iterator_t ReplyU __attribute__((unused));
2430 typedef __Reply__io_registry_entry_get_parent_iterator_t Reply __attribute__((unused));
2431 typedef __Request__io_registry_entry_get_parent_iterator_t __Request __attribute__((unused));
2432
2433 /*
2434 * typedef struct {
2435 * mach_msg_header_t Head;
2436 * NDR_record_t NDR;
2437 * kern_return_t RetCode;
2438 * } mig_reply_error_t;
2439 */
2440
2441 RequestK *InKP = (RequestK *) InHeadP;
2442 RequestU *In0UP = (RequestU *) InDataP;
2443 ReplyK *OutKP = (ReplyK *) OutHeadP;
2444 ReplyU *OutUP = (ReplyU *) OutDataP;
2445 (void)OutUP;
2446#ifdef __MIG_check__Request__io_registry_entry_get_parent_iterator_t__defined
2447 kern_return_t check_result;
2448#endif /* __MIG_check__Request__io_registry_entry_get_parent_iterator_t__defined */
2449
2450#if __MigKernelSpecificCode
2451#if UseStaticTemplates
2452 const static mach_msg_port_descriptor_t iteratorTemplate = {
2453 /* name = */ MACH_PORT_NULL,
2454 /* pad1 = */ 0,
2455 /* pad2 = */ 0,
2456 /* disp = */ 17,
2457 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
2458 };
2459#endif /* UseStaticTemplates */
2460
2461#else
2462#if UseStaticTemplates
2463 const static mach_msg_port_descriptor_t iteratorTemplate = {
2464 /* name = */ MACH_PORT_NULL,
2465 /* pad1 = */ 0,
2466 /* pad2 = */ 0,
2467 /* disp = */ 19,
2468 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
2469 };
2470#endif /* UseStaticTemplates */
2471
2472#endif /* __MigKernelSpecificCode */
2473 kern_return_t RetCode;
2474 io_object_t registry_entry;
2475 io_object_t iterator;
2476
2477 __DeclareRcvRpc(2814, "io_registry_entry_get_parent_iterator")
2478 __BeforeRcvRpc(2814, "io_registry_entry_get_parent_iterator")
2479
2480#if defined(__MIG_check__Request__io_registry_entry_get_parent_iterator_t__defined)
2481 check_result = __MIG_check__Request__io_registry_entry_get_parent_iterator_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
2482 if (check_result != MACH_MSG_SUCCESS)
2483 { MIG_RETURN_ERROR(OutKP, check_result); }
2484#endif /* defined(__MIG_check__Request__io_registry_entry_get_parent_iterator_t__defined) */
2485
2486#if UseStaticTemplates
2487 OutKP->iterator = iteratorTemplate;
2488#else /* UseStaticTemplates */
2489#if __MigKernelSpecificCode
2490 OutKP->iterator.disposition = 17;
2491#else
2492 OutKP->iterator.disposition = 19;
2493#endif /* __MigKernelSpecificCode */
2494#if !(defined(KERNEL) && defined(__LP64__))
2495 OutKP->iterator.pad1 = 0;
2496#endif
2497 OutKP->iterator.pad2 = 0;
2498 OutKP->iterator.type = MACH_MSG_PORT_DESCRIPTOR;
2499#if defined(KERNEL)
2500 OutKP->iterator.pad_end = 0;
2501#endif
2502#endif /* UseStaticTemplates */
2503
2504
2505 registry_entry = iokit_lookup_object_port(port: InKP->Head.msgh_request_port);
2506
2507 RetCode = is_io_registry_entry_get_parent_iterator(registry_entry, plane: In0UP->plane, iterator: &iterator);
2508 iokit_remove_reference(obj: registry_entry);
2509 if (RetCode != KERN_SUCCESS) {
2510 MIG_RETURN_ERROR(OutKP, RetCode);
2511 }
2512#if __MigKernelSpecificCode
2513#endif /* __MigKernelSpecificCode */
2514 OutKP->iterator.name = (mach_port_t)iokit_make_object_port(obj: iterator);
2515
2516
2517 OutKP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
2518 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
2519 OutKP->msgh_body.msgh_descriptor_count = 1;
2520 __AfterRcvRpc(2814, "io_registry_entry_get_parent_iterator")
2521}
2522
2523#if ( __MigTypeCheck )
2524#if __MIG_check__Request__iokit_subsystem__
2525#if !defined(__MIG_check__Request__io_service_close_t__defined)
2526#define __MIG_check__Request__io_service_close_t__defined
2527
2528mig_internal kern_return_t __MIG_check__Request__io_service_close_t(
2529 __attribute__((__unused__)) __RequestKData__io_service_close_t *InKP,
2530 __attribute__((__unused__)) __RequestUData__io_service_close_t *In0UP,
2531 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
2532{
2533
2534 typedef __Request__io_service_close_t __Request;
2535 typedef __RequestUData__io_service_close_t __RequestU __attribute__((unused));
2536#if __MigTypeCheck
2537 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
2538 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
2539 return MIG_BAD_ARGUMENTS;
2540#endif /* __MigTypeCheck */
2541
2542 return MACH_MSG_SUCCESS;
2543}
2544#endif /* !defined(__MIG_check__Request__io_service_close_t__defined) */
2545#endif /* __MIG_check__Request__iokit_subsystem__ */
2546#endif /* ( __MigTypeCheck ) */
2547
2548
2549/* Routine io_service_close */
2550mig_internal novalue _Xio_service_close
2551 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
2552 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
2553 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
2554{
2555
2556#ifdef __MigPackStructs
2557#pragma pack(push, 4)
2558#endif
2559 typedef struct {
2560 mach_msg_trailer_t trailer;
2561 char padding[0]; /* Avoid generating empty UData structs */
2562 } RequestU __attribute__((unused));
2563#ifdef __MigPackStructs
2564#pragma pack(pop)
2565#endif
2566 typedef __RequestKData__io_service_close_t RequestK;
2567 typedef __RequestUData__io_service_close_t __RequestU;
2568 typedef __ReplyKData__io_service_close_t ReplyK __attribute__((unused));
2569 typedef __ReplyUData__io_service_close_t ReplyU __attribute__((unused));
2570 typedef __Reply__io_service_close_t Reply __attribute__((unused));
2571 typedef __Request__io_service_close_t __Request __attribute__((unused));
2572
2573 /*
2574 * typedef struct {
2575 * mach_msg_header_t Head;
2576 * NDR_record_t NDR;
2577 * kern_return_t RetCode;
2578 * } mig_reply_error_t;
2579 */
2580
2581 RequestK *InKP = (RequestK *) InHeadP;
2582 RequestU *In0UP = (RequestU *) InDataP;
2583 ReplyK *OutKP = (ReplyK *) OutHeadP;
2584 ReplyU *OutUP = (ReplyU *) OutDataP;
2585 (void)OutUP;
2586#ifdef __MIG_check__Request__io_service_close_t__defined
2587 kern_return_t check_result;
2588#endif /* __MIG_check__Request__io_service_close_t__defined */
2589
2590#if __MigKernelSpecificCode
2591#else
2592#endif /* __MigKernelSpecificCode */
2593 io_connect_t connection;
2594
2595 __DeclareRcvRpc(2816, "io_service_close")
2596 __BeforeRcvRpc(2816, "io_service_close")
2597
2598#if defined(__MIG_check__Request__io_service_close_t__defined)
2599 check_result = __MIG_check__Request__io_service_close_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
2600 if (check_result != MACH_MSG_SUCCESS)
2601 { MIG_RETURN_ERROR(OutKP, check_result); }
2602#endif /* defined(__MIG_check__Request__io_service_close_t__defined) */
2603
2604 connection = iokit_lookup_connect_port(port: InKP->Head.msgh_request_port);
2605
2606 OutUP->RetCode = is_io_service_close(connection);
2607 iokit_remove_connect_reference(obj: connection);
2608#if __MigKernelSpecificCode
2609#endif /* __MigKernelSpecificCode */
2610
2611 OutUP->NDR = NDR_record;
2612
2613
2614 __AfterRcvRpc(2816, "io_service_close")
2615}
2616
2617#if ( __MigTypeCheck )
2618#if __MIG_check__Request__iokit_subsystem__
2619#if !defined(__MIG_check__Request__io_connect_get_service_t__defined)
2620#define __MIG_check__Request__io_connect_get_service_t__defined
2621
2622mig_internal kern_return_t __MIG_check__Request__io_connect_get_service_t(
2623 __attribute__((__unused__)) __RequestKData__io_connect_get_service_t *InKP,
2624 __attribute__((__unused__)) __RequestUData__io_connect_get_service_t *In0UP,
2625 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
2626{
2627
2628 typedef __Request__io_connect_get_service_t __Request;
2629 typedef __RequestUData__io_connect_get_service_t __RequestU __attribute__((unused));
2630#if __MigTypeCheck
2631 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
2632 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
2633 return MIG_BAD_ARGUMENTS;
2634#endif /* __MigTypeCheck */
2635
2636 return MACH_MSG_SUCCESS;
2637}
2638#endif /* !defined(__MIG_check__Request__io_connect_get_service_t__defined) */
2639#endif /* __MIG_check__Request__iokit_subsystem__ */
2640#endif /* ( __MigTypeCheck ) */
2641
2642
2643/* Routine io_connect_get_service */
2644mig_internal novalue _Xio_connect_get_service
2645 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
2646 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
2647 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
2648{
2649
2650#ifdef __MigPackStructs
2651#pragma pack(push, 4)
2652#endif
2653 typedef struct {
2654 mach_msg_trailer_t trailer;
2655 char padding[0]; /* Avoid generating empty UData structs */
2656 } RequestU __attribute__((unused));
2657#ifdef __MigPackStructs
2658#pragma pack(pop)
2659#endif
2660 typedef __RequestKData__io_connect_get_service_t RequestK;
2661 typedef __RequestUData__io_connect_get_service_t __RequestU;
2662 typedef __ReplyKData__io_connect_get_service_t ReplyK __attribute__((unused));
2663 typedef __ReplyUData__io_connect_get_service_t ReplyU __attribute__((unused));
2664 typedef __Reply__io_connect_get_service_t Reply __attribute__((unused));
2665 typedef __Request__io_connect_get_service_t __Request __attribute__((unused));
2666
2667 /*
2668 * typedef struct {
2669 * mach_msg_header_t Head;
2670 * NDR_record_t NDR;
2671 * kern_return_t RetCode;
2672 * } mig_reply_error_t;
2673 */
2674
2675 RequestK *InKP = (RequestK *) InHeadP;
2676 RequestU *In0UP = (RequestU *) InDataP;
2677 ReplyK *OutKP = (ReplyK *) OutHeadP;
2678 ReplyU *OutUP = (ReplyU *) OutDataP;
2679 (void)OutUP;
2680#ifdef __MIG_check__Request__io_connect_get_service_t__defined
2681 kern_return_t check_result;
2682#endif /* __MIG_check__Request__io_connect_get_service_t__defined */
2683
2684#if __MigKernelSpecificCode
2685#if UseStaticTemplates
2686 const static mach_msg_port_descriptor_t serviceTemplate = {
2687 /* name = */ MACH_PORT_NULL,
2688 /* pad1 = */ 0,
2689 /* pad2 = */ 0,
2690 /* disp = */ 17,
2691 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
2692 };
2693#endif /* UseStaticTemplates */
2694
2695#else
2696#if UseStaticTemplates
2697 const static mach_msg_port_descriptor_t serviceTemplate = {
2698 /* name = */ MACH_PORT_NULL,
2699 /* pad1 = */ 0,
2700 /* pad2 = */ 0,
2701 /* disp = */ 19,
2702 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
2703 };
2704#endif /* UseStaticTemplates */
2705
2706#endif /* __MigKernelSpecificCode */
2707 kern_return_t RetCode;
2708 io_connect_t connection;
2709 io_object_t service;
2710
2711 __DeclareRcvRpc(2817, "io_connect_get_service")
2712 __BeforeRcvRpc(2817, "io_connect_get_service")
2713
2714#if defined(__MIG_check__Request__io_connect_get_service_t__defined)
2715 check_result = __MIG_check__Request__io_connect_get_service_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
2716 if (check_result != MACH_MSG_SUCCESS)
2717 { MIG_RETURN_ERROR(OutKP, check_result); }
2718#endif /* defined(__MIG_check__Request__io_connect_get_service_t__defined) */
2719
2720#if UseStaticTemplates
2721 OutKP->service = serviceTemplate;
2722#else /* UseStaticTemplates */
2723#if __MigKernelSpecificCode
2724 OutKP->service.disposition = 17;
2725#else
2726 OutKP->service.disposition = 19;
2727#endif /* __MigKernelSpecificCode */
2728#if !(defined(KERNEL) && defined(__LP64__))
2729 OutKP->service.pad1 = 0;
2730#endif
2731 OutKP->service.pad2 = 0;
2732 OutKP->service.type = MACH_MSG_PORT_DESCRIPTOR;
2733#if defined(KERNEL)
2734 OutKP->service.pad_end = 0;
2735#endif
2736#endif /* UseStaticTemplates */
2737
2738
2739 connection = iokit_lookup_connect_port(port: InKP->Head.msgh_request_port);
2740
2741 RetCode = is_io_connect_get_service(connection, service: &service);
2742 iokit_remove_connect_reference(obj: connection);
2743 if (RetCode != KERN_SUCCESS) {
2744 MIG_RETURN_ERROR(OutKP, RetCode);
2745 }
2746#if __MigKernelSpecificCode
2747#endif /* __MigKernelSpecificCode */
2748 OutKP->service.name = (mach_port_t)iokit_make_object_port(obj: service);
2749
2750
2751 OutKP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
2752 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
2753 OutKP->msgh_body.msgh_descriptor_count = 1;
2754 __AfterRcvRpc(2817, "io_connect_get_service")
2755}
2756
2757#if ( __MigTypeCheck )
2758#if __MIG_check__Request__iokit_subsystem__
2759#if !defined(__MIG_check__Request__io_connect_set_notification_port_t__defined)
2760#define __MIG_check__Request__io_connect_set_notification_port_t__defined
2761
2762mig_internal kern_return_t __MIG_check__Request__io_connect_set_notification_port_t(
2763 __attribute__((__unused__)) __RequestKData__io_connect_set_notification_port_t *InKP,
2764 __attribute__((__unused__)) __RequestUData__io_connect_set_notification_port_t *In0UP,
2765 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
2766{
2767
2768 typedef __Request__io_connect_set_notification_port_t __Request;
2769 typedef __RequestUData__io_connect_set_notification_port_t __RequestU __attribute__((unused));
2770#if __MigTypeCheck
2771 if (!(InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
2772 (InKP->msgh_body.msgh_descriptor_count != 1) ||
2773 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
2774 return MIG_BAD_ARGUMENTS;
2775#endif /* __MigTypeCheck */
2776
2777#if __MigTypeCheck
2778 if (InKP->port.type != MACH_MSG_PORT_DESCRIPTOR ||
2779 InKP->port.disposition != 17)
2780 return MIG_TYPE_ERROR;
2781#endif /* __MigTypeCheck */
2782
2783 return MACH_MSG_SUCCESS;
2784}
2785#endif /* !defined(__MIG_check__Request__io_connect_set_notification_port_t__defined) */
2786#endif /* __MIG_check__Request__iokit_subsystem__ */
2787#endif /* ( __MigTypeCheck ) */
2788
2789
2790/* Routine io_connect_set_notification_port */
2791mig_internal novalue _Xio_connect_set_notification_port
2792 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
2793 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
2794 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
2795{
2796
2797#ifdef __MigPackStructs
2798#pragma pack(push, 4)
2799#endif
2800 typedef struct {
2801 NDR_record_t NDR;
2802 uint32_t notification_type;
2803 uint32_t reference;
2804 mach_msg_trailer_t trailer;
2805 char padding[0]; /* Avoid generating empty UData structs */
2806 } RequestU __attribute__((unused));
2807#ifdef __MigPackStructs
2808#pragma pack(pop)
2809#endif
2810 typedef __RequestKData__io_connect_set_notification_port_t RequestK;
2811 typedef __RequestUData__io_connect_set_notification_port_t __RequestU;
2812 typedef __ReplyKData__io_connect_set_notification_port_t ReplyK __attribute__((unused));
2813 typedef __ReplyUData__io_connect_set_notification_port_t ReplyU __attribute__((unused));
2814 typedef __Reply__io_connect_set_notification_port_t Reply __attribute__((unused));
2815 typedef __Request__io_connect_set_notification_port_t __Request __attribute__((unused));
2816
2817 /*
2818 * typedef struct {
2819 * mach_msg_header_t Head;
2820 * NDR_record_t NDR;
2821 * kern_return_t RetCode;
2822 * } mig_reply_error_t;
2823 */
2824
2825 RequestK *InKP = (RequestK *) InHeadP;
2826 RequestU *In0UP = (RequestU *) InDataP;
2827 ReplyK *OutKP = (ReplyK *) OutHeadP;
2828 ReplyU *OutUP = (ReplyU *) OutDataP;
2829 (void)OutUP;
2830#ifdef __MIG_check__Request__io_connect_set_notification_port_t__defined
2831 kern_return_t check_result;
2832#endif /* __MIG_check__Request__io_connect_set_notification_port_t__defined */
2833
2834#if __MigKernelSpecificCode
2835#else
2836#endif /* __MigKernelSpecificCode */
2837 io_connect_t connection;
2838
2839 __DeclareRcvRpc(2818, "io_connect_set_notification_port")
2840 __BeforeRcvRpc(2818, "io_connect_set_notification_port")
2841
2842#if defined(__MIG_check__Request__io_connect_set_notification_port_t__defined)
2843 check_result = __MIG_check__Request__io_connect_set_notification_port_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
2844 if (check_result != MACH_MSG_SUCCESS)
2845 { MIG_RETURN_ERROR(OutKP, check_result); }
2846#endif /* defined(__MIG_check__Request__io_connect_set_notification_port_t__defined) */
2847
2848 connection = iokit_lookup_connect_port(port: InKP->Head.msgh_request_port);
2849
2850 OutUP->RetCode = is_io_connect_set_notification_port(connection, notification_type: In0UP->notification_type, port: InKP->port.name, reference: In0UP->reference);
2851 iokit_remove_connect_reference(obj: connection);
2852#if __MigKernelSpecificCode
2853#endif /* __MigKernelSpecificCode */
2854
2855 OutUP->NDR = NDR_record;
2856
2857
2858 __AfterRcvRpc(2818, "io_connect_set_notification_port")
2859}
2860
2861#if ( __MigTypeCheck )
2862#if __MIG_check__Request__iokit_subsystem__
2863#if !defined(__MIG_check__Request__io_connect_map_memory_t__defined)
2864#define __MIG_check__Request__io_connect_map_memory_t__defined
2865
2866mig_internal kern_return_t __MIG_check__Request__io_connect_map_memory_t(
2867 __attribute__((__unused__)) __RequestKData__io_connect_map_memory_t *InKP,
2868 __attribute__((__unused__)) __RequestUData__io_connect_map_memory_t *In0UP,
2869 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
2870{
2871
2872 typedef __Request__io_connect_map_memory_t __Request;
2873 typedef __RequestUData__io_connect_map_memory_t __RequestU __attribute__((unused));
2874#if __MigTypeCheck
2875 if (!(InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
2876 (InKP->msgh_body.msgh_descriptor_count != 1) ||
2877 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
2878 return MIG_BAD_ARGUMENTS;
2879#endif /* __MigTypeCheck */
2880
2881#if __MigTypeCheck
2882 if (InKP->into_task.type != MACH_MSG_PORT_DESCRIPTOR ||
2883 InKP->into_task.disposition != 17)
2884 return MIG_TYPE_ERROR;
2885#endif /* __MigTypeCheck */
2886
2887 return MACH_MSG_SUCCESS;
2888}
2889#endif /* !defined(__MIG_check__Request__io_connect_map_memory_t__defined) */
2890#endif /* __MIG_check__Request__iokit_subsystem__ */
2891#endif /* ( __MigTypeCheck ) */
2892
2893
2894/* Routine io_connect_map_memory */
2895mig_internal novalue _Xio_connect_map_memory
2896 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
2897 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
2898 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
2899{
2900
2901#ifdef __MigPackStructs
2902#pragma pack(push, 4)
2903#endif
2904 typedef struct {
2905 NDR_record_t NDR;
2906 uint32_t memory_type;
2907 uint32_t address;
2908 uint32_t size;
2909 uint32_t flags;
2910 mach_msg_trailer_t trailer;
2911 char padding[0]; /* Avoid generating empty UData structs */
2912 } RequestU __attribute__((unused));
2913#ifdef __MigPackStructs
2914#pragma pack(pop)
2915#endif
2916 typedef __RequestKData__io_connect_map_memory_t RequestK;
2917 typedef __RequestUData__io_connect_map_memory_t __RequestU;
2918 typedef __ReplyKData__io_connect_map_memory_t ReplyK __attribute__((unused));
2919 typedef __ReplyUData__io_connect_map_memory_t ReplyU __attribute__((unused));
2920 typedef __Reply__io_connect_map_memory_t Reply __attribute__((unused));
2921 typedef __Request__io_connect_map_memory_t __Request __attribute__((unused));
2922
2923 /*
2924 * typedef struct {
2925 * mach_msg_header_t Head;
2926 * NDR_record_t NDR;
2927 * kern_return_t RetCode;
2928 * } mig_reply_error_t;
2929 */
2930
2931 RequestK *InKP = (RequestK *) InHeadP;
2932 RequestU *In0UP = (RequestU *) InDataP;
2933 ReplyK *OutKP = (ReplyK *) OutHeadP;
2934 ReplyU *OutUP = (ReplyU *) OutDataP;
2935 (void)OutUP;
2936#ifdef __MIG_check__Request__io_connect_map_memory_t__defined
2937 kern_return_t check_result;
2938#endif /* __MIG_check__Request__io_connect_map_memory_t__defined */
2939
2940#if __MigKernelSpecificCode
2941#else
2942#endif /* __MigKernelSpecificCode */
2943 io_connect_t connection;
2944 task_t into_task;
2945
2946 __DeclareRcvRpc(2819, "io_connect_map_memory")
2947 __BeforeRcvRpc(2819, "io_connect_map_memory")
2948
2949#if defined(__MIG_check__Request__io_connect_map_memory_t__defined)
2950 check_result = __MIG_check__Request__io_connect_map_memory_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
2951 if (check_result != MACH_MSG_SUCCESS)
2952 { MIG_RETURN_ERROR(OutKP, check_result); }
2953#endif /* defined(__MIG_check__Request__io_connect_map_memory_t__defined) */
2954
2955 connection = iokit_lookup_connect_port(port: InKP->Head.msgh_request_port);
2956
2957 into_task = convert_port_to_task_mig(port: InKP->into_task.name);
2958
2959 OutUP->RetCode = is_io_connect_map_memory(connection, memory_type: In0UP->memory_type, into_task, address: &In0UP->address, size: &In0UP->size, flags: In0UP->flags);
2960 task_deallocate_mig(into_task);
2961 iokit_remove_connect_reference(obj: connection);
2962 if (OutUP->RetCode != KERN_SUCCESS) {
2963 MIG_RETURN_ERROR(OutKP, OutUP->RetCode);
2964 }
2965#if __MigKernelSpecificCode
2966 ipc_port_release_send(port: (ipc_port_t)InKP->into_task.name);
2967#endif /* __MigKernelSpecificCode */
2968
2969 OutUP->NDR = NDR_record;
2970
2971
2972 OutUP->address = In0UP->address;
2973
2974 OutUP->size = In0UP->size;
2975
2976 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
2977 __AfterRcvRpc(2819, "io_connect_map_memory")
2978}
2979
2980#if ( __MigTypeCheck )
2981#if __MIG_check__Request__iokit_subsystem__
2982#if !defined(__MIG_check__Request__io_connect_add_client_t__defined)
2983#define __MIG_check__Request__io_connect_add_client_t__defined
2984
2985mig_internal kern_return_t __MIG_check__Request__io_connect_add_client_t(
2986 __attribute__((__unused__)) __RequestKData__io_connect_add_client_t *InKP,
2987 __attribute__((__unused__)) __RequestUData__io_connect_add_client_t *In0UP,
2988 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
2989{
2990
2991 typedef __Request__io_connect_add_client_t __Request;
2992 typedef __RequestUData__io_connect_add_client_t __RequestU __attribute__((unused));
2993#if __MigTypeCheck
2994 if (!(InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
2995 (InKP->msgh_body.msgh_descriptor_count != 1) ||
2996 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
2997 return MIG_BAD_ARGUMENTS;
2998#endif /* __MigTypeCheck */
2999
3000#if __MigTypeCheck
3001 if (InKP->connect_to.type != MACH_MSG_PORT_DESCRIPTOR ||
3002 InKP->connect_to.disposition != 17)
3003 return MIG_TYPE_ERROR;
3004#endif /* __MigTypeCheck */
3005
3006 return MACH_MSG_SUCCESS;
3007}
3008#endif /* !defined(__MIG_check__Request__io_connect_add_client_t__defined) */
3009#endif /* __MIG_check__Request__iokit_subsystem__ */
3010#endif /* ( __MigTypeCheck ) */
3011
3012
3013/* Routine io_connect_add_client */
3014mig_internal novalue _Xio_connect_add_client
3015 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
3016 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
3017 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
3018{
3019
3020#ifdef __MigPackStructs
3021#pragma pack(push, 4)
3022#endif
3023 typedef struct {
3024 mach_msg_trailer_t trailer;
3025 char padding[0]; /* Avoid generating empty UData structs */
3026 } RequestU __attribute__((unused));
3027#ifdef __MigPackStructs
3028#pragma pack(pop)
3029#endif
3030 typedef __RequestKData__io_connect_add_client_t RequestK;
3031 typedef __RequestUData__io_connect_add_client_t __RequestU;
3032 typedef __ReplyKData__io_connect_add_client_t ReplyK __attribute__((unused));
3033 typedef __ReplyUData__io_connect_add_client_t ReplyU __attribute__((unused));
3034 typedef __Reply__io_connect_add_client_t Reply __attribute__((unused));
3035 typedef __Request__io_connect_add_client_t __Request __attribute__((unused));
3036
3037 /*
3038 * typedef struct {
3039 * mach_msg_header_t Head;
3040 * NDR_record_t NDR;
3041 * kern_return_t RetCode;
3042 * } mig_reply_error_t;
3043 */
3044
3045 RequestK *InKP = (RequestK *) InHeadP;
3046 RequestU *In0UP = (RequestU *) InDataP;
3047 ReplyK *OutKP = (ReplyK *) OutHeadP;
3048 ReplyU *OutUP = (ReplyU *) OutDataP;
3049 (void)OutUP;
3050#ifdef __MIG_check__Request__io_connect_add_client_t__defined
3051 kern_return_t check_result;
3052#endif /* __MIG_check__Request__io_connect_add_client_t__defined */
3053
3054#if __MigKernelSpecificCode
3055#else
3056#endif /* __MigKernelSpecificCode */
3057 io_connect_t connection;
3058 io_connect_t connect_to;
3059
3060 __DeclareRcvRpc(2820, "io_connect_add_client")
3061 __BeforeRcvRpc(2820, "io_connect_add_client")
3062
3063#if defined(__MIG_check__Request__io_connect_add_client_t__defined)
3064 check_result = __MIG_check__Request__io_connect_add_client_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
3065 if (check_result != MACH_MSG_SUCCESS)
3066 { MIG_RETURN_ERROR(OutKP, check_result); }
3067#endif /* defined(__MIG_check__Request__io_connect_add_client_t__defined) */
3068
3069 connection = iokit_lookup_connect_port(port: InKP->Head.msgh_request_port);
3070
3071 connect_to = iokit_lookup_connect_port(port: InKP->connect_to.name);
3072
3073 OutUP->RetCode = is_io_connect_add_client(connection, connect_to);
3074 iokit_remove_connect_reference(obj: connect_to);
3075 iokit_remove_connect_reference(obj: connection);
3076#if __MigKernelSpecificCode
3077 if (OutUP->RetCode != KERN_SUCCESS) {
3078 MIG_RETURN_ERROR(OutKP, OutUP->RetCode);
3079 }
3080 ipc_port_release_send(port: (ipc_port_t)InKP->connect_to.name);
3081#endif /* __MigKernelSpecificCode */
3082
3083 OutUP->NDR = NDR_record;
3084
3085
3086 __AfterRcvRpc(2820, "io_connect_add_client")
3087}
3088
3089#if ( __MigTypeCheck )
3090#if __MIG_check__Request__iokit_subsystem__
3091#if !defined(__MIG_check__Request__io_connect_set_properties_t__defined)
3092#define __MIG_check__Request__io_connect_set_properties_t__defined
3093
3094mig_internal kern_return_t __MIG_check__Request__io_connect_set_properties_t(
3095 __attribute__((__unused__)) __RequestKData__io_connect_set_properties_t *InKP,
3096 __attribute__((__unused__)) __RequestUData__io_connect_set_properties_t *In0UP,
3097 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
3098{
3099
3100 typedef __Request__io_connect_set_properties_t __Request;
3101 typedef __RequestUData__io_connect_set_properties_t __RequestU __attribute__((unused));
3102#if __MigTypeCheck
3103 if (!(InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
3104 (InKP->msgh_body.msgh_descriptor_count != 1) ||
3105 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
3106 return MIG_BAD_ARGUMENTS;
3107#endif /* __MigTypeCheck */
3108
3109#if __MigTypeCheck
3110 if (InKP->properties.type != MACH_MSG_OOL_DESCRIPTOR)
3111 return MIG_TYPE_ERROR;
3112#endif /* __MigTypeCheck */
3113
3114#if __MigTypeCheck
3115 if (InKP->properties.size != In0UP->propertiesCnt)
3116 return MIG_TYPE_ERROR;
3117#endif /* __MigTypeCheck */
3118
3119 return MACH_MSG_SUCCESS;
3120}
3121#endif /* !defined(__MIG_check__Request__io_connect_set_properties_t__defined) */
3122#endif /* __MIG_check__Request__iokit_subsystem__ */
3123#endif /* ( __MigTypeCheck ) */
3124
3125
3126/* Routine io_connect_set_properties */
3127mig_internal novalue _Xio_connect_set_properties
3128 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
3129 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
3130 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
3131{
3132
3133#ifdef __MigPackStructs
3134#pragma pack(push, 4)
3135#endif
3136 typedef struct {
3137 NDR_record_t NDR;
3138 mach_msg_type_number_t propertiesCnt;
3139 mach_msg_trailer_t trailer;
3140 char padding[0]; /* Avoid generating empty UData structs */
3141 } RequestU __attribute__((unused));
3142#ifdef __MigPackStructs
3143#pragma pack(pop)
3144#endif
3145 typedef __RequestKData__io_connect_set_properties_t RequestK;
3146 typedef __RequestUData__io_connect_set_properties_t __RequestU;
3147 typedef __ReplyKData__io_connect_set_properties_t ReplyK __attribute__((unused));
3148 typedef __ReplyUData__io_connect_set_properties_t ReplyU __attribute__((unused));
3149 typedef __Reply__io_connect_set_properties_t Reply __attribute__((unused));
3150 typedef __Request__io_connect_set_properties_t __Request __attribute__((unused));
3151
3152 /*
3153 * typedef struct {
3154 * mach_msg_header_t Head;
3155 * NDR_record_t NDR;
3156 * kern_return_t RetCode;
3157 * } mig_reply_error_t;
3158 */
3159
3160 RequestK *InKP = (RequestK *) InHeadP;
3161 RequestU *In0UP = (RequestU *) InDataP;
3162 ReplyK *OutKP = (ReplyK *) OutHeadP;
3163 ReplyU *OutUP = (ReplyU *) OutDataP;
3164 (void)OutUP;
3165#ifdef __MIG_check__Request__io_connect_set_properties_t__defined
3166 kern_return_t check_result;
3167#endif /* __MIG_check__Request__io_connect_set_properties_t__defined */
3168
3169#if __MigKernelSpecificCode
3170#else
3171#endif /* __MigKernelSpecificCode */
3172 io_connect_t connection;
3173
3174 __DeclareRcvRpc(2821, "io_connect_set_properties")
3175 __BeforeRcvRpc(2821, "io_connect_set_properties")
3176
3177#if defined(__MIG_check__Request__io_connect_set_properties_t__defined)
3178 check_result = __MIG_check__Request__io_connect_set_properties_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
3179 if (check_result != MACH_MSG_SUCCESS)
3180 { MIG_RETURN_ERROR(OutKP, check_result); }
3181#endif /* defined(__MIG_check__Request__io_connect_set_properties_t__defined) */
3182
3183 connection = iokit_lookup_connect_port(port: InKP->Head.msgh_request_port);
3184
3185 OutUP->RetCode = is_io_connect_set_properties(connection, properties: (io_buf_ptr_t)(InKP->properties.address), propertiesCnt: InKP->properties.size, result: &OutUP->result);
3186 iokit_remove_connect_reference(obj: connection);
3187 if (OutUP->RetCode != KERN_SUCCESS) {
3188 MIG_RETURN_ERROR(OutKP, OutUP->RetCode);
3189 }
3190#if __MigKernelSpecificCode
3191#endif /* __MigKernelSpecificCode */
3192
3193 OutUP->NDR = NDR_record;
3194
3195
3196 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
3197 __AfterRcvRpc(2821, "io_connect_set_properties")
3198}
3199
3200#if ( __MigTypeCheck )
3201#if __MIG_check__Request__iokit_subsystem__
3202#if !defined(__MIG_check__Request__io_connect_method_scalarI_scalarO_t__defined)
3203#define __MIG_check__Request__io_connect_method_scalarI_scalarO_t__defined
3204
3205mig_internal kern_return_t __MIG_check__Request__io_connect_method_scalarI_scalarO_t(
3206 __attribute__((__unused__)) __RequestKData__io_connect_method_scalarI_scalarO_t *InKP,
3207 __attribute__((__unused__)) __RequestUData__io_connect_method_scalarI_scalarO_t *In0UP,
3208 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
3209 __attribute__((__unused__)) __RequestUData__io_connect_method_scalarI_scalarO_t **In1UPP)
3210{
3211
3212 typedef __Request__io_connect_method_scalarI_scalarO_t __Request;
3213 typedef __RequestUData__io_connect_method_scalarI_scalarO_t __RequestU __attribute__((unused));
3214 __RequestU *In1UP;
3215#if __MigTypeCheck
3216 unsigned int msgh_size;
3217#endif /* __MigTypeCheck */
3218 unsigned int msgh_size_delta;
3219
3220#if __MigTypeCheck
3221 msgh_size = InKP->Head.msgh_size;
3222 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
3223 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 64)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
3224 return MIG_BAD_ARGUMENTS;
3225#endif /* __MigTypeCheck */
3226
3227#if defined(__NDR_convert__int_rep__Request__io_connect_method_scalarI_scalarO_t__inputCnt__defined)
3228 if (In0UP->NDR.int_rep != NDR_record.int_rep)
3229 __NDR_convert__int_rep__Request__io_connect_method_scalarI_scalarO_t__inputCnt(&In0UP->inputCnt, In0UP->NDR.int_rep);
3230#endif /* __NDR_convert__int_rep__Request__io_connect_method_scalarI_scalarO_t__inputCnt__defined */
3231 msgh_size_delta = (4 * In0UP->inputCnt);
3232#if __MigTypeCheck
3233 if (In0UP->inputCnt > 16)
3234 return MIG_BAD_ARGUMENTS;
3235 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 64)) / 4 < In0UP->inputCnt) ||
3236 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 64) + (4 * In0UP->inputCnt)))
3237 return MIG_BAD_ARGUMENTS;
3238#endif /* __MigTypeCheck */
3239
3240 *In1UPP = In1UP = (__RequestU *) ((pointer_t) In0UP + msgh_size_delta - 64);
3241
3242 return MACH_MSG_SUCCESS;
3243}
3244#endif /* !defined(__MIG_check__Request__io_connect_method_scalarI_scalarO_t__defined) */
3245#endif /* __MIG_check__Request__iokit_subsystem__ */
3246#endif /* ( __MigTypeCheck ) */
3247
3248
3249/* Routine io_connect_method_scalarI_scalarO */
3250mig_internal novalue _Xio_connect_method_scalarI_scalarO
3251 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
3252 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
3253 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
3254{
3255
3256#ifdef __MigPackStructs
3257#pragma pack(push, 4)
3258#endif
3259 typedef struct {
3260 NDR_record_t NDR;
3261 uint32_t selector;
3262 mach_msg_type_number_t inputCnt;
3263 int input[16];
3264 mach_msg_type_number_t outputCnt;
3265 mach_msg_trailer_t trailer;
3266 char padding[0]; /* Avoid generating empty UData structs */
3267 } RequestU __attribute__((unused));
3268#ifdef __MigPackStructs
3269#pragma pack(pop)
3270#endif
3271 typedef __RequestKData__io_connect_method_scalarI_scalarO_t RequestK;
3272 typedef __RequestUData__io_connect_method_scalarI_scalarO_t __RequestU;
3273 typedef __ReplyKData__io_connect_method_scalarI_scalarO_t ReplyK __attribute__((unused));
3274 typedef __ReplyUData__io_connect_method_scalarI_scalarO_t ReplyU __attribute__((unused));
3275 typedef __Reply__io_connect_method_scalarI_scalarO_t Reply __attribute__((unused));
3276 typedef __Request__io_connect_method_scalarI_scalarO_t __Request __attribute__((unused));
3277
3278 /*
3279 * typedef struct {
3280 * mach_msg_header_t Head;
3281 * NDR_record_t NDR;
3282 * kern_return_t RetCode;
3283 * } mig_reply_error_t;
3284 */
3285
3286 RequestK *InKP = (RequestK *) InHeadP;
3287 RequestU *In0UP = (RequestU *) InDataP;
3288 RequestU *In1UP;
3289 ReplyK *OutKP = (ReplyK *) OutHeadP;
3290 ReplyU *OutUP = (ReplyU *) OutDataP;
3291 (void)OutUP;
3292#ifdef __MIG_check__Request__io_connect_method_scalarI_scalarO_t__defined
3293 kern_return_t check_result;
3294#endif /* __MIG_check__Request__io_connect_method_scalarI_scalarO_t__defined */
3295
3296#if __MigKernelSpecificCode
3297#else
3298#endif /* __MigKernelSpecificCode */
3299 io_connect_t connection;
3300
3301 __DeclareRcvRpc(2822, "io_connect_method_scalarI_scalarO")
3302 __BeforeRcvRpc(2822, "io_connect_method_scalarI_scalarO")
3303
3304#if defined(__MIG_check__Request__io_connect_method_scalarI_scalarO_t__defined)
3305 check_result = __MIG_check__Request__io_connect_method_scalarI_scalarO_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP, In1UPP: (__RequestU **)&In1UP);
3306 if (check_result != MACH_MSG_SUCCESS)
3307 { MIG_RETURN_ERROR(OutKP, check_result); }
3308#endif /* defined(__MIG_check__Request__io_connect_method_scalarI_scalarO_t__defined) */
3309
3310 connection = iokit_lookup_connect_port(port: InKP->Head.msgh_request_port);
3311
3312 OutUP->outputCnt = 16;
3313 if (In1UP->outputCnt < OutUP->outputCnt)
3314 OutUP->outputCnt = In1UP->outputCnt;
3315
3316 OutUP->RetCode = is_io_connect_method_scalarI_scalarO(connection, selector: In0UP->selector, input: In0UP->input, inputCnt: In0UP->inputCnt, output: OutUP->output, outputCnt: &OutUP->outputCnt);
3317 iokit_remove_connect_reference(obj: connection);
3318 if (OutUP->RetCode != KERN_SUCCESS) {
3319 MIG_RETURN_ERROR(OutKP, OutUP->RetCode);
3320 }
3321#if __MigKernelSpecificCode
3322#endif /* __MigKernelSpecificCode */
3323
3324 OutUP->NDR = NDR_record;
3325
3326 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 64) + (((4 * OutUP->outputCnt)));
3327
3328 __AfterRcvRpc(2822, "io_connect_method_scalarI_scalarO")
3329}
3330
3331#if ( __MigTypeCheck )
3332#if __MIG_check__Request__iokit_subsystem__
3333#if !defined(__MIG_check__Request__io_connect_method_scalarI_structureO_t__defined)
3334#define __MIG_check__Request__io_connect_method_scalarI_structureO_t__defined
3335
3336mig_internal kern_return_t __MIG_check__Request__io_connect_method_scalarI_structureO_t(
3337 __attribute__((__unused__)) __RequestKData__io_connect_method_scalarI_structureO_t *InKP,
3338 __attribute__((__unused__)) __RequestUData__io_connect_method_scalarI_structureO_t *In0UP,
3339 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
3340 __attribute__((__unused__)) __RequestUData__io_connect_method_scalarI_structureO_t **In1UPP)
3341{
3342
3343 typedef __Request__io_connect_method_scalarI_structureO_t __Request;
3344 typedef __RequestUData__io_connect_method_scalarI_structureO_t __RequestU __attribute__((unused));
3345 __RequestU *In1UP;
3346#if __MigTypeCheck
3347 unsigned int msgh_size;
3348#endif /* __MigTypeCheck */
3349 unsigned int msgh_size_delta;
3350
3351#if __MigTypeCheck
3352 msgh_size = InKP->Head.msgh_size;
3353 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
3354 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 64)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
3355 return MIG_BAD_ARGUMENTS;
3356#endif /* __MigTypeCheck */
3357
3358#if defined(__NDR_convert__int_rep__Request__io_connect_method_scalarI_structureO_t__inputCnt__defined)
3359 if (In0UP->NDR.int_rep != NDR_record.int_rep)
3360 __NDR_convert__int_rep__Request__io_connect_method_scalarI_structureO_t__inputCnt(&In0UP->inputCnt, In0UP->NDR.int_rep);
3361#endif /* __NDR_convert__int_rep__Request__io_connect_method_scalarI_structureO_t__inputCnt__defined */
3362 msgh_size_delta = (4 * In0UP->inputCnt);
3363#if __MigTypeCheck
3364 if (In0UP->inputCnt > 16)
3365 return MIG_BAD_ARGUMENTS;
3366 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 64)) / 4 < In0UP->inputCnt) ||
3367 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 64) + (4 * In0UP->inputCnt)))
3368 return MIG_BAD_ARGUMENTS;
3369#endif /* __MigTypeCheck */
3370
3371 *In1UPP = In1UP = (__RequestU *) ((pointer_t) In0UP + msgh_size_delta - 64);
3372
3373 return MACH_MSG_SUCCESS;
3374}
3375#endif /* !defined(__MIG_check__Request__io_connect_method_scalarI_structureO_t__defined) */
3376#endif /* __MIG_check__Request__iokit_subsystem__ */
3377#endif /* ( __MigTypeCheck ) */
3378
3379
3380/* Routine io_connect_method_scalarI_structureO */
3381mig_internal novalue _Xio_connect_method_scalarI_structureO
3382 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
3383 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
3384 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
3385{
3386
3387#ifdef __MigPackStructs
3388#pragma pack(push, 4)
3389#endif
3390 typedef struct {
3391 NDR_record_t NDR;
3392 uint32_t selector;
3393 mach_msg_type_number_t inputCnt;
3394 int input[16];
3395 mach_msg_type_number_t outputCnt;
3396 mach_msg_trailer_t trailer;
3397 char padding[0]; /* Avoid generating empty UData structs */
3398 } RequestU __attribute__((unused));
3399#ifdef __MigPackStructs
3400#pragma pack(pop)
3401#endif
3402 typedef __RequestKData__io_connect_method_scalarI_structureO_t RequestK;
3403 typedef __RequestUData__io_connect_method_scalarI_structureO_t __RequestU;
3404 typedef __ReplyKData__io_connect_method_scalarI_structureO_t ReplyK __attribute__((unused));
3405 typedef __ReplyUData__io_connect_method_scalarI_structureO_t ReplyU __attribute__((unused));
3406 typedef __Reply__io_connect_method_scalarI_structureO_t Reply __attribute__((unused));
3407 typedef __Request__io_connect_method_scalarI_structureO_t __Request __attribute__((unused));
3408
3409 /*
3410 * typedef struct {
3411 * mach_msg_header_t Head;
3412 * NDR_record_t NDR;
3413 * kern_return_t RetCode;
3414 * } mig_reply_error_t;
3415 */
3416
3417 RequestK *InKP = (RequestK *) InHeadP;
3418 RequestU *In0UP = (RequestU *) InDataP;
3419 RequestU *In1UP;
3420 ReplyK *OutKP = (ReplyK *) OutHeadP;
3421 ReplyU *OutUP = (ReplyU *) OutDataP;
3422 (void)OutUP;
3423#ifdef __MIG_check__Request__io_connect_method_scalarI_structureO_t__defined
3424 kern_return_t check_result;
3425#endif /* __MIG_check__Request__io_connect_method_scalarI_structureO_t__defined */
3426
3427#if __MigKernelSpecificCode
3428#else
3429#endif /* __MigKernelSpecificCode */
3430 io_connect_t connection;
3431
3432 __DeclareRcvRpc(2823, "io_connect_method_scalarI_structureO")
3433 __BeforeRcvRpc(2823, "io_connect_method_scalarI_structureO")
3434
3435#if defined(__MIG_check__Request__io_connect_method_scalarI_structureO_t__defined)
3436 check_result = __MIG_check__Request__io_connect_method_scalarI_structureO_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP, In1UPP: (__RequestU **)&In1UP);
3437 if (check_result != MACH_MSG_SUCCESS)
3438 { MIG_RETURN_ERROR(OutKP, check_result); }
3439#endif /* defined(__MIG_check__Request__io_connect_method_scalarI_structureO_t__defined) */
3440
3441 connection = iokit_lookup_connect_port(port: InKP->Head.msgh_request_port);
3442
3443 OutUP->outputCnt = 4096;
3444 if (In1UP->outputCnt < OutUP->outputCnt)
3445 OutUP->outputCnt = In1UP->outputCnt;
3446
3447 OutUP->RetCode = is_io_connect_method_scalarI_structureO(connection, selector: In0UP->selector, input: In0UP->input, inputCnt: In0UP->inputCnt, output: OutUP->output, outputCnt: &OutUP->outputCnt);
3448 iokit_remove_connect_reference(obj: connection);
3449 if (OutUP->RetCode != KERN_SUCCESS) {
3450 MIG_RETURN_ERROR(OutKP, OutUP->RetCode);
3451 }
3452#if __MigKernelSpecificCode
3453#endif /* __MigKernelSpecificCode */
3454
3455 OutUP->NDR = NDR_record;
3456
3457 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 4096) + (_WALIGN_((OutUP->outputCnt + 3) & ~3));
3458
3459 __AfterRcvRpc(2823, "io_connect_method_scalarI_structureO")
3460}
3461
3462#if ( __MigTypeCheck )
3463#if __MIG_check__Request__iokit_subsystem__
3464#if !defined(__MIG_check__Request__io_connect_method_scalarI_structureI_t__defined)
3465#define __MIG_check__Request__io_connect_method_scalarI_structureI_t__defined
3466
3467mig_internal kern_return_t __MIG_check__Request__io_connect_method_scalarI_structureI_t(
3468 __attribute__((__unused__)) __RequestKData__io_connect_method_scalarI_structureI_t *InKP,
3469 __attribute__((__unused__)) __RequestUData__io_connect_method_scalarI_structureI_t *In0UP,
3470 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
3471 __attribute__((__unused__)) __RequestUData__io_connect_method_scalarI_structureI_t **In1UPP)
3472{
3473
3474 typedef __Request__io_connect_method_scalarI_structureI_t __Request;
3475 typedef __RequestUData__io_connect_method_scalarI_structureI_t __RequestU __attribute__((unused));
3476 __RequestU *In1UP;
3477#if __MigTypeCheck
3478 unsigned int msgh_size;
3479#endif /* __MigTypeCheck */
3480 unsigned int msgh_size_delta;
3481
3482#if __MigTypeCheck
3483 msgh_size = InKP->Head.msgh_size;
3484 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
3485 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 4160)) || (msgh_size > (mach_msg_size_t)sizeof(__Request)))
3486 return MIG_BAD_ARGUMENTS;
3487#endif /* __MigTypeCheck */
3488
3489#if defined(__NDR_convert__int_rep__Request__io_connect_method_scalarI_structureI_t__inputCnt__defined)
3490 if (In0UP->NDR.int_rep != NDR_record.int_rep)
3491 __NDR_convert__int_rep__Request__io_connect_method_scalarI_structureI_t__inputCnt(&In0UP->inputCnt, In0UP->NDR.int_rep);
3492#endif /* __NDR_convert__int_rep__Request__io_connect_method_scalarI_structureI_t__inputCnt__defined */
3493 msgh_size_delta = (4 * In0UP->inputCnt);
3494#if __MigTypeCheck
3495 if (In0UP->inputCnt > 16)
3496 return MIG_BAD_ARGUMENTS;
3497 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 4160)) / 4 < In0UP->inputCnt) ||
3498 (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 4160) + (4 * In0UP->inputCnt)))
3499 return MIG_BAD_ARGUMENTS;
3500 msgh_size -= msgh_size_delta;
3501#endif /* __MigTypeCheck */
3502
3503 *In1UPP = In1UP = (__RequestU *) ((pointer_t) In0UP + msgh_size_delta - 64);
3504
3505#if defined(__NDR_convert__int_rep__Request__io_connect_method_scalarI_structureI_t__inputStructCnt__defined)
3506 if (In0UP->NDR.int_rep != NDR_record.int_rep)
3507 __NDR_convert__int_rep__Request__io_connect_method_scalarI_structureI_t__inputStructCnt(&In1UP->inputStructCnt, In1UP->NDR.int_rep);
3508#endif /* __NDR_convert__int_rep__Request__io_connect_method_scalarI_structureI_t__inputStructCnt__defined */
3509#if __MigTypeCheck
3510 if (In1UP->inputStructCnt > 4096)
3511 return MIG_BAD_ARGUMENTS;
3512 if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 4160)) < In1UP->inputStructCnt) ||
3513 (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 4160) + _WALIGN_(In1UP->inputStructCnt)))
3514 return MIG_BAD_ARGUMENTS;
3515#endif /* __MigTypeCheck */
3516
3517 return MACH_MSG_SUCCESS;
3518}
3519#endif /* !defined(__MIG_check__Request__io_connect_method_scalarI_structureI_t__defined) */
3520#endif /* __MIG_check__Request__iokit_subsystem__ */
3521#endif /* ( __MigTypeCheck ) */
3522
3523
3524/* Routine io_connect_method_scalarI_structureI */
3525mig_internal novalue