Module: wine Branch: refs/heads/master Commit: 28f494e31acad4c22666321a7acb00e605f6d6c3 URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=28f494e31acad4c22666321a...
Author: Robert Shearman rob@codeweavers.com Date: Thu Apr 20 11:44:27 2006 +0100
rpcrt4: Use INTERPRETER_OPT_FLAGS in ndrtypes.h instead of flags on an unsigned char.
---
dlls/rpcrt4/ndr_stubless.c | 57 ++++++++++++++++++++++---------------------- include/ndrtypes.h | 17 +++++++++++++ include/wine/rpcfc.h | 7 ----- 3 files changed, 45 insertions(+), 36 deletions(-)
diff --git a/dlls/rpcrt4/ndr_stubless.c b/dlls/rpcrt4/ndr_stubless.c index b9d379e..442e4fe 100644 --- a/dlls/rpcrt4/ndr_stubless.c +++ b/dlls/rpcrt4/ndr_stubless.c @@ -198,21 +198,7 @@ typedef struct _NDR_PROC_PARTIAL_OIF_HEA * sizing pass */ unsigned short constant_server_buffer_size;
- /* -Oif flags: - * RPC_FC_PROC_OI2F_SRVMUSTSIZE = 0x01 - the server must perform a - * sizing pass. - * RPC_FC_PROC_OI2F_CLTMUSTSIZE = 0x02 - the client must perform a - * sizing pass. - * RPC_FC_PROC_OI2F_HASRETURN = 0x04 - procedure has a return value. - * RPC_FC_PROC_OI2F_HASPIPES = 0x08 - the pipe package should be used. - * RPC_FC_PROC_OI2F_HASASYNCUUID = 0x20 - indicates an asynchronous DCOM - * procedure. - * RPC_FC_PROC_OI2F_HASEXTS = 0x40 - indicates that Windows 2000 - * extensions are in use. - * RPC_FC_PROC_OI2F_HASASYNCHND = 0x80 - indicates an asynchronous RPC - * procedure. - */ - unsigned char Oif_flags; + INTERPRETER_OPT_FLAGS Oi2Flags;
/* number of params */ unsigned char number_of_params; @@ -406,6 +392,19 @@ static void WINAPI dump_RPC_FC_PROC_PF(P if (param_attributes.ServerAllocSize) TRACE(" ServerAllocSize = %d", param_attributes.ServerAllocSize * 8); }
+static void WINAPI dump_INTERPRETER_OPT_FLAGS(INTERPRETER_OPT_FLAGS Oi2Flags) +{ + if (Oi2Flags.ServerMustSize) TRACE(" ServerMustSize"); + if (Oi2Flags.ClientMustSize) TRACE(" ClientMustSize"); + if (Oi2Flags.HasReturn) TRACE(" HasReturn"); + if (Oi2Flags.HasPipes) TRACE(" HasPipes"); + if (Oi2Flags.Unused) TRACE(" Unused"); + if (Oi2Flags.HasAsyncUuid) TRACE(" HasAsyncUuid"); + if (Oi2Flags.HasExtensions) TRACE(" HasExtensions"); + if (Oi2Flags.HasAsyncHandle) TRACE(" HasAsyncHandle"); + TRACE("\n"); +} + /* FIXME: this will be different on other plaftorms than i386 */ #define ARG_FROM_OFFSET(args, offset) (*(unsigned char **)args + offset)
@@ -431,7 +430,7 @@ LONG_PTR WINAPIV NdrClientCall2(PMIDL_ST /* counter */ unsigned short i; /* cache of Oif_flags from v2 procedure header */ - unsigned char Oif_flags = 0; + INTERPRETER_OPT_FLAGS Oif_flags = { 0 }; /* cache of extension flags from NDR_PROC_EXTENSION */ unsigned char ext_flags = 0; /* the type of pass we are currently doing */ @@ -551,15 +550,15 @@ LONG_PTR WINAPIV NdrClientCall2(PMIDL_ST NDR_PROC_PARTIAL_OIF_HEADER * pOIFHeader = (NDR_PROC_PARTIAL_OIF_HEADER*)&pFormat[current_offset];
- Oif_flags = pOIFHeader->Oif_flags; + Oif_flags = pOIFHeader->Oi2Flags; number_of_params = pOIFHeader->number_of_params;
current_offset += sizeof(NDR_PROC_PARTIAL_OIF_HEADER); }
- TRACE("Oif_flags = 0x%02x\n", Oif_flags); + TRACE("Oif_flags = "); dump_INTERPRETER_OPT_FLAGS(Oif_flags);
- if (Oif_flags & RPC_FC_PROC_OI2F_HASEXTS) + if (Oif_flags.HasExtensions) { NDR_PROC_EXTENSION * pExtensions = (NDR_PROC_EXTENSION *)&pFormat[current_offset]; @@ -596,7 +595,7 @@ #endif if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_RPCSSALLOC) NdrRpcSmSetClientToOsf(&stubMsg);
- if (Oif_flags & RPC_FC_PROC_OI2F_HASPIPES) + if (Oif_flags.HasPipes) { FIXME("pipes not supported yet\n"); RpcRaiseException(RPC_X_WRONG_STUB_VERSION); /* FIXME: remove when implemented */ @@ -628,7 +627,7 @@ #endif /* allocate the buffer */ if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_OBJECT) NdrProxyGetBuffer(This, &stubMsg); - else if (Oif_flags & RPC_FC_PROC_OI2F_HASPIPES) + else if (Oif_flags.HasPipes) /* NdrGetPipeBuffer(...) */ FIXME("pipes not supported yet\n"); else @@ -648,7 +647,7 @@ #endif * params */ if (pProcHeader->Oi_flags & RPC_FC_PROC_OIF_OBJECT) NdrProxySendReceive(This, &stubMsg); - else if (Oif_flags & RPC_FC_PROC_OI2F_HASPIPES) + else if (Oif_flags.HasPipes) /* NdrPipesSendReceive(...) */ FIXME("pipes not supported yet\n"); else @@ -894,7 +893,7 @@ #endif /* NdrCorrelationFree(&stubMsg); */ }
- if (Oif_flags & RPC_FC_PROC_OI2F_HASPIPES) + if (Oif_flags.HasPipes) { /* NdrPipesDone(...) */ } @@ -997,7 +996,7 @@ long WINAPI NdrStubCall2( /* counter */ unsigned short i; /* cache of Oif_flags from v2 procedure header */ - unsigned char Oif_flags = 0; + INTERPRETER_OPT_FLAGS Oif_flags = { 0 }; /* cache of extension flags from NDR_PROC_EXTENSION */ unsigned char ext_flags = 0; /* the type of pass we are currently doing */ @@ -1084,15 +1083,15 @@ long WINAPI NdrStubCall2( NDR_PROC_PARTIAL_OIF_HEADER * pOIFHeader = (NDR_PROC_PARTIAL_OIF_HEADER*)&pFormat[current_offset];
- Oif_flags = pOIFHeader->Oif_flags; + Oif_flags = pOIFHeader->Oi2Flags; number_of_params = pOIFHeader->number_of_params;
current_offset += sizeof(NDR_PROC_PARTIAL_OIF_HEADER); }
- TRACE("Oif_flags = 0x%02x\n", Oif_flags); + TRACE("Oif_flags = "); dump_INTERPRETER_OPT_FLAGS(Oif_flags);
- if (Oif_flags & RPC_FC_PROC_OI2F_HASEXTS) + if (Oif_flags.HasExtensions) { NDR_PROC_EXTENSION * pExtensions = (NDR_PROC_EXTENSION *)&pFormat[current_offset]; @@ -1125,7 +1124,7 @@ #else FIXME("Set RPCSS memory allocation routines\n"); #endif
- if (Oif_flags & RPC_FC_PROC_OI2F_HASPIPES) + if (Oif_flags.HasPipes) { FIXME("pipes not supported yet\n"); RpcRaiseException(RPC_X_WRONG_STUB_VERSION); /* FIXME: remove when implemented */ @@ -1448,7 +1447,7 @@ #endif /* NdrCorrelationFree(&stubMsg); */ }
- if (Oif_flags & RPC_FC_PROC_OI2F_HASPIPES) + if (Oif_flags.HasPipes) { /* NdrPipesDone(...) */ } diff --git a/include/ndrtypes.h b/include/ndrtypes.h index b20092b..d7796ee 100644 --- a/include/ndrtypes.h +++ b/include/ndrtypes.h @@ -54,4 +54,21 @@ typedef struct * call. */ } PARAM_ATTRIBUTES;
+typedef struct +{ + unsigned char ServerMustSize : 1; /* 0x01 - the server must perform a + * sizing pass. */ + unsigned char ClientMustSize : 1; /* 0x02 - the client must perform a + * sizing pass. */ + unsigned char HasReturn : 1; /* 0x04 - procedure has a return value. */ + unsigned char HasPipes : 1; /* 0x08 - the pipe package should be used. */ + unsigned char Unused : 1; /* 0x10 - not used */ + unsigned char HasAsyncUuid : 1; /* 0x20 - indicates an asynchronous DCOM + * procedure. */ + unsigned char HasExtensions : 1; /* 0x40 - indicates that Win2000 + * extensions are in use. */ + unsigned char HasAsyncHandle : 1; /* 0x80 - indicates an asynchronous RPC + * procedure. */ +} INTERPRETER_OPT_FLAGS, *PINTERPRETER_OPT_FLAGS; + #endif diff --git a/include/wine/rpcfc.h b/include/wine/rpcfc.h index 0180a27..5761a01 100644 --- a/include/wine/rpcfc.h +++ b/include/wine/rpcfc.h @@ -160,13 +160,6 @@ #define RPC_FC_PROC_OIF_RPCFLAGS #define RPC_FC_PROC_OIF_OBJ_V2 0x20 #define RPC_FC_PROC_OIF_NEWINIT 0x40
-#define RPC_FC_PROC_OI2F_SRVMUSTSIZE 0x01 -#define RPC_FC_PROC_OI2F_CLTMUSTSIZE 0x02 -#define RPC_FC_PROC_OI2F_HASRETURN 0x04 -#define RPC_FC_PROC_OI2F_HASPIPES 0x08 -#define RPC_FC_PROC_OI2F_HASASYNCUUID 0x20 -#define RPC_FC_PROC_OI2F_HASEXTS 0x40 -#define RPC_FC_PROC_OI2F_HASASYNCHND 0x80 #define RPC_FC_PROC_PF_MUSTSIZE 0x0001 #define RPC_FC_PROC_PF_MUSTFREE 0x0002 #define RPC_FC_PROC_PF_PIPE 0x0004