123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250 |
- /*
- * IDENTIFICATION:
- * stub generated Tue Mar 6 23:07:11 2018
- * with a MiG generated by bootstrap_cmds-96.20.2
- * OPTIONS:
- */
- #define __MIG_check__Reply__jailbreak_daemon_subsystem__ 1
- #include "jailbreak_daemonUser.h"
- #ifndef mig_internal
- #define mig_internal static __inline__
- #endif /* mig_internal */
- #ifndef mig_external
- #define mig_external
- #endif /* mig_external */
- #if !defined(__MigTypeCheck) && defined(TypeCheck)
- #define __MigTypeCheck TypeCheck /* Legacy setting */
- #endif /* !defined(__MigTypeCheck) */
- #if !defined(__MigKernelSpecificCode) && defined(_MIG_KERNEL_SPECIFIC_CODE_)
- #define __MigKernelSpecificCode _MIG_KERNEL_SPECIFIC_CODE_ /* Legacy setting */
- #endif /* !defined(__MigKernelSpecificCode) */
- #ifndef LimitCheck
- #define LimitCheck 0
- #endif /* LimitCheck */
- #ifndef min
- #define min(a,b) ( ((a) < (b))? (a): (b) )
- #endif /* min */
- #if !defined(_WALIGN_)
- #define _WALIGN_(x) (((x) + 3) & ~3)
- #endif /* !defined(_WALIGN_) */
- #if !defined(_WALIGNSZ_)
- #define _WALIGNSZ_(x) _WALIGN_(sizeof(x))
- #endif /* !defined(_WALIGNSZ_) */
- #ifndef UseStaticTemplates
- #define UseStaticTemplates 0
- #endif /* UseStaticTemplates */
- #ifndef __MachMsgErrorWithTimeout
- #define __MachMsgErrorWithTimeout(_R_) { \
- switch (_R_) { \
- case MACH_SEND_INVALID_DATA: \
- case MACH_SEND_INVALID_DEST: \
- case MACH_SEND_INVALID_HEADER: \
- mig_put_reply_port(InP->Head.msgh_reply_port); \
- break; \
- case MACH_SEND_TIMED_OUT: \
- case MACH_RCV_TIMED_OUT: \
- default: \
- mig_dealloc_reply_port(InP->Head.msgh_reply_port); \
- } \
- }
- #endif /* __MachMsgErrorWithTimeout */
- #ifndef __MachMsgErrorWithoutTimeout
- #define __MachMsgErrorWithoutTimeout(_R_) { \
- switch (_R_) { \
- case MACH_SEND_INVALID_DATA: \
- case MACH_SEND_INVALID_DEST: \
- case MACH_SEND_INVALID_HEADER: \
- mig_put_reply_port(InP->Head.msgh_reply_port); \
- break; \
- default: \
- mig_dealloc_reply_port(InP->Head.msgh_reply_port); \
- } \
- }
- #endif /* __MachMsgErrorWithoutTimeout */
- #ifndef __DeclareSendRpc
- #define __DeclareSendRpc(_NUM_, _NAME_)
- #endif /* __DeclareSendRpc */
- #ifndef __BeforeSendRpc
- #define __BeforeSendRpc(_NUM_, _NAME_)
- #endif /* __BeforeSendRpc */
- #ifndef __AfterSendRpc
- #define __AfterSendRpc(_NUM_, _NAME_)
- #endif /* __AfterSendRpc */
- #ifndef __DeclareSendSimple
- #define __DeclareSendSimple(_NUM_, _NAME_)
- #endif /* __DeclareSendSimple */
- #ifndef __BeforeSendSimple
- #define __BeforeSendSimple(_NUM_, _NAME_)
- #endif /* __BeforeSendSimple */
- #ifndef __AfterSendSimple
- #define __AfterSendSimple(_NUM_, _NAME_)
- #endif /* __AfterSendSimple */
- #define msgh_request_port msgh_remote_port
- #define msgh_reply_port msgh_local_port
- #if ( __MigTypeCheck )
- #if __MIG_check__Reply__jailbreak_daemon_subsystem__
- #if !defined(__MIG_check__Reply__call_t__defined)
- #define __MIG_check__Reply__call_t__defined
- mig_internal kern_return_t __MIG_check__Reply__call_t(__Reply__call_t *Out0P)
- {
- typedef __Reply__call_t __Reply __attribute__((unused));
- if (Out0P->Head.msgh_id != 600) {
- if (Out0P->Head.msgh_id == MACH_NOTIFY_SEND_ONCE)
- { return MIG_SERVER_DIED; }
- else
- { return MIG_REPLY_MISMATCH; }
- }
- #if __MigTypeCheck
- if ((Out0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
- (Out0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Reply)))
- { return MIG_TYPE_ERROR ; }
- #endif /* __MigTypeCheck */
- {
- return Out0P->RetCode;
- }
- }
- #endif /* !defined(__MIG_check__Reply__call_t__defined) */
- #endif /* __MIG_check__Reply__jailbreak_daemon_subsystem__ */
- #endif /* ( __MigTypeCheck ) */
- /* Routine call */
- mig_external kern_return_t jbd_call
- (
- mach_port_t server_port,
- uint8_t command,
- uint32_t pid
- )
- {
- #ifdef __MigPackStructs
- #pragma pack(4)
- #endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- uint8_t command;
- char commandPad[3];
- uint32_t pid;
- } Request __attribute__((unused));
- #ifdef __MigPackStructs
- #pragma pack()
- #endif
- #ifdef __MigPackStructs
- #pragma pack(4)
- #endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- mach_msg_trailer_t trailer;
- } Reply __attribute__((unused));
- #ifdef __MigPackStructs
- #pragma pack()
- #endif
- #ifdef __MigPackStructs
- #pragma pack(4)
- #endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply __attribute__((unused));
- #ifdef __MigPackStructs
- #pragma pack()
- #endif
- /*
- * typedef struct {
- * mach_msg_header_t Head;
- * NDR_record_t NDR;
- * kern_return_t RetCode;
- * } mig_reply_error_t;
- */
- union {
- Request In;
- Reply Out;
- } Mess;
- Request *InP = &Mess.In;
- Reply *Out0P = &Mess.Out;
- mach_msg_return_t msg_result;
- #ifdef __MIG_check__Reply__call_t__defined
- kern_return_t check_result;
- #endif /* __MIG_check__Reply__call_t__defined */
- __DeclareSendRpc(500, "call")
- InP->NDR = NDR_record;
- InP->command = command;
- InP->pid = pid;
- InP->Head.msgh_bits =
- MACH_MSGH_BITS(19, MACH_MSG_TYPE_MAKE_SEND_ONCE);
- /* msgh_size passed as argument */
- InP->Head.msgh_request_port = server_port;
- InP->Head.msgh_reply_port = mig_get_reply_port();
- InP->Head.msgh_id = 500;
- InP->Head.msgh_reserved = 0;
-
- /* BEGIN VOUCHER CODE */
- #ifdef USING_VOUCHERS
- if (voucher_mach_msg_set != NULL) {
- voucher_mach_msg_set(&InP->Head);
- }
- #endif // USING_VOUCHERS
-
- /* END VOUCHER CODE */
- __BeforeSendRpc(500, "call")
- msg_result = mach_msg(&InP->Head, MACH_SEND_MSG|MACH_RCV_MSG|MACH_MSG_OPTION_NONE, (mach_msg_size_t)sizeof(Request), (mach_msg_size_t)sizeof(Reply), InP->Head.msgh_reply_port, 2500, MACH_PORT_NULL);
- __AfterSendRpc(500, "call")
- if (msg_result != MACH_MSG_SUCCESS) {
- __MachMsgErrorWithTimeout(msg_result);
- { return msg_result; }
- }
- #if defined(__MIG_check__Reply__call_t__defined)
- check_result = __MIG_check__Reply__call_t((__Reply__call_t *)Out0P);
- if (check_result != MACH_MSG_SUCCESS)
- { return check_result; }
- #endif /* defined(__MIG_check__Reply__call_t__defined) */
- return KERN_SUCCESS;
- }
|