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"
|
|
|
|
|
2012-10-29 04:55:19 +04:00
|
|
|
#ifndef _WIN32
|
|
|
|
|
2012-05-05 05:50:32 +04:00
|
|
|
void NdrConformantArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat)
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* 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;
|
|
|
|
element_size = *(unsigned short*) &pFormat[2];
|
|
|
|
|
|
|
|
if (type != FC_CARRAY)
|
|
|
|
{
|
2013-03-29 02:06:34 +04:00
|
|
|
fprintf(stderr, "error: expected FC_CARRAY, got 0x%02X\n", type);
|
2012-05-05 05:50:32 +04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-03-29 02:06:34 +04:00
|
|
|
fprintf(stderr, "warning: NdrConformantArrayBufferSize unimplemented\n");
|
2012-05-05 05:50:32 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void NdrConformantVaryingArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat)
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* FC_CVARRAY
|
|
|
|
* alignment<1>
|
|
|
|
* element_size<2>
|
|
|
|
* conformance_description<>
|
|
|
|
* variance_description<>
|
|
|
|
* [pointer_layout<>]
|
|
|
|
* element_description<>
|
|
|
|
* FC_END
|
|
|
|
*/
|
|
|
|
|
2013-03-29 02:06:34 +04:00
|
|
|
fprintf(stderr, "warning: NdrConformantVaryingArrayBufferSize unimplemented\n");
|
2012-05-05 05:50:32 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void NdrFixedArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat)
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
|
2013-03-29 02:06:34 +04:00
|
|
|
fprintf(stderr, "warning: NdrFixedArrayBufferSize unimplemented\n");
|
2012-05-05 05:50:32 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void NdrVaryingArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat)
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
|
2013-03-29 02:06:34 +04:00
|
|
|
fprintf(stderr, "warning: NdrVaryingArrayBufferSize unimplemented\n");
|
2012-05-05 05:50:32 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void NdrComplexArrayBufferSize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory, PFORMAT_STRING pFormat)
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* FC_BOGUS_ARRAY
|
|
|
|
* alignment<1>
|
|
|
|
* number_of_elements<2>
|
|
|
|
* conformance_description<>
|
|
|
|
* variance_description<>
|
|
|
|
* element_description<>
|
|
|
|
* FC_END
|
|
|
|
*/
|
|
|
|
|
2013-03-29 02:06:34 +04:00
|
|
|
fprintf(stderr, "warning: NdrComplexArrayBufferSize unimplemented\n");
|
2012-05-05 05:50:32 +04:00
|
|
|
}
|
2012-10-29 04:55:19 +04:00
|
|
|
|
|
|
|
#endif
|