/* * Copyright (c) Likewise Software. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. You should have received a copy of the GNU General * Public License along with this program. If not, see * . * * LIKEWISE SOFTWARE MAKES THIS SOFTWARE AVAILABLE UNDER OTHER LICENSING * TERMS AS WELL. IF YOU HAVE ENTERED INTO A SEPARATE LICENSE AGREEMENT * WITH LIKEWISE SOFTWARE, THEN YOU MAY ELECT TO USE THE SOFTWARE UNDER THE * TERMS OF THAT SOFTWARE LICENSE AGREEMENT INSTEAD OF THE TERMS OF THE GNU * GENERAL PUBLIC LICENSE, NOTWITHSTANDING THE ABOVE NOTICE. IF YOU * HAVE QUESTIONS, OR WISH TO REQUEST A COPY OF THE ALTERNATE LICENSING * TERMS OFFERED BY LIKEWISE SOFTWARE, PLEASE CONTACT LIKEWISE SOFTWARE AT * license@likewise.com */ #include "includes.h" NTSTATUS WireUnmarshallFlushRequest( const PBYTE pParams, ULONG ulBytesAvailable, ULONG ulOffset, PFLUSH_REQUEST_HEADER* ppRequestHeader ) { NTSTATUS ntStatus = 0; PBYTE pDataCursor = pParams; PFLUSH_REQUEST_HEADER pRequestHeader = NULL; if (ulBytesAvailable < sizeof(FLUSH_REQUEST_HEADER)) { ntStatus = STATUS_INVALID_BUFFER_SIZE; BAIL_ON_NT_STATUS(ntStatus); } pRequestHeader = (PFLUSH_REQUEST_HEADER)pDataCursor; // pDataCursor += sizeof(FLUSH_REQUEST_HEADER); // ulOffset += sizeof(FLUSH_REQUEST_HEADER); *ppRequestHeader = pRequestHeader; cleanup: return ntStatus; error: *ppRequestHeader = NULL; goto cleanup; } NTSTATUS WireMarshallFlushResponse( PBYTE pParams, ULONG ulBytesAvailable, ULONG ulOffset, PFLUSH_RESPONSE_HEADER* ppResponseHeader, PUSHORT pusPackageBytesUsed ) { NTSTATUS ntStatus = 0; PFLUSH_RESPONSE_HEADER pResponseHeader = NULL; USHORT usPackageBytesUsed = 0; if (ulBytesAvailable < sizeof(FLUSH_RESPONSE_HEADER)) { ntStatus = STATUS_INVALID_BUFFER_SIZE; BAIL_ON_NT_STATUS(ntStatus); } pResponseHeader = (PFLUSH_RESPONSE_HEADER)pParams; usPackageBytesUsed += sizeof(FLUSH_RESPONSE_HEADER); pResponseHeader->usByteCount = usPackageBytesUsed; *ppResponseHeader = pResponseHeader; *pusPackageBytesUsed = usPackageBytesUsed; cleanup: return ntStatus; error: *ppResponseHeader = NULL; *pusPackageBytesUsed = 0; goto cleanup; }