Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

lpcmove.c File Reference

#include "lpcp.h"

Go to the source code of this file.

Functions

VOID LpcpMoveMessage (OUT PPORT_MESSAGE DstMsg, IN PPORT_MESSAGE SrcMsg, IN PUCHAR SrcMsgData, IN ULONG MsgType OPTIONAL, IN PCLIENT_ID ClientId OPTIONAL)


Function Documentation

VOID LpcpMoveMessage OUT PPORT_MESSAGE  DstMsg,
IN PPORT_MESSAGE  SrcMsg,
IN PUCHAR  SrcMsgData,
IN ULONG MsgType  OPTIONAL,
IN PCLIENT_ID ClientId  OPTIONAL
 

Copyright (C) 1996-97 Intel Corporation. All rights reserved.

The information and source code contained herein is the exclusive property of Intel Corporation and may not be disclosed, examined or reproduced in whole or in part without explicit written authorization from the company.

Definition at line 38 of file lpcmove.c.

References NULL.

00048 : 00049 00050 This function moves an LPC message block and optionally sets the message 00051 type and client id to the specified values. 00052 00053 Arguments: 00054 00055 DstMsg - Supplies a pointer to the destination message. 00056 00057 SrcMsg - Supplies a pointer to the source message. 00058 00059 SrcMsgData - Supplies a pointer to the source message data to 00060 copy to destination. 00061 00062 MsgType - If non-zero, then store in type field of the 00063 destination message. 00064 00065 ClientId - If non-NULL, then points to a ClientId to copy to 00066 the destination message. 00067 00068 Return Value: 00069 00070 None 00071 00072 --*/ 00073 00074 { 00075 ULONG NumberDwords; 00076 ULONGLONG Temp1, Temp2, Temp3; 00077 00078 // 00079 // Extract the data length and copy over the first dword 00080 // 00081 00082 *((PULONG)DstMsg)++ = NumberDwords = *((PULONG)SrcMsg)++; 00083 NumberDwords = ((0x0000FFFF & NumberDwords) + 3) >> 2; 00084 00085 // 00086 // Set the message type properly and update the second dword 00087 // 00088 00089 *((PULONG)DstMsg)++ = MsgType == 0 ? *((PULONG)SrcMsg)++ : 00090 *((PULONG)SrcMsg)++ & 0xFFFF0000 | MsgType & 0xFFFF; 00091 00092 // 00093 // Set the ClientId appropriately and update the third dword 00094 // 00095 00096 *((PULONG_PTR)DstMsg)++ = ClientId == NULL ? *((PULONG_PTR)SrcMsg) : 00097 *((PULONG_PTR)ClientId)++; 00098 ((PULONG_PTR)SrcMsg)++; 00099 00100 *((PULONG_PTR)DstMsg)++ = ClientId == NULL ? *((PULONG_PTR)SrcMsg) : 00101 *((PULONG_PTR)ClientId); 00102 ((PULONG_PTR)SrcMsg)++; 00103 00104 // 00105 // Update the final two longwords in the header 00106 // 00107 00108 *((PULONG_PTR)DstMsg)++ = *((PULONG_PTR)SrcMsg)++; 00109 *((PULONG_PTR)DstMsg)++ = *((PULONG_PTR)SrcMsg)++; 00110 00111 // 00112 // Copy the data 00113 // 00114 00115 if (NumberDwords > 0) { 00116 00117 if ((ULONG_PTR) SrcMsgData & (sizeof(ULONGLONG)-1)) { 00118 00119 // 00120 // SrcMsgData is 4-byte aligned while DstMsg is 8-byte aligned. 00121 // 00122 00123 Temp1 = *((PULONG) SrcMsgData)++; 00124 00125 while (NumberDwords >= 3) { 00126 00127 Temp2 = *((PULONGLONG)SrcMsgData)++; 00128 *((PULONGLONG)DstMsg)++ = (Temp2 << 32) | Temp1; 00129 Temp1 = Temp2 & 0x0000FFFF; 00130 NumberDwords -= sizeof(ULONGLONG) / sizeof(ULONG); 00131 } 00132 00133 *(PULONG)DstMsg = (ULONG)Temp1; 00134 NumberDwords--; 00135 00136 } else { 00137 00138 // 00139 // Both DstMsg and SrcMsgData are 8-byte aligned; 00140 // copy 2 dwords (1 qword) at a time. 00141 // 00142 00143 while (NumberDwords >= sizeof(ULONGLONG) / sizeof(ULONG)) { 00144 00145 *((PULONGLONG)DstMsg)++ = *((PULONGLONG)SrcMsgData)++; 00146 NumberDwords -= sizeof(ULONGLONG) / sizeof(ULONG); 00147 } 00148 } 00149 00150 // 00151 // copy the remaining dwords, if any 00152 // 00153 00154 while (NumberDwords--) { 00155 *((PULONG)DstMsg)++ = *((PULONG)SrcMsgData)++; 00156 } 00157 } 00158 }


Generated on Sat May 15 19:44:34 2004 for test by doxygen 1.3.7