2012-05-05 05:50:32 +04:00
|
|
|
/**
|
|
|
|
* WinPR: Windows Portable Runtime
|
|
|
|
* Microsoft Remote Procedure Call (MSRPC)
|
|
|
|
*
|
|
|
|
* Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2012-08-15 01:20:53 +04:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2012-05-05 05:50:32 +04:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include <winpr/rpc.h>
|
|
|
|
|
|
|
|
#include "ndr_array.h"
|
2014-08-18 20:57:08 +04:00
|
|
|
#include "ndr_private.h"
|
2012-05-05 05:50:32 +04:00
|
|
|
|
2012-10-29 04:55:19 +04:00
|
|
|
#ifndef _WIN32
|
|
|
|
|
2019-11-06 17:24:51 +03:00
|
|
|
void NdrConformantArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory,
|
|
|
|
PFORMAT_STRING pFormat)
|
2012-05-05 05:50:32 +04:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* FC_CARRAY
|
|
|
|
* alignment<1>
|
|
|
|
* element_size<2>
|
|
|
|
* conformance_description<>
|
|
|
|
* [pointer_layout<>]
|
|
|
|
* element_description<>
|
|
|
|
* FC_END
|
|
|
|
*/
|
|
|
|
unsigned char type;
|
|
|
|
unsigned char alignment;
|
|
|
|
unsigned short element_size;
|
|
|
|
type = pFormat[0];
|
|
|
|
alignment = pFormat[1] + 1;
|
2019-11-06 17:24:51 +03:00
|
|
|
element_size = *(unsigned short*)&pFormat[2];
|
2012-05-05 05:50:32 +04:00
|
|
|
|
|
|
|
if (type != FC_CARRAY)
|
|
|
|
{
|
2014-08-18 19:22:22 +04:00
|
|
|
WLog_ERR(TAG, "error: expected FC_CARRAY, got 0x%02X", type);
|
2012-05-05 05:50:32 +04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-08-18 19:22:22 +04:00
|
|
|
WLog_ERR(TAG, "warning: NdrConformantArrayBufferSize unimplemented");
|
2012-05-05 05:50:32 +04:00
|
|
|
}
|
|
|
|
|
2019-11-06 17:24:51 +03:00
|
|
|
void NdrConformantVaryingArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory,
|
|
|
|
PFORMAT_STRING pFormat)
|
2012-05-05 05:50:32 +04:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* FC_CVARRAY
|
|
|
|
* alignment<1>
|
|
|
|
* element_size<2>
|
|
|
|
* conformance_description<>
|
|
|
|
* variance_description<>
|
|
|
|
* [pointer_layout<>]
|
|
|
|
* element_description<>
|
|
|
|
* FC_END
|
|
|
|
*/
|
2014-08-18 19:22:22 +04:00
|
|
|
WLog_ERR(TAG, "warning: NdrConformantVaryingArrayBufferSize unimplemented");
|
2012-05-05 05:50:32 +04:00
|
|
|
}
|
|
|
|
|
2019-11-06 17:24:51 +03:00
|
|
|
void NdrFixedArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory,
|
|
|
|
PFORMAT_STRING pFormat)
|
2012-05-05 05:50:32 +04:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* FC_SMFARRAY
|
|
|
|
* alignment<1>
|
|
|
|
* total_size<2>
|
|
|
|
* [pointer_layout<>]
|
|
|
|
* element_description<>
|
|
|
|
* FC_END
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* FC_LGFARRAY
|
|
|
|
* alignment<1>
|
|
|
|
* total_size<4>
|
|
|
|
* [pointer_layout<>]
|
|
|
|
* element_description<>
|
|
|
|
* FC_END
|
|
|
|
*/
|
2014-08-18 19:22:22 +04:00
|
|
|
WLog_ERR(TAG, "warning: NdrFixedArrayBufferSize unimplemented");
|
2012-05-05 05:50:32 +04:00
|
|
|
}
|
|
|
|
|
2019-11-06 17:24:51 +03:00
|
|
|
void NdrVaryingArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory,
|
|
|
|
PFORMAT_STRING pFormat)
|
2012-05-05 05:50:32 +04:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* FC_SMVARRAY
|
|
|
|
* alignment<1>
|
|
|
|
* total_size<2>
|
|
|
|
* number_elements<2>
|
|
|
|
* element_size<2>
|
|
|
|
* variance_description<>
|
|
|
|
* [pointer_layout<>]
|
|
|
|
* element_description<>
|
|
|
|
* FC_END
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* FC_LGVARRAY
|
|
|
|
* alignment<1>
|
|
|
|
* total_size<4>
|
|
|
|
* number_elements<4>
|
|
|
|
* element_size<2>
|
|
|
|
* variance_description<4>
|
|
|
|
* [pointer_layout<>]
|
|
|
|
* element_description<>
|
|
|
|
* FC_END
|
|
|
|
*/
|
2014-08-18 19:22:22 +04:00
|
|
|
WLog_ERR(TAG, "warning: NdrVaryingArrayBufferSize unimplemented");
|
2012-05-05 05:50:32 +04:00
|
|
|
}
|
|
|
|
|
2019-11-06 17:24:51 +03:00
|
|
|
void NdrComplexArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory,
|
|
|
|
PFORMAT_STRING pFormat)
|
2012-05-05 05:50:32 +04:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* FC_BOGUS_ARRAY
|
|
|
|
* alignment<1>
|
|
|
|
* number_of_elements<2>
|
|
|
|
* conformance_description<>
|
|
|
|
* variance_description<>
|
|
|
|
* element_description<>
|
|
|
|
* FC_END
|
|
|
|
*/
|
2014-08-18 19:22:22 +04:00
|
|
|
WLog_ERR(TAG, "warning: NdrComplexArrayBufferSize unimplemented");
|
2012-05-05 05:50:32 +04:00
|
|
|
}
|
2012-10-29 04:55:19 +04:00
|
|
|
|
|
|
|
#endif
|