home *** CD-ROM | disk | FTP | other *** search
- // OmniHTTPd Professional Server Flush Utility
- //
- // OmniHTTPd Professional, starting with version 2.03, will wait on
- // a system event object to flush its configuration. This facilitates
- // the development of remote admin scripts and other types of security
- // functions.
- //
- // We recommend pasting this code into your own scripts instead of
- // calling this program.
- //
-
- #include <windows.h>
-
- #define SERVERFLUSH_EVENT "OmniHTTPdServerFlushEvent"
-
- // FlushOmniHTTPdConfiguration
- // Triggers the event to flush the configuration of the server
- // Return value:
- // If the event was triggered successfully, the functions returns 0 (ERROR_SUCCESS)
- // If the server event could not be found, the function returns 2 (ERROR_FILE_NOT_FOUND)
- // Other error codes may be returned as well. See OpenEvent() for details.
- //
- // Note:
- // The success of the event trigger does not gaurantee that the server flushed itself.
- //
- int FlushOmniHTTPdConfiguration()
- {
- HANDLE flushEvent;
- flushEvent = OpenEvent(EVENT_MODIFY_STATE, FALSE, SERVERFLUSH_EVENT);
- if (!flushEvent) return GetLastError();
- SetEvent(flushEvent);
- CloseHandle(flushEvent);
- return ERROR_SUCCESS;
- }
-
- int main()
- {
- return FlushOmniHTTPdConfiguration();
- }
-