-
- } else {
-
- /* If the request isn't an mkext, then is should be XML. Parse it
- * if possible and hand the request over to OSKext.
- */
- *op_result = OSKext::handleRequest(hostPriv,
- (OSKextLogSpec)clientLogSpec,
- request, requestLengthIn,
- &response, &responseLength,
- &logData, &logDataLength);
- }
-
- if (response && responseLength > 0) {
- kern_return_t copyin_result;
-
- copyin_result = vm_map_copyin(kernel_map,
- CAST_USER_ADDR_T(response), responseLength,
- /* src_destroy */ false, (vm_map_copy_t *)responseOut);
- if (copyin_result == KERN_SUCCESS) {
- *responseLengthOut = responseLength;
- } else {
- OSKextLog(/* kext */ NULL,
- kOSKextLogErrorLevel |
- kOSKextLogIPCFlag,
- "Failed to copy response to request from user space.");
- *op_result = copyin_result; // xxx - should we map to our own code?
- *responseOut = NULL;
- *responseLengthOut = 0;
- goto finish;
- }
- }
-
- if (logData && logDataLength > 0) {
- kern_return_t copyin_result;
-
- copyin_result = vm_map_copyin(kernel_map,
- CAST_USER_ADDR_T(logData), logDataLength,
- /* src_destroy */ false, (vm_map_copy_t *)logDataOut);
- if (copyin_result == KERN_SUCCESS) {
- *logDataLengthOut = logDataLength;
- } else {
- OSKextLog(/* kext */ NULL,
- kOSKextLogErrorLevel |
- kOSKextLogIPCFlag,
- "Failed to copy log data for request from user space.");
- *op_result = copyin_result; // xxx - should we map to our own code?
- *logDataOut = NULL;
- *logDataLengthOut = 0;
- goto finish;
- }
- }
+ } else {
+ /* If the request isn't an mkext, then is should be XML. Parse it
+ * if possible and hand the request over to OSKext.
+ */
+ *op_result = OSKext::handleRequest(hostPriv,
+ (OSKextLogSpec)clientLogSpec,
+ request, requestLengthIn,
+ &response, &responseLength,
+ &logData, &logDataLength);
+ }
+
+ if (response && responseLength > 0) {
+ kern_return_t copyin_result;
+
+ copyin_result = vm_map_copyin(kernel_map,
+ CAST_USER_ADDR_T(response), responseLength,
+ /* src_destroy */ false, (vm_map_copy_t *)responseOut);
+ if (copyin_result == KERN_SUCCESS) {
+ *responseLengthOut = responseLength;
+ } else {
+ OSKextLog(/* kext */ NULL,
+ kOSKextLogErrorLevel |
+ kOSKextLogIPCFlag,
+ "Failed to copy response to request from user space.");
+ *op_result = copyin_result; // xxx - should we map to our own code?
+ *responseOut = NULL;
+ *responseLengthOut = 0;
+ goto finish;
+ }
+ }
+
+ if (logData && logDataLength > 0) {
+ kern_return_t copyin_result;
+
+ copyin_result = vm_map_copyin(kernel_map,
+ CAST_USER_ADDR_T(logData), logDataLength,
+ /* src_destroy */ false, (vm_map_copy_t *)logDataOut);
+ if (copyin_result == KERN_SUCCESS) {
+ *logDataLengthOut = logDataLength;
+ } else {
+ OSKextLog(/* kext */ NULL,
+ kOSKextLogErrorLevel |
+ kOSKextLogIPCFlag,
+ "Failed to copy log data for request from user space.");
+ *op_result = copyin_result; // xxx - should we map to our own code?
+ *logDataOut = NULL;
+ *logDataLengthOut = 0;
+ goto finish;
+ }
+ }