Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update type of FC_SYSTEM_HANDLE #72

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions RpcDecompiler/internalRpcDecompTypeDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ typedef struct _RpcDecompilerCtxt_T{
#define ERROR_ZERO_TYPEOFFSET_MSG "\nERROR: TypeOffset == 0 whereas Type is not simple Type\n"


#define NB_DIGIT_MAX_INT_32BITS_BASE_10 11 //2^32 = 4294967296 ==> 10 caract�res ou word
//2^31 = 2147483648 + signe ==> 11 caract�res ou word
#define NB_DIGIT_MAX_INT_32BITS_BASE_10 11 //2^32 = 4294967296 ==> 10 caractères ou word
//2^31 = 2147483648 + signe ==> 11 caractères ou word
#define BASE_10 10

#define EMPTY_PARAM_ATTR 0x0000
Expand Down Expand Up @@ -241,7 +241,7 @@ typedef struct Oif_Header_t
been precomputed by the compiler. This may be only a partial size,
as the SERVER_MUST_SIZE flag triggers the sizing. */
INTERPRETER_OPT_FLAGS interpreter_opt_flag; // Voir interpreter_opt_flag values
unsigned char number_of_param; // Nombre de param�tres d�crits de la proc�dure, return compris
unsigned char number_of_param; // Nombre de paramètres décrits de la procédure, return compris
}Oif_Header_t, OIF_HEADER_T;

//------------------------------------------------------------------------------
Expand Down Expand Up @@ -296,8 +296,8 @@ typedef struct Win2kExt_Header_t
a default size should be used. */
unsigned short serverCorrHint;
unsigned short notifyIndex; // TODO ? : The NotifyIndex element is an index to a notify routine, if one is used.
FloatDoubleMask_t floatDoubleMask; /* Si extension_version == WIN2K_EXT_HEADER_32B_SIZE floatDoubleMask est non pr�sent,
sinon si extension_version == WIN2K_EXT_HEADER_64B_SIZE floatDoubleMask est pr�sent */
FloatDoubleMask_t floatDoubleMask; /* Si extension_version == WIN2K_EXT_HEADER_32B_SIZE floatDoubleMask est non présent,
sinon si extension_version == WIN2K_EXT_HEADER_64B_SIZE floatDoubleMask est présent */
}Win2kExt_Header_t;


Expand Down Expand Up @@ -423,7 +423,7 @@ typedef struct PARAM_ATTRIBUTES
unsigned short IsIn : 1; // 0x0008
unsigned short IsOut : 1; // 0x0010
unsigned short IsReturn : 1; // 0x0020
unsigned short IsBasetype : 1; /* 0x0040 set for simple types that are being marshaled by the main Oif
unsigned short IsBasetype : 1; /* 0x0040 set for simple types that are being marshaled by the main –Oif
interpreter loop. In particular, a simple type with a range
attribute on it is not flagged as a base type in order to force
the range routine marshaling through dispatching using an FC_RANGE
Expand All @@ -433,7 +433,7 @@ typedef struct PARAM_ATTRIBUTES
types, regardless of whether the argument is a pointer. The compound
types for which it is set are structures, unions, transmit_as,
represent_as, wire_marshal and SAFEARRAY. In general, the bit was
introduced for the benefit of the main interpreter loop in the Oicf
introduced for the benefit of the main interpreter loop in the –Oicf
interpreter, to ensure the nonsimple arguments (refe rred to as compound
type arguments) are properly dereferenced. This bit was never used in
previous versions of the interpreter.
Expand Down Expand Up @@ -596,7 +596,7 @@ enum FC_TYPE
FC_ALIGNM8 = 0x39,
FC_UNUSED2 = 0x3A,
FC_UNUSED3 = 0x3B,
FC_UNUSED4 = 0x3C,
FC_SYSTEM_HANDLE = 0x3C,
FC_STRUCTPAD1 = 0x3D,
FC_STRUCTPAD2 = 0x3E,
FC_STRUCTPAD3 = 0x3F,
Expand Down Expand Up @@ -688,7 +688,7 @@ the conformance size. No further computation is required. */
#define FC_TOP_LEVEL_MULTID_CONFORMANCE 0x80 /* For top-level conformance of a multidimensional array described
by another parameter.
Note Multidimensional sized arrays and pointers trigger a
switch to Oicf. */
switch to –Oicf. */
#define CORR_TYPE_4_LOWER_NIBBLE_MASK 0x0F
#define CORR_TYPE_4_UPPER_NIBBLE_MASK 0xF0

Expand Down Expand Up @@ -733,7 +733,7 @@ typedef struct CorrelationDescriptorNonRobust_t

unsigned char correlation_operator; // voir correlation_operator values
INT16 offset;
/* The offset<2> field is typically a relative memory offset to the expression argument variable. It can also be an expression evaluationroutine
/* The offset<2> field is typically a relative memory offset to the expression argument variable. It can also be an expression evaluation–routine
index. As mentioned previously in this document, for constant expressions it is a part of actual, final expression value.

The interpretation of the offset<2> field as memory offset depends on the complexity of the expression, the location of the expression variable,
Expand All @@ -745,7 +745,7 @@ typedef struct CorrelationDescriptorNonRobust_t
conformant array is at the end of the structure.

For top-level conformance, the offset field contains the offset from the stub's first parameter's location on the stack to the parameter that describes
the conformance. This is not used in Os mode. There are other exceptions to the interpretation of the offset field; such exceptions are described in
the conformance. This is not used in –Os mode. There are other exceptions to the interpretation of the offset field; such exceptions are described in
the description of those types.

When offset<2> is used with FC_CALLBACK, it contains an index in the expression evaluation routine table generated by the compiler. The stub message
Expand All @@ -764,7 +764,7 @@ typedef struct CorrelationDescriptorRobust_t

unsigned char correlation_operator; // voir correlation_operator values
INT16 offset;
/* The offset<2> field is typically a relative memory offset to the expression argument variable. It can also be an expression evaluationroutine
/* The offset<2> field is typically a relative memory offset to the expression argument variable. It can also be an expression evaluation–routine
index. As mentioned previously in this document, for constant expressions it is a part of actual, final expression value.

The interpretation of the offset<2> field as memory offset depends on the complexity of the expression, the location of the expression variable,
Expand All @@ -776,7 +776,7 @@ typedef struct CorrelationDescriptorRobust_t
conformant array is at the end of the structure.

For top-level conformance, the offset field contains the offset from the stub's first parameter's location on the stack to the parameter that describes
the conformance. This is not used in Os mode. There are other exceptions to the interpretation of the offset field; such exceptions are described in
the conformance. This is not used in –Os mode. There are other exceptions to the interpretation of the offset field; such exceptions are described in
the description of those types.

When offset<2> is used with FC_CALLBACK, it contains an index in the expression evaluation routine table generated by the compiler. The stub message
Expand Down Expand Up @@ -932,10 +932,10 @@ typedef struct PointerInstance_t
(the end of the nonconformant portion of conformant structures): for arrays, the
offset is from the beginning of the array.
*/
PointerDescription_U pointerDescription; /* d'apr�s la doc MSDN partie Pointer Layout,
pointerDescription est de taille 4 ce qui correspond la taille des types
PointerDescription_U pointerDescription; /* d'après la doc MSDN partie Pointer Layout,
pointerDescription est de taille 4 ce qui correspond à la taille des types
commonPtrSimple et commonPtrComplex.
TODO : valider cette hypoth�se au cours des tests
TODO : valider cette hypothèse au cours des tests
*/
}PointerInstance_t;

Expand Down Expand Up @@ -1329,7 +1329,7 @@ typedef struct HardStructHeader_t
UINT32 reserved;
INT16 enumOffset; /* The enum_offset<2> field provides the offset from the beginning of the
structure in memory to an enum16 if it contains one; otherwise the
enum_offset<2> field is 1. */
enum_offset<2> field is –1. */
UINT16 copySize; /* The copy_size<2> field provides the total number of bytes in the structure,
which may be block-copied into/from the buffer. This total does not include
any trailing union nor any end-padding in memory. This value is also the amount
Expand Down Expand Up @@ -1668,7 +1668,7 @@ TypeFormat_t * firstType;
//#define FC_TRANSMIT_AS 0x2d
//#define FC_REPRESENT_AS 0x2e

// TODO : voir utilit�
// TODO : voir utilité
//#define FC_POINTER 0x36
//
//
Expand Down
13 changes: 11 additions & 2 deletions RpcDecompiler/internalRpcDecompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,7 @@ DWORD __fastcall getSimpleTypeMemorySize(_In_ FC_TYPE fcType)
case FC_DOUBLE:
case FC_INT3264:
case FC_UINT3264:
case FC_SYSTEM_HANDLE:
return 8;

case FC_ZERO:
Expand Down Expand Up @@ -787,6 +788,9 @@ BOOL __fastcall printSimpleType(
oss << "unsigned __int3264 ";
break;

case FC_SYSTEM_HANDLE:
oss << "/* FC_SYSTEM_HANDLE */ hyper ";
break;

default :
oss << "[ERROR] parseBaseType : unknown type ("<<fcType<<")";
Expand Down Expand Up @@ -845,6 +849,7 @@ BOOL __fastcall rpcDumpType(
case FC_IGNORE:
case FC_INT3264:
case FC_UINT3264:
case FC_SYSTEM_HANDLE:
//processSimpleType(pContext,
bResult = processSimpleType(pContext, (FC_TYPE)bFC_TYPE, paramDesc, oss);
if (bResult==FALSE) RPC_ERROR_FN("processSimpleType failed\n");
Expand Down Expand Up @@ -1018,8 +1023,11 @@ BOOL __fastcall rpcDumpType(
bResult = TRUE;
break;
default:
RPC_ERROR_FN("Invalid type\n");
oss << "[ERROR] dump type : unknown type (0x" << std::hex << (int)bFC_TYPE << ")" << std::endl;
RPC_ERROR_FN("Invalid type\n");
oss << "[ERROR] dump type : unknown_type (0x" << std::hex << (int)bFC_TYPE << ") ";
oss<<paramDesc.getStrTypeName();
bResult = TRUE;
return bResult;

return FALSE;
}
Expand Down Expand Up @@ -1076,6 +1084,7 @@ BOOL __fastcall getTypeMemorySize(
case FC_IGNORE:
case FC_INT3264:
case FC_UINT3264:
case FC_SYSTEM_HANDLE:
//processSimpleType(pContext,
(*pszMemorySize) = getSimpleTypeMemorySize((FC_TYPE)bFC_TYPE);
bResult = TRUE;
Expand Down
3 changes: 2 additions & 1 deletion RpcDecompiler/internalTypeTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ BOOL __fastcall isSimpleType(
type == FC_ERROR_STATUS_T ||
type == FC_INT3264 ||
type == FC_UINT3264 ||
type == FC_IGNORE
type == FC_IGNORE ||
type == FC_SYSTEM_HANDLE
)
{
bResult = TRUE;
Expand Down