This readme file is for all of the ISAPI I/O samples. These samples illustrate the different ways to handle I/O within an ISAPI extension.
The Asynchronous Read sample demonstrates asynchronous ReadClient functionality in the ISAPI interface. The Asynchronous Trans sample demonstrates asynchronous TransmitFile functionality in the ISAPI interface. The Asynchronous Write sample demonstrate asynchronous WriteClient functionality in the ISAPI interface. The Synchronous Read sample demonstrates synchronous ReadClient functionality in the ISAPI interface. The Synchronous Write sample demonstrate synchronous WriteClient functionality in the ISAPI interface.
Important These samples are provided for educational purposes only. They are not intended to be used in a production environment, have not been tested in a production environment, and Microsoft does not provide technical support for them.
Sample Overview
Requirements
Location of the Source Code
Build and Install the Sample
Run the Sample
Sample Output
Helpdesk
ISAPI 1.0 support synchronous IO operations via callback methods ReadClient() and WriteClient(). The ability to support asynchronous operations is important; it frees up a server pool thread from being blocked to complete the IO operation. In addition, IIS server engine already has built in support to manage asynchronous IO operations using the completion ports and server thread pool.
ISAPI 2.0 supports asynchronous write operation using the existing callback function WriteClient() with a special flag indicating that the operation has to be performed asynchronously. In addition, ISAPI 2.0 also provides a mechanism to request the server to transmit a file using the TransmitFile() .
ISAPI 3.0 supports asynchronous read operation from the client using ServerSupportFunction() with HSE_REQ_ASYNC_READ_CLIENT and a special flag indicating that the operation has to be performed asynchronously. In addition, the ISAPI application should submit a callback function and context by calling ServerSupportFunction() with HSE_REQ_IO_COMPLETION.
to top
This sample requires the installation of the following software to function properly:
IIS samples are included in the IIS Software Developer Kit (SDK). You can download the IIS SDK from Platform SDK Update. You can view the SDK at MSDN Online. In the table of contents at MSDN Online, click Web Development, Server Technologies, Internet Information Services (IIS), SDK Documentation, Internet Information Services, Samples.
The following source code files are required for the Asynchronous Read sample:
File | Description |
---|---|
AReadCli.sln | AReadCli Visual Studio .NET solution file, required to build this sample in Visual Studio .NET. |
AReadCli.vcproj | AReadCli Visual Studio .NET C Project file, required to build this sample in Visual Studio .NET. |
AReadCli.dsp, AReadCli.dsw | AReadCli Visual Studio 6.0 project files, required to build this sample in Visual Studio Version 6. |
AReadCli.c | AReadCli source module containing the code that implements the sample. |
AReadCli.def | AReadCli.dll definition containing code for creating the sample. |
MAKEFILE | AReadCli makefile for command line compilation |
The following source code files are required for the Asynchronous Trans sample:
File | Description |
---|---|
FTrans.sln | FTrans Visual Studio .NET solution file, required to build this sample in Visual Studio .NET. |
FTrans.vcproj | FTrans Visual Studio .NET C Project file, required to build this sample in Visual Studio .NET. |
FTrans.dsp, FTrans.dsw | FTrans Visual Studio 6.0 project files, required to build this sample in Visual Studio Version 6. |
FTrans.c, OpenF.c | FTrans source modules containing the code that implements the sample. |
FTrans.def | FTrans.dll definition containing code for creating the sample. |
OpenF.h | FTrans header file containing commonly called routines. |
MAKEFILE | FTrans makefile for command line compilation |
The following source code files are required for the Asynchronous Write sample:
File | Description |
---|---|
FWAsych.sln | FWAsych Visual Studio .NET solution file, required to build this sample in Visual Studio .NET. |
FWAsych.vcproj | FWAsych Visual Studio .NET C Project file, required to build this sample in Visual Studio .NET. |
FWAsych.dsp, FWAsych.dsw | FWAsych Visual Studio 6.0 project files, required to build this sample in Visual Studio Version 6. |
FWAsych.c, OpenF.c | FWAsych source modules containing the code that implements the sample. |
FWAsych.def | FWAsych.dll definition containing code for creating the sample. |
OpenF.h | FWAsych header file containing commonly called routines. |
MAKEFILE | FWAsych makefile for command line compilation |
The following source code files are required for the Synchronous Read sample:
File | Description |
---|---|
ReadCli.sln | ReadCli Visual Studio .NET solution file, required to build this sample in Visual Studio .NET. |
ReadCli.vcproj | ReadCli Visual Studio .NET C Project file, required to build this sample in Visual Studio .NET. |
ReadCli.dsp, ReadCli.dsw | ReadCli Visual Studio 6.0 project files, required to build this sample in Visual Studio Version 6. |
ReadCli.c | ReadCli source modules containing the code that implements the sample. |
ReadCli.def | ReadCli.dll definition containing code for creating the sample. |
MAKEFILE | ReadCli makefile for command line compilation |
The following source code files are required for the Synchronous Write sample:
File | Description |
---|---|
FWrite.sln | FWrite Visual Studio .NET solution file, required to build this sample in Visual Studio .NET. |
FWrite.vcproj | FWrite Visual Studio .NET C Project file, required to build this sample in Visual Studio .NET. |
FWrite.dsp, FWrite.dsw | FWrite Visual Studio 6.0 project files, required to build this sample in Visual Studio Version 6. |
FWrite.c, OpenF.c | FWrite source modules containing the code that implements the sample. |
FWrite.def | FWrite.dll definition containing code for creating the sample. |
OpenF.h | FWrite header file containing commonly called routines. |
MAKEFILE | FWrite makefile for command line compilation |
To build this sample using the Visual C++ IDE, the following steps must be performed:
To build and run this sample without using the Visual C++ IDE, the following steps must be performed:
C:\MySamples
, type the following at the command line:
cd /d c:\MySamples NMAKE All
To install this sample, the following steps must be performed:
C:\Samples
and copy the files to that folder.inetmgr
in the text box and click OK. Right-click on the Web
site where you want to create a virtual directory, click New, and click Virtual
Directory. In the Alias text box, type the name you want for your virtual directory, for
example, InputOutput
. In the Directory text box, type the path to the
folder that contains your files.
In order to run this sample, follow the instructions listed below:
sample.gif
, copy it to the same folder that contains your compiled .dll files since you
already mapped that folder to a virtual directory.sample.gif
, and it is in the same folder as
your sample .dll files, and that folder is mapped to a virtual directory called
InputOutput
, type one of the following in the address bar of IE, depending on which
sample you want to view:
http://localhost/InputOutput/AReadCli.dll http://localhost/InputOutput/FTrans.dll?/InputOutput/sample.gif http://localhost/InputOutput/FWAsync.dll?/InputOutput/sample.gif http://localhost/InputOutput/ReadCli.dll http://localhost/InputOutput/FWrite.dll?/InputOutput/sample.gif
The following output is displayed somewhere after you perform step 2 from Run the Sample.
to top
If here you do not find answers to your questions, visit the Microsoft Help and Support Web site.
Problem | Possible Solution |
---|---|
When building the dll, C++ or VB returns the a permissions error. | Once you have called the dll from your web page, your system considers it a loaded dll. You must unload it to build it again, either by unloading the ASP application or deleting the dll from system32\dllcache. |
When browsing to the dll, IE gives you a permissions error. | The folder and virtual directory must have Execute permissions set on them. |
© 1997-2002 Microsoft Corporation. All rights reserved.