HTTPRequest::~HTTPRequest() { if (!replySent) { // Keep track of whether reply was sent to avoid request leaks LogPrintf("%s: Unhandled request\n", __func__); WriteReply(HTTP_INTERNAL, "Unhandled request"); } // evhttpd cleans up the request, as long as a reply was sent. }
EXPORT_C TBool RSoundPlugIn::KeyClickEnabled() const /** Tests whether key clicks are enabled, as set by SetKeyClick(). This function always causes a flush of the window server buffer. @return ETrue if key clicks are enabled, EFalse if they are disabled. */ { return WriteReply(EWsClickOpKeyClickEnabled); }
EXPORT_C TInt RSoundPlugIn::Unload() /** Unloads the plug-in if one is currently loaded and if it can be unloaded. This function always causes a flush of the window server buffer. @return KErrNone if the function was successful, KErrNotSupported if it could not be unloaded. @capability WriteDeviceData */ { return WriteReply(EWsClickOpUnLoad); }
EXPORT_C TInt RSoundPlugIn::Load(const TDesC& aFileName) /** Loads a new plug-in, replacing the existing one, if any. This function always causes a flush of the window server buffer. @param aFileName The filename of the plug-in DLL to load. @return KErrNone if the function was successful. KErrNotSupported if the currently loaded plug-in could not be unloaded or aFileName does not refer to a loadable plug-in. @capability WriteDeviceData */ { TInt length=aFileName.Length(); return WriteReply(&length,sizeof(length),aFileName.Ptr(),aFileName.Size(),EWsClickOpLoad); }
EXPORT_C TBool RSoundPlugIn::IsLoaded(TBool& aIsChangeAble) const /** Tests whether a key or pointer click plug-in DLL is currently loaded. If one is currently loaded, aIsChangeAble returns whether or not it can be unloaded. This function always causes a flush of the window server buffer. @param aIsChangeAble If a plug-in is currently loaded, this returns ETrue if it can be unloaded and EFalse if it cannot. This depends on whether the KEYCLICKPLUGINFIXED keyword is specified in wsini.ini for the plug-in. @return ETrue if a plug-in is currently loaded, EFalse if not. */ { TUint reply=WriteReply(EWsClickOpIsLoaded); aIsChangeAble=reply&EClickLoadable; return reply&EClickLoaded; }
EXPORT_C TInt RSoundPlugIn::CommandReply(TInt aOpcode, const TPtrC8& aArgs) /** Sends a command to the plug-in DLL and may receive a response. If the correct plug-in is loaded, its implementation of CommandReplyL() is called and its return code is returned by this function. Specify an opcode of zero if you just want the identity of the plug-in DLL being used. This function always causes a flush of the window server buffer. @param aOpcode Opcode understood by both the window server client and the plug-in DLL. If an opcode of zero is specified, this is intercepted by the window server, and the third UID of the plug-in is returned. This allows the caller to identify the plug-in DLL being used. @param aArgs Packaged arguments which are passed to the plug-in via the window server. @return KErrNone or another of the system error codes, as returned by the plug-in's CommandReplyL() implementation. ESoundWrongPlugIn is returned if no plug-in is loaded, or if the plug-in identified by the aUid parameter in Construct() is not loaded. */ { return WriteReply(&aOpcode,sizeof(aOpcode),aArgs.Ptr(),aArgs.Length(),EWsClickOpCommandReply); }