FCGX_Header.inc

            

' Declarations for libFCGI2.dll FCGX Library
'  
' www.coastrd.com - Coast Research © 2009  
  
' CDECL Calling Convention (same as libfcgi.dll)
' ALL Strings are ANSI NOT Unicode (FOR now)  
   

' Enum FastCGI Roles
%FCGI_RESPONDER   = 1 '
%FCGI_AUTHORIZER  = 2 ' Not Supported
%FCGI_FILTER      = 3 ' Not Supported
         

' Enum Request Methods
%HTTP_GET         = 1 ' Information is appended onto the end of the request URI being requested
%HTTP_POST        = 2 ' Transmits all data immediately after the request URI. 
%HTTP_HEAD        = 3 ' Headers of a GET request - Information about a document
%HTTP_PUT         = 4 ' The URI in a PUT request identifies the entity enclosed with the request.
%HTTP_DELETE      = 5 ' DELETE the resource identified by the Request-URI
%HTTP_OPTIONS     = 6 ' Enum supported Methods
%HTTP_TRACE       = 7 ' Enum each node along the path
%HTTP_CONNECT     = 8 ' Request web proxy dynamically switch to a secure IP-based connection (an SSL tunnel)
%HTTP_UNKNOWN     = 9 ' None of the Above      
                    

%FCGX_NONE        = 0 ' No FLags
%FCGX_DEBUG       = 1 ' Append to FCGI Debug File - specified as the flag in FCGX_InitRequest()  
                      ' For IIS: "C:\FCGIdebug\" or whatever your drive letter is 
%FCGX_REQP        = 2 ' Print Debug info + Request Parameters   
%FCGX_ENVP        = 3 ' Print Environment Parameters (only)

 
' Structures
TYPE FCGX_STREAM
  pData           AS DWORD            ' Pointer to the first byte of data  
  LenStored       AS DWORD            ' Bytes Total data stored - up to 4.2GB
  Capacity        AS DWORD            ' Bytes Total available   - up to 4.2GB 
  CurPos          AS DWORD            ' Current Position within the buffer of the next byte to read, as an offset from pData
                                     
  Reserved        AS STRING*12        ' Opaque Variables
END TYPE ' 28 bytes 


TYPE FCGX_REQUEST
  Version         AS LONG             ' Dll Version Number * 1000 = %FCGI_VERSION       
  ReqCount        AS LONG             ' Request Counter
                                     
    Role            AS LONG             ' FastCGI Role
    ConnFlags       AS LONG             ' Connection flags - zero = application closes connection after responding
                                     
  ReqMethod       AS LONG             ' Request HTTP Method - Code 1 - 8
  ContLen         AS LONG             ' CONTENT_LENGTH - Length of POST data sent (in the pInStream Data String)  
  pzQuery         AS ASCIIZ PTR       ' Pointer to ASCIIZ (Null Terminated) QUERY_STRING (Values Only) - Always a valid pointer
                                     
  nParam          AS LONG             ' Number of Request Params in the array                                 
  envp            AS DWORD PTR        ' Pointer to Array of Request Parameters 
                                          
    pIn             AS FCGX_STREAM PTR  ' Pointer to a String Builder object
    pOut            AS FCGX_STREAM PTR  ' Pointer to a String Builder object
    pErr            AS FCGX_STREAM PTR  ' Pointer to a String Builder object                                         
                
  pzLastErr       AS ASCIIZ PTR       ' Pointer to ASCIIZ String containing Last Error description
                     
  Reserved        AS STRING*108       ' Opaque Variables
END TYPE ' 160 bytes

   
 

' Legacy (Identical to "libfcgi.dll")
DECLARE FUNCTION FCGX_InitRequest CDECL LIB "libFCGI2.dll" ALIAS "FCGX_InitRequest" ( BYVAL pReq    AS FCGX_REQUEST PTR, BYVAL sock AS LONG, BYVAL flags AS LONG ) AS LONG
DECLARE FUNCTION FCGX_Accept_r    CDECL LIB "libFCGI2.dll" ALIAS "FCGX_Accept_r"    ( BYVAL pReq    AS FCGX_REQUEST PTR ) AS LONG  
DECLARE FUNCTION FCGX_Finish_r    CDECL LIB "libFCGI2.dll" ALIAS "FCGX_Finish_r"    ( BYVAL pReq    AS FCGX_REQUEST PTR ) AS LONG
DECLARE FUNCTION FCGX_GetParam    CDECL LIB "libFCGI2.dll" ALIAS "FCGX_GetParam"    ( BYREF zName   AS ASCIIZ, BYVAL envp    AS DWORD ) AS DWORD
DECLARE FUNCTION FCGX_GetStr      CDECL LIB "libFCGI2.dll" ALIAS "FCGX_GetStr"      ( BYVAL pData   AS DWORD,  BYVAL nBytes  AS LONG, BYVAL pStream AS DWORD ) AS LONG 
DECLARE FUNCTION FCGX_PutStr      CDECL LIB "libFCGI2.dll" ALIAS "FCGX_PutStr"      ( BYVAL pData   AS DWORD,  BYVAL nBytes  AS LONG, BYVAL pStream AS DWORD ) AS LONG
DECLARE FUNCTION FCGX_PutS        CDECL LIB "libFCGI2.dll" ALIAS "FCGX_PutS"        ( BYREF zText   AS ASCIIZ, BYVAL pStream AS DWORD ) AS LONG


' New   
DECLARE FUNCTION FCGX_Flush       CDECL LIB "libFCGI2.dll" ALIAS "FCGX_Flush"       ( BYVAL pReq    AS FCGX_REQUEST PTR ) AS LONG 
DECLARE FUNCTION FCGX_GetBytes    CDECL LIB "libFCGI2.dll" ALIAS "FCGX_GetBytes"    ( BYVAL pReq    AS FCGX_REQUEST PTR, BYVAL pSrc AS DWORD, BYVAL pDest AS DWORD, BYVAL nBytes AS LONG ) AS LONG
DECLARE FUNCTION FCGX_PutBytes    CDECL LIB "libFCGI2.dll" ALIAS "FCGX_PutBytes"    ( BYVAL pReq    AS FCGX_REQUEST PTR, BYVAL pSrc AS DWORD, BYVAL pDest AS DWORD, BYVAL nBytes AS LONG ) AS LONG
DECLARE FUNCTION FCGX_EnsureCap   CDECL LIB "libFCGI2.dll" ALIAS "FCGX_EnsureCap"   ( BYVAL pStream AS DWORD, BYVAL Capacity AS DWORD ) AS DWORD                
DECLARE FUNCTION FCGX_URLDecode   CDECL LIB "libFCGI2.dll" ALIAS "FCGX_URLDecode"   ( BYVAL pData   AS DWORD, BYVAL nBytes AS LONG ) AS LONG
DECLARE FUNCTION FCGX_PutDebug    CDECL LIB "libFCGI2.dll" ALIAS "FCGX_PutDebug"    ( BYREF zText   AS ASCIIZ ) AS LONG         
                         
' BSTR functions (not C friendly)                  
DECLARE FUNCTION FCGX_Read        CDECL LIB "libFCGI2.dll" ALIAS "FCGX_Read"        ( BYVAL pStream AS DWORD) AS STRING 
DECLARE FUNCTION FCGX_Write       CDECL LIB "libFCGI2.dll" ALIAS "FCGX_Write"       ( BYVAL pStream AS DWORD,  BYVAL sWrite AS STRING ) AS LONG
DECLARE FUNCTION FCGX_GetValue    CDECL LIB "libFCGI2.dll" ALIAS "FCGX_GetValue"    ( BYVAL sName   AS STRING, BYVAL envp AS DWORD ) AS STRING



Comments