Microsoft KB Archive/148750

= CGI Scripts Compiled w/16-bit C Compilers Fail to Run on IIS =

Article ID: 148750

Article Last Modified on 6/23/2005

-

APPLIES TO


 * Microsoft Internet Information Server 1.0

-



This article was previously published under Q148750



We strongly recommend that all users upgrade to Microsoft Internet Information Services (IIS) version 6.0 running on Microsoft Windows Server 2003. IIS 6.0 significantly increases Web infrastructure security. For more information about IIS security-related topics, visit the following Microsoft Web site:

http://www.microsoft.com/technet/security/prodtech/IIS.mspx





SYMPTOMS
If you try to run a CGI script on (Internet Information Server) IIS from a Web Browser using http:///Directory path>/?,, you may get the following error:

HTTP/1.0 500 Server Error (The handle is invalid.)



CAUSE
CGI scripts compiled with 16-bit C compilers may fail to execute on IIS.

For example, if you compile and build an executable file out of the following C language source code using a 16-bit C compiler, and run the .exe file from a MS-DOS window of a Microsoft Windows NT Workstation version 3.51, the correct HTML output will send to the standard out. However if you place the same executable file in the Script directory of the IIS server and try to execute the same executable file from a web browser using http:///Directory path>/?, it will fail to generate to web page.


 * 1) include 

void main {  printf( "Content-type: text/html\n\n" ); printf( "" ); printf( "This is a Test page" ); printf( " Hello World. " ); printf( " End of the test page. " ); printf( "\n" ); }



RESOLUTION
To correct this problem compile and build the C Language Source code using a 32-bit C compiler, such as Microsoft C++ 4.0 or C++ 2.0.

Additional query words: prodiis

Keywords: kbnetwork KB148750

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.