WebSite Professional Server Self Test

WebSite API SDK
Functions Reference

15-September-97
Please note: For complete WSAPI documentation, see Section IV: The WebSite Application Programming Interface, in Creating Dynamic Content.

Index

bind_wsapi
close_form_decoder
construct_url
decode_next_field
DbgDump
die
do_imagemap
escape_url
evaluate_access
exec_cgi
exec_cgi_to_file
file_to_url
get_content_type
get_server_variable
GetRegBin
GetRegString
get_temp_name
http_timestr
http_nt_timestr
later_than
MD5Init
MD5Update
MD5Final
nflush
ngets
normalize_url
nputs
nread
nreadf
nwrite
nwritef
OpenRegKey
open_form_decoder
plus_to_space
process_get
send_http_header
set_content_type
space_to_plus
TrueRandAddNoise
TrueRandEntropy
TrueRandGetByte
TrueRandGetBytes
unescape_url
url_to_file
wsapi_free
wsapi_log_event
wsapi_malloc
wsapi_realloc
wsapi_strdup

This document describes the server-internal functions that are exposed by WSAPI. In your DLL's PROCESS_ATTACH code, you must call the bind_wsapi() function. This insures that your extension is compatible with the version of the server that is currently running.

How to Access the Support Functions

The support functions are exported by the server for use by any DLL. Simply include the supplied import library httpd32.lib in your DLL's project. The C/C++ prototypes and associated structure definitions for the support functions are contained in the supplied header file wsapi.h. Include this in each of your DLL's source files.

Using the Support Functions in ISAPI Compatibility Mode

ISAs running under WebSite Pro's ISAPI compatibility mode can be upgraded/simplified to use WSAPI support functions. The hConn (connection ID) field in the ISAPI extension control block (ECB) passed from WebSite contains the address of the WSAPI Transaction Context Block associated with the current request. To call a WSAPI support function from an ISA extension, simply cast the connection ID to a TCTX pointer in any call that requires a TCTX pointer.

Memory Management

Most C runtime libraries (including the one with Visual C++) maintain separate heaps for allocation in each module (DLL or main program). This means that memory allocated in one module's code cannot be freed in another module's code.

Some of the support functions allocate dynamic memory which you may need to free later. You must use the wsapi_free() function to free memory allocated by a support function. This calls back into the server so that the memory gets freed from the server's heap instaead of the DLL's heap.

The cleanest way to handle dynamic memory is to use the wsapi_ versions of the memory management functions for everything. That way, no matter how the memory originally got allocated, you are safe in freeing it with wsapi_free().


Copyright © 1994-97 O'Reilly & Associates, Inc. All Rights Reserved. O'Reilly Software Online, WebSite Central, WebSite, and WebSite Professional are trademarks of O'Reilly & Associates, Inc. All other names are the trademarks of their respective companies.