From: VMware, Inc <> Date: Tue, 17 Nov 2009 21:27:24 +0000 (-0800) Subject: Remove rpchChannel.h's dependendy on rpcin.h. X-Git-Tag: 2009.11.16-210370~47 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5f6e136243f40ec4db045ab5c4206e457eb384f2;p=thirdparty%2Fopen-vm-tools.git Remove rpchChannel.h's dependendy on rpcin.h. rpcChannel.h is part of the "public" tools core API, and shouldn't expose internal APIs (such as those in rpcin.h). This has the downside of having to duplicate some definitions from rpcin.h, since we still have code that uses the rpcin library directly. This change also standardizes rpcChannel.h's interface to use glib types and not VMware types. This is the cause of most of the churn in this change (Bool -> gboolean), and also required the definition of a new type (RpcInRet) to be used while we still have code that needs to be compatible both with vmtoolsd and vmware-user; this type can (and should) go away once vmware-user is deprecated. Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/lib/include/resolution.h b/open-vm-tools/lib/include/resolution.h index fcff0c1b8..f72534ac9 100644 --- a/open-vm-tools/lib/include/resolution.h +++ b/open-vm-tools/lib/include/resolution.h @@ -50,7 +50,6 @@ #include "includeCheck.h" #include "vmware.h" -#include "rpcin.h" /* @@ -88,6 +87,10 @@ typedef enum { * Global functions */ +#if !defined(VMTOOLS_USE_GLIB) + +#include "rpcin.h" + Bool Resolution_Init(const char *tcloChannel, InitHandle handle); void Resolution_Cleanup(void); @@ -97,4 +100,6 @@ void Resolution_CleanupBackdoor(void); Bool Resolution_RegisterCaps(void); Bool Resolution_UnregisterCaps(void); +#endif + #endif // ifndef _LIB_RESOLUTION_H_ diff --git a/open-vm-tools/lib/include/rpcChannel.h b/open-vm-tools/lib/include/rpcChannel.h index ea03cbf9c..4fdfe3a78 100644 --- a/open-vm-tools/lib/include/rpcChannel.h +++ b/open-vm-tools/lib/include/rpcChannel.h @@ -40,13 +40,51 @@ # error "This library needs to be compiled with VMTOOLS_USE_GLIB." #endif -#include -#include "vm_basic_types.h" -#include "vm_assert.h" -#include "rpcin.h" +#include +#include "vmware.h" + +/** Alias for RpcChannel_SetRetVals. */ +#define RPCIN_SETRETVALS RpcChannel_SetRetVals struct RpcChannel; +/** Data structure passed to RPC callbacks. */ +typedef struct RpcInData { + /** RPC name. */ + const char *name; + /** + * RPC arguments. Either the raw argument data, or de-serialized XDR data + * in case @a xdrIn was provided in the registration data. + */ + const char *args; + /** Size of raw argument data, in bytes. */ + size_t argsSize; + /** + * Data to be returned to the caller, or pointer to XDR structure if + * @a xdrOut was provided in the registration data. + */ + char *result; + /** Length in bytes of raw data being returned (ignored for XDR structures). */ + size_t resultLen; + /** + * Whether the RPC library should free the contents of the @a result + * field (using vm_free()). + */ + gboolean freeResult; + /** Application context. */ + void *appCtx; + /** Client data specified in the registration data. */ + void *clientData; +} RpcInData; + + +/** + * Type for RpcIn callbacks. The callback function is responsible for + * allocating memory for the result string. + */ +typedef gboolean (*RpcIn_Callback)(RpcInData *data); + + /** Defines the registration data for a GuestRPC application. */ typedef struct RpcChannelCallback { /** String identifying the RPC message. */ @@ -72,14 +110,14 @@ typedef struct RpcChannelCallback { } RpcChannelCallback; -typedef Bool (*RpcChannelStartFn)(struct RpcChannel *); +typedef gboolean (*RpcChannelStartFn)(struct RpcChannel *); typedef void (*RpcChannelStopFn)(struct RpcChannel *); typedef void (*RpcChannelShutdownFn)(struct RpcChannel *); -typedef Bool (*RpcChannelSendFn)(struct RpcChannel *, - char *data, - size_t dataLen, - char **result, - size_t *resultLen); +typedef gboolean (*RpcChannelSendFn)(struct RpcChannel *, + char *data, + size_t dataLen, + char **result, + size_t *resultLen); /** @@ -122,7 +160,8 @@ typedef struct RpcChannel { * * @return TRUE on success. */ -static INLINE Bool + +static INLINE gboolean RpcChannel_Start(RpcChannel *chan) { ASSERT(chan != NULL); @@ -147,6 +186,7 @@ RpcChannel_Stop(RpcChannel *chan) chan->stop(chan); } + /** * Wrapper for the send function of an RPC channel struct. * @@ -159,7 +199,7 @@ RpcChannel_Stop(RpcChannel *chan) * @return The status from the remote end (TRUE if call was successful). */ -static INLINE Bool +static INLINE gboolean RpcChannel_Send(RpcChannel *chan, char *data, size_t dataLen, @@ -172,7 +212,7 @@ RpcChannel_Send(RpcChannel *chan, return chan->send(chan, data, dataLen, result, resultLen); } -Bool +gboolean RpcChannel_BuildXdrCommand(const char *cmd, void *xdrProc, void *xdrData, @@ -182,7 +222,7 @@ RpcChannel_BuildXdrCommand(const char *cmd, gboolean RpcChannel_Destroy(RpcChannel *chan); -Bool +gboolean RpcChannel_Dispatch(RpcInData *data); void @@ -197,6 +237,11 @@ void RpcChannel_RegisterCallback(RpcChannel *chan, RpcChannelCallback *rpc); +gboolean +RpcChannel_SetRetVals(RpcInData *data, + char *result, + gboolean retVal); + void RpcChannel_UnregisterCallback(RpcChannel *chan, RpcChannelCallback *rpc); diff --git a/open-vm-tools/lib/include/rpcin.h b/open-vm-tools/lib/include/rpcin.h index 0fe53e949..c624c3fc9 100644 --- a/open-vm-tools/lib/include/rpcin.h +++ b/open-vm-tools/lib/include/rpcin.h @@ -29,19 +29,27 @@ #if defined(VMTOOLS_USE_GLIB) # include + typedef gboolean RpcInRet; #else # include "dbllnklst.h" + typedef Bool RpcInRet; #endif -/* Helper macro for porting old callbacks that currently use RpcIn_SetRetVals. */ -#define RPCIN_SETRETVALS(data, val, retVal) \ - RpcIn_SetRetVals((char const **) &(data)->result, &(data)->resultLen, \ - (val), (retVal)) - typedef void RpcIn_ErrorFunc(void *clientData, char const *status); typedef struct RpcIn RpcIn; +#if defined(VMTOOLS_USE_GLIB) + +RpcIn *RpcIn_Construct(GMainContext *mainCtx, + RpcIn_Callback dispatch, + gpointer clientData); + +Bool RpcIn_start(RpcIn *in, unsigned int delay, + RpcIn_ErrorFunc *errorFunc, void *errorData); + +#else + /* Data passed to new-style RpcIn callbacks. */ typedef struct RpcInData { /* Data from the host's RPC request. */ @@ -62,19 +70,8 @@ typedef struct RpcInData { * Type for RpcIn callbacks. The callback function is responsible for * allocating memory for the result string. */ -typedef Bool (*RpcIn_Callback)(RpcInData *data); - +typedef RpcInRet (*RpcIn_Callback)(RpcInData *data); -#if defined(VMTOOLS_USE_GLIB) - -RpcIn *RpcIn_Construct(GMainContext *mainCtx, - RpcIn_Callback dispatch, - gpointer clientData); - -Bool RpcIn_start(RpcIn *in, unsigned int delay, - RpcIn_ErrorFunc *errorFunc, void *errorData); - -#else /* * Type for old RpcIn callbacks. Don't use this anymore - this is here @@ -105,13 +102,19 @@ void RpcIn_RegisterCallbackEx(RpcIn *in, const char *name, RpcIn_Callback callback, void *clientData); void RpcIn_UnregisterCallback(RpcIn *in, const char *name); +/* Helper macro for porting old callbacks that currently use RpcIn_SetRetVals. */ +#define RPCIN_SETRETVALS(data, val, retVal) \ + RpcIn_SetRetVals((char const **) &(data)->result, &(data)->resultLen, \ + (val), (retVal)) + +unsigned int RpcIn_SetRetVals(char const **result, size_t *resultLen, + const char *resultVal, Bool retVal); + #endif void RpcIn_Destruct(RpcIn *in); Bool RpcIn_restart(RpcIn *in); Bool RpcIn_stop(RpcIn *in); -unsigned int RpcIn_SetRetVals(char const **result, size_t *resultLen, - const char *resultVal, Bool retVal); #endif /* __RPCIN_H__ */ diff --git a/open-vm-tools/lib/include/vmtoolsApp.h b/open-vm-tools/lib/include/vmtoolsApp.h index 16f2a63c8..ea35df76c 100644 --- a/open-vm-tools/lib/include/vmtoolsApp.h +++ b/open-vm-tools/lib/include/vmtoolsApp.h @@ -217,7 +217,7 @@ typedef struct ToolsAppCtx { * * @return TRUE if COM is initialized when the function returns. */ -static INLINE gboolean +G_INLINE_FUNC gboolean ToolsCore_InitializeCOM(ToolsAppCtx *ctx) { if (!ctx->comInitialized) { diff --git a/open-vm-tools/lib/rpcChannel/bdoorChannel.c b/open-vm-tools/lib/rpcChannel/bdoorChannel.c index 80dd801f8..971f1e08b 100644 --- a/open-vm-tools/lib/rpcChannel/bdoorChannel.c +++ b/open-vm-tools/lib/rpcChannel/bdoorChannel.c @@ -25,6 +25,7 @@ #include "vm_assert.h" #include "rpcChannelInt.h" +#include "rpcin.h" #include "rpcout.h" #include "util.h" @@ -94,7 +95,7 @@ RpcInStopChannel(RpcChannel *chan, * @return TRUE on success. */ -static Bool +static gboolean RpcInStart(RpcChannel *chan) { gboolean ret; @@ -162,7 +163,7 @@ RpcInStop(RpcChannel *chan) * @return The status from the remote end (TRUE if call was successful). */ -static Bool +static gboolean RpcInSend(RpcChannel *chan, char *data, size_t dataLen, diff --git a/open-vm-tools/lib/rpcChannel/rpcChannel.c b/open-vm-tools/lib/rpcChannel/rpcChannel.c index a68023ef8..3cc0c4d5a 100644 --- a/open-vm-tools/lib/rpcChannel/rpcChannel.c +++ b/open-vm-tools/lib/rpcChannel/rpcChannel.c @@ -34,7 +34,7 @@ /** Max number of times to attempt a channel restart. */ #define RPCIN_MAX_RESTARTS 60 -static Bool +static gboolean RpcChannelPing(RpcInData *data); static RpcChannelCallback gRpcHandlers[] = { @@ -50,7 +50,7 @@ static RpcChannelCallback gRpcHandlers[] = { * @return TRUE. */ -static Bool +static gboolean RpcChannelPing(RpcInData *data) { return RPCIN_SETRETVALS(data, "", TRUE); @@ -144,7 +144,7 @@ exit: * @return TRUE. */ -static Bool +static gboolean RpcChannelReset(RpcInData *data) { gchar *msg; @@ -262,7 +262,7 @@ exit: * @return Whether successfully built the command. */ -Bool +gboolean RpcChannel_BuildXdrCommand(const char *cmd, void *xdrProc, void *xdrData, @@ -310,7 +310,7 @@ exit: * @return Whether the RPC was handled successfully. */ -Bool +gboolean RpcChannel_Dispatch(RpcInData *data) { char *name = NULL; @@ -470,6 +470,32 @@ RpcChannel_Setup(RpcChannel *chan, } + +/** + * Sets the result of the given RPC context to the given value. The result + * should be a NULL-terminated string. + * + * @param[in] data RPC context. + * @param[in] result Result string. + * @param[in] retVal Return value of this function. + * + * @return @a retVal + */ + +gboolean +RpcChannel_SetRetVals(RpcInData *data, + char *result, + gboolean retVal) +{ + ASSERT(data); + + data->result = result; + data->resultLen = strlen(data->result); + + return retVal; +} + + /** * Registers a new RPC handler in the given RPC channel. This function is * not thread-safe. diff --git a/open-vm-tools/lib/rpcIn/rpcin.c b/open-vm-tools/lib/rpcIn/rpcin.c index 0f469b8b1..3fbd342de 100644 --- a/open-vm-tools/lib/rpcIn/rpcin.c +++ b/open-vm-tools/lib/rpcIn/rpcin.c @@ -44,7 +44,9 @@ # include "strutil.h" #endif - +#if defined(VMTOOLS_USE_GLIB) +# include "rpcChannel.h" +#endif #include "vmware.h" #include "message.h" @@ -910,6 +912,7 @@ RpcIn_restart(RpcIn *in) // IN } +#if !defined(VMTOOLS_USE_GLIB) /* *----------------------------------------------------------------------------- * @@ -944,4 +947,4 @@ RpcIn_SetRetVals(char const **result, // OUT return retVal; } - +#endif diff --git a/open-vm-tools/services/plugins/guestInfo/guestInfoServer.c b/open-vm-tools/services/plugins/guestInfo/guestInfoServer.c index 9380aa432..f3fdb9d63 100644 --- a/open-vm-tools/services/plugins/guestInfo/guestInfoServer.c +++ b/open-vm-tools/services/plugins/guestInfo/guestInfoServer.c @@ -127,7 +127,7 @@ static void TweakGatherLoop(ToolsAppCtx *ctx); * @return TRUE on success. */ -static Bool +static gboolean GuestInfoVMSupport(RpcInData *data) { #if defined(_WIN32) diff --git a/open-vm-tools/services/plugins/hgfsServer/hgfsPlugin.c b/open-vm-tools/services/plugins/hgfsServer/hgfsPlugin.c index 17c3a3c31..da72a75c4 100644 --- a/open-vm-tools/services/plugins/hgfsServer/hgfsPlugin.c +++ b/open-vm-tools/services/plugins/hgfsServer/hgfsPlugin.c @@ -88,7 +88,7 @@ HgfsChannel_Exit(void *data) * @return TRUE on success, FALSE on error. */ -static Bool +static gboolean HgfsServerRpcInDispatch(RpcInData *data) { size_t packetSize; diff --git a/open-vm-tools/services/plugins/powerOps/powerOps.c b/open-vm-tools/services/plugins/powerOps/powerOps.c index b0854ce75..ebc10fa9a 100644 --- a/open-vm-tools/services/plugins/powerOps/powerOps.c +++ b/open-vm-tools/services/plugins/powerOps/powerOps.c @@ -390,7 +390,7 @@ PowerOpsRunScript(PowerOpState *state, * @return TRUE on success. */ -static Bool +static gboolean PowerOpsStateChange(RpcInData *data) { size_t i; @@ -481,7 +481,7 @@ PowerOpsStateChange(RpcInData *data) } g_free(script); - return RPCIN_SETRETVALS(data, result, ret); + return RPCIN_SETRETVALS(data, (char *) result, ret); } } diff --git a/open-vm-tools/services/plugins/resolutionSet/resolutionSet.c b/open-vm-tools/services/plugins/resolutionSet/resolutionSet.c index f78f4b1b1..75631752c 100644 --- a/open-vm-tools/services/plugins/resolutionSet/resolutionSet.c +++ b/open-vm-tools/services/plugins/resolutionSet/resolutionSet.c @@ -65,14 +65,8 @@ ResolutionInfoType resolutionInfo; * Local function prototypes */ -static Bool ResolutionResolutionSetCB(RpcInData *data); -static Bool ResolutionDisplayTopologySetCB(RpcInData *data); static void ResolutionSetServerCapability(unsigned int value); -#if defined(RESOLUTION_WIN32) -static Bool ResolutionDisplayTopologyModesSetCB(RpcInData *data); -static Bool ResolutionChangeHost3DAvailabilityHintCB(RpcInData *data); -#endif /* * Global function definitions @@ -134,13 +128,13 @@ ResolutionCleanup(void) * @return TRUE if we can reply, FALSE otherwise. */ -static Bool +static gboolean ResolutionResolutionSetCB(RpcInData *data) { uint32 width = 0 ; uint32 height = 0; unsigned int index = 0; - Bool retval = FALSE; + gboolean retval = FALSE; ResolutionInfoType *resInfo = &resolutionInfo; @@ -176,11 +170,11 @@ invalid_arguments: * @return TRUE if we can reply, FALSE otherwise. */ -static Bool +static gboolean ResolutionChangeHost3DAvailabilityHintCB(RpcInData *data) { unsigned int set; - Bool success = FALSE; + gboolean success = FALSE; unsigned int index = 0; Debug("%s: enter\n", __FUNCTION__); @@ -218,7 +212,7 @@ ResolutionChangeHost3DAvailabilityHintCB(RpcInData *data) * @return TRUE if we can reply, FALSE otherwise. */ -static Bool +static gboolean ResolutionDisplayTopologyModesSetCB(RpcInData *data) { DisplayTopologyInfo *displays = NULL; @@ -226,7 +220,7 @@ ResolutionDisplayTopologyModesSetCB(RpcInData *data) unsigned int i; unsigned int cmd; unsigned int screen; - Bool success = FALSE; + gboolean success = FALSE; const char *p; Debug("%s: enter\n", __FUNCTION__); @@ -297,12 +291,12 @@ out: * @return TRUE if we can reply, FALSE otherwise. */ -static Bool +static gboolean ResolutionDisplayTopologySetCB(RpcInData *data) { DisplayTopologyInfo *displays = NULL; unsigned int count, i; - Bool success = FALSE; + gboolean success = FALSE; const char *p; ResolutionInfoType *resInfo = &resolutionInfo; diff --git a/open-vm-tools/services/plugins/timeSync/timeSync.c b/open-vm-tools/services/plugins/timeSync/timeSync.c index 74c78cf83..73bdd365b 100644 --- a/open-vm-tools/services/plugins/timeSync/timeSync.c +++ b/open-vm-tools/services/plugins/timeSync/timeSync.c @@ -418,7 +418,7 @@ TimeSyncStartStopLoop(ToolsAppCtx *ctx, * @return TRUE on success. */ -static Bool +static gboolean TimeSyncTcloHandler(RpcInData *data) { Bool backwardSync = !strcmp(data->args, "1"); diff --git a/open-vm-tools/services/plugins/vix/foundryToolsDaemon.c b/open-vm-tools/services/plugins/vix/foundryToolsDaemon.c index e72af25b0..f9f4c2f7d 100644 --- a/open-vm-tools/services/plugins/vix/foundryToolsDaemon.c +++ b/open-vm-tools/services/plugins/vix/foundryToolsDaemon.c @@ -123,19 +123,17 @@ static char *ToolsDaemonTcloGetQuotedString(const char *args, static char * ToolsDaemonTcloGetEncodedQuotedString(const char *args, const char **endOfArg); -Bool ToolsDaemonTcloReceiveVixCommand(RpcInData *data); +RpcInRet ToolsDaemonTcloReceiveVixCommand(RpcInData *data); -#if !defined(N_PLAT_NLM) -Bool ToolsDaemonHgfsImpersonated(RpcInData *data); -#endif +RpcInRet ToolsDaemonHgfsImpersonated(RpcInData *data); #if defined(linux) || defined(_WIN32) -Bool ToolsDaemonTcloSyncDriverFreeze(RpcInData *data); +RpcInRet ToolsDaemonTcloSyncDriverFreeze(RpcInData *data); -Bool ToolsDaemonTcloSyncDriverThaw(RpcInData *data); +RpcInRet ToolsDaemonTcloSyncDriverThaw(RpcInData *data); #endif -Bool ToolsDaemonTcloMountHGFS(RpcInData *data); +RpcInRet ToolsDaemonTcloMountHGFS(RpcInData *data); void ToolsDaemonTcloReportProgramCompleted(const char *requestName, VixError err, @@ -171,7 +169,7 @@ static Bool thisProcessRunsAsRoot = FALSE; *----------------------------------------------------------------------------- */ -Bool +RpcInRet FoundryToolsDaemonRunProgram(RpcInData *data) // IN { VixError err = VIX_OK; @@ -285,7 +283,7 @@ abort: *----------------------------------------------------------------------------- */ -Bool +RpcInRet FoundryToolsDaemonGetToolsProperties(RpcInData *data) // IN { VixError err = VIX_OK; @@ -372,7 +370,7 @@ abort: *----------------------------------------------------------------------------- */ -Bool +RpcInRet ToolsDaemonTcloCheckUserAccount(RpcInData *data) // IN { VixError err = VIX_OK; @@ -699,7 +697,7 @@ ToolsDaemonTcloGetEncodedQuotedString(const char *args, // IN *----------------------------------------------------------------------------- */ -Bool +RpcInRet ToolsDaemonTcloOpenUrl(RpcInData *data) // IN { static char resultBuffer[DEFAULT_RESULT_MSG_MAX_LENGTH]; @@ -796,7 +794,7 @@ abort: *----------------------------------------------------------------------------- */ -Bool +RpcInRet ToolsDaemonTcloSetPrinter(RpcInData *data) // IN { static char resultBuffer[DEFAULT_RESULT_MSG_MAX_LENGTH]; @@ -901,7 +899,7 @@ abort: */ #if defined(linux) || defined(_WIN32) -Bool +RpcInRet ToolsDaemonTcloSyncDriverFreeze(RpcInData *data) { static char resultBuffer[DEFAULT_RESULT_MSG_MAX_LENGTH]; @@ -1068,7 +1066,7 @@ exit: */ #if defined(linux) || defined(_WIN32) -Bool +RpcInRet ToolsDaemonTcloSyncDriverThaw(RpcInData *data) // IN { static char resultBuffer[DEFAULT_RESULT_MSG_MAX_LENGTH]; @@ -1371,7 +1369,7 @@ FoundryToolsDaemon_UnregisterSetPrinter(RpcIn *in) // IN *----------------------------------------------------------------------------- */ -Bool +RpcInRet ToolsDaemonTcloMountHGFS(RpcInData *data) // IN { VixError err = VIX_OK; @@ -1470,7 +1468,7 @@ ToolsDaemonTcloMountHGFS(RpcInData *data) // IN *----------------------------------------------------------------------------- */ -Bool +RpcInRet ToolsDaemonHgfsImpersonated(RpcInData *data) // IN { VixError err; @@ -1707,7 +1705,7 @@ ToolsDaemonTcloReportProgramCompleted(const char *requestName, // IN *----------------------------------------------------------------------------- */ -Bool +RpcInRet ToolsDaemonTcloReceiveVixCommand(RpcInData *data) // IN { VixError err = VIX_OK; diff --git a/open-vm-tools/services/plugins/vix/vixPluginInt.h b/open-vm-tools/services/plugins/vix/vixPluginInt.h index 538148976..3a36da395 100644 --- a/open-vm-tools/services/plugins/vix/vixPluginInt.h +++ b/open-vm-tools/services/plugins/vix/vixPluginInt.h @@ -29,30 +29,31 @@ #define Warning g_warning #include "vmtoolsApp.h" +#include "rpcin.h" -Bool +RpcInRet ToolsDaemonTcloCheckUserAccount(RpcInData *data); -Bool +RpcInRet FoundryToolsDaemonGetToolsProperties(RpcInData *data); -Bool +RpcInRet ToolsDaemonHgfsImpersonated(RpcInData *data); -Bool +RpcInRet ToolsDaemonTcloMountHGFS(RpcInData *data); -Bool +RpcInRet ToolsDaemonTcloReceiveVixCommand(RpcInData *data); -Bool +RpcInRet FoundryToolsDaemonRunProgram(RpcInData *data); #if defined(linux) || defined(_WIN32) -Bool +RpcInRet ToolsDaemonTcloSyncDriverFreeze(RpcInData *data); -Bool +RpcInRet ToolsDaemonTcloSyncDriverThaw(RpcInData *data); #endif diff --git a/open-vm-tools/services/plugins/vixUser/vixUser.c b/open-vm-tools/services/plugins/vixUser/vixUser.c index c424dd064..52471ccec 100644 --- a/open-vm-tools/services/plugins/vixUser/vixUser.c +++ b/open-vm-tools/services/plugins/vixUser/vixUser.c @@ -161,7 +161,7 @@ ToolsDaemonTcloGetEncodedQuotedString(const char *args, * @return TRUE on success, FALSE on failure. */ -static Bool +static gboolean VixUserOpenUrl(RpcInData *data) { static char resultBuffer[DEFAULT_RESULT_MSG_MAX_LENGTH]; @@ -232,7 +232,7 @@ abort: * @return TRUE on success, FALSE on failure. */ -static Bool +static gboolean VixUserSetPrinter(RpcInData *data) { static char resultBuffer[DEFAULT_RESULT_MSG_MAX_LENGTH]; diff --git a/open-vm-tools/services/plugins/vmbackup/stateMachine.c b/open-vm-tools/services/plugins/vmbackup/stateMachine.c index a9f3f7d5e..126eefc6a 100644 --- a/open-vm-tools/services/plugins/vmbackup/stateMachine.c +++ b/open-vm-tools/services/plugins/vmbackup/stateMachine.c @@ -463,7 +463,7 @@ VmBackupEnableSync(void) * @return TRUE on success. */ -static Bool +static gboolean VmBackupStart(RpcInData *data) { g_debug("*** %s\n", __FUNCTION__); @@ -521,7 +521,7 @@ VmBackupStart(RpcInData *data) * @return TRUE */ -static Bool +static gboolean VmBackupAbort(RpcInData *data) { g_debug("*** %s\n", __FUNCTION__); @@ -564,7 +564,7 @@ VmBackupAbort(RpcInData *data) * @return TRUE */ -static Bool +static gboolean VmBackupSnapshotDone(RpcInData *data) { g_debug("*** %s\n", __FUNCTION__); diff --git a/open-vm-tools/services/vmtoolsd/toolsRpc.c b/open-vm-tools/services/vmtoolsd/toolsRpc.c index 8ca3628c8..897901b4a 100644 --- a/open-vm-tools/services/vmtoolsd/toolsRpc.c +++ b/open-vm-tools/services/vmtoolsd/toolsRpc.c @@ -96,7 +96,7 @@ ToolsCoreCheckReset(struct RpcChannel *chan, * @return TRUE. */ -static Bool +static gboolean ToolsCoreRpcCapReg(RpcInData *data) { char *confPath = GuestApp_GetConfPath(); @@ -163,10 +163,10 @@ ToolsCoreRpcCapReg(RpcInData *data) * * @param[in] data The RPC data. * - * @return TRUE. + * @return Whether the option was successfully processed. */ -static Bool +static gboolean ToolsCoreRpcSetOption(RpcInData *data) { @@ -204,7 +204,7 @@ exit: } else { RPCIN_SETRETVALS(data, "Unknown or invalid option", retVal); } - return (Bool) retVal; + return retVal; } diff --git a/open-vm-tools/tests/testPlugin/testPlugin.c b/open-vm-tools/tests/testPlugin/testPlugin.c index 68e9abbc6..2c9eeea6c 100644 --- a/open-vm-tools/tests/testPlugin/testPlugin.c +++ b/open-vm-tools/tests/testPlugin/testPlugin.c @@ -47,7 +47,7 @@ * @return TRUE on success. */ -static Bool +static gboolean TestPluginRpc1(RpcInData *data) { ToolsAppCtx *ctx = data->appCtx; @@ -88,7 +88,7 @@ TestPluginRpc1(RpcInData *data) * @return TRUE on success. */ -static Bool +static gboolean TestPluginRpc2(RpcInData *data) { g_debug("%s: %s\n", __FUNCTION__, data->name); @@ -105,7 +105,7 @@ TestPluginRpc2(RpcInData *data) * @return TRUE on success. */ -static Bool +static gboolean TestPluginRpc3(RpcInData *data) { TestPluginData *ret; diff --git a/open-vm-tools/tests/vmrpcdbg/debugChannel.c b/open-vm-tools/tests/vmrpcdbg/debugChannel.c index 3622467f1..bc2782e4d 100644 --- a/open-vm-tools/tests/vmrpcdbg/debugChannel.c +++ b/open-vm-tools/tests/vmrpcdbg/debugChannel.c @@ -57,7 +57,7 @@ typedef struct DbgChannelData { static gboolean RpcDebugDispatch(gpointer _chan) { - Bool ret; + gboolean ret; RpcChannel *chan = _chan; DbgChannelData *cdata = chan->_private; RpcDebugPlugin *plugin = cdata->plugin; @@ -86,7 +86,7 @@ RpcDebugDispatch(gpointer _chan) ret = RpcChannel_Dispatch(&data); if (rpcdata.validateFn != NULL) { - ret = (Bool) rpcdata.validateFn(&data, ret); + ret = rpcdata.validateFn(&data, ret); } else if (!ret) { g_debug("RpcChannel_Dispatch returned error for RPC.\n"); } @@ -119,7 +119,7 @@ RpcDebugDispatch(gpointer _chan) * @return TRUE. */ -static Bool +static gboolean RpcDebugStart(RpcChannel *chan) { DbgChannelData *data = chan->_private; @@ -170,7 +170,7 @@ RpcDebugStop(RpcChannel *chan) * a validation function was not provided. */ -static Bool +static gboolean RpcDebugSend(RpcChannel *chan, char *data, size_t dataLen, @@ -182,7 +182,7 @@ RpcDebugSend(RpcChannel *chan, RpcDebugPlugin *plugin = ((DbgChannelData *)chan->_private)->plugin; RpcDebugRecvMapping *mapping = NULL; RpcDebugRecvFn recvFn = NULL; - Bool ret = TRUE; + gboolean ret = TRUE; g_assert(chan->appName != NULL);