FSN#28125 Versie 1.0.0.1

svn path=/FcltISAPI/trunk/; revision=19881
This commit is contained in:
Jos Groot Lipman
2013-11-20 10:48:17 +00:00
parent 88ec38cbc3
commit 5642921c88
9 changed files with 582 additions and 0 deletions

11
Resource.h Normal file
View File

@@ -0,0 +1,11 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by fcltisapi.rc
//
#define IDS_FILTER 101
#define _APS_NEXT_RESOURCE_VALUE 103
#define _APS_NEXT_CONTROL_VALUE 103
#define _APS_NEXT_SYMED_VALUE 103
#define _APS_NEXT_COMMAND_VALUE 32768

8
StdAfx.cpp Normal file
View File

@@ -0,0 +1,8 @@
// stdafx.cpp : source file that includes just the standard includes
// fcltisapi.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"

20
StdAfx.h Normal file
View File

@@ -0,0 +1,20 @@
#if !defined(AFX_STDAFX_H__EA40DC04_0ADB_426A_825F_A47390C63E5C__INCLUDED_)
#define AFX_STDAFX_H__EA40DC04_0ADB_426A_825F_A47390C63E5C__INCLUDED_
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
//#include <afx.h>
//#include <afxwin.h>
//#include <afxmt.h> // for synchronization objects
//#include <afxext.h>
//#include <afxisapi.h>
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#include <windows.h>
#endif // !defined(AFX_STDAFX_H__EA40DC04_0ADB_426A_825F_A47390C63E5C__INCLUDED)

67
fcltisapi.cpp Normal file
View File

@@ -0,0 +1,67 @@
#include "stdafx.h"
#include <httpfilt.h>
#include "tchar.h"
#include "strsafe.h"
BOOL WINAPI GetFilterVersion(
PHTTP_FILTER_VERSION pVer
)
{
pVer->dwFilterVersion = HTTP_FILTER_REVISION;
strncpy_s( pVer->lpszFilterDesc, "HTTPOnlyFilter", SF_MAX_FILTER_DESC_LEN );
/* Notify me when headers have been processed */
pVer->dwFlags = SF_NOTIFY_ORDER_DEFAULT |
SF_NOTIFY_PREPROC_HEADERS |
SF_NOTIFY_SEND_RESPONSE ;
return TRUE;
};
// Portion of HttpOnly
DWORD WINAPI HttpFilterProc(
PHTTP_FILTER_CONTEXT pfc,
DWORD dwNotificationType,
LPVOID pvNotification) {
if (dwNotificationType == SF_NOTIFY_SEND_RESPONSE)
{
// Hard coded cookie length (2k bytes)
CHAR szCookie[2048];
DWORD cbCookieOriginal = sizeof(szCookie) / sizeof(szCookie[0]);
DWORD cbCookie = cbCookieOriginal;
HTTP_FILTER_SEND_RESPONSE *pResponse =
(HTTP_FILTER_SEND_RESPONSE*)pvNotification;
CHAR *szHeader = "Set-Cookie:";
CHAR *szHttpOnly = "; HttpOnly";
if (pResponse->GetHeader(pfc,szHeader,szCookie,&cbCookie))
{
if (SUCCEEDED(StringCchCat(szCookie,
cbCookieOriginal,
szHttpOnly)))
{
if (!pResponse->SetHeader(pfc,
szHeader,
szCookie))
{ // Fail securely - send no cookie!
pResponse->SetHeader(pfc,szHeader,"");
}
}
else
{
pResponse->SetHeader(pfc,szHeader,"");
}
}
// Altijd Server: Microsoft-IIS/6.0 verwijderen
pResponse->SetHeader(pfc, "Server:", "FACILITOR");
// Altijd X-Powered-By: ASP.NET verwijderen
// Kan ook gewoon in de interface van IIS Admin maar we hebben
// deze DLL nu toch
pResponse->SetHeader(pfc, "X-Powered-By:", '\0');
}
return SF_STATUS_REQ_NEXT_NOTIFICATION;
}

7
fcltisapi.def Normal file
View File

@@ -0,0 +1,7 @@
; REDIRECTOR.def : declares the module parameters for the DLL.
LIBRARY "FCLTISAPI"
EXPORTS
HttpFilterProc
GetFilterVersion

13
fcltisapi.h Normal file
View File

@@ -0,0 +1,13 @@
#if !defined(AFX_FCLTISAPI_H__02C344E8_9F41_46A5_987A_8DA9C14FFDA6__INCLUDED_)
#define AFX_FCLTISAPI_H__02C344E8_9F41_46A5_987A_8DA9C14FFDA6__INCLUDED_
// FCLTISAPI.H - Header file for your Internet Server
// fcltisapi Filter
#include "resource.h"
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_FCLTISAPI_H__02C344E8_9F41_46A5_987A_8DA9C14FFDA6__INCLUDED)

126
fcltisapi.rc Normal file
View File

@@ -0,0 +1,126 @@
//Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
"#define _AFX_NO_OLE_RESOURCES\r\n"
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
"\r\n"
"\r\n"
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
"#ifdef _WIN32\r\n"
"LANGUAGE 9, 1\r\n"
"#pragma code_page(1252)\r\n"
"#endif //_WIN32\r\n"
"#include ""afxres.rc"" // Standard components\r\n"
"#include ""afxisapi.rc"" // Internet Support resources\r\n"
"#endif\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904B0"
BEGIN
VALUE "CompanyName", "SG|facilitor\0"
VALUE "FileDescription", "fcltisapi Internet Server Extension Module\0"
VALUE "FileVersion", "1, 0, 0, 1\0"
VALUE "InternalName", "FCLTISAPI\0"
VALUE "LegalCopyright", "Copyright (C) 2013 FACILITOR\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "FCLTISAPI.DLL\0"
VALUE "ProductName", "fcltisapi Internet Server Extension\0"
VALUE "ProductVersion", "1, 0, 0, 1\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
IDS_FILTER "fcltisapi Filter"
END
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#define _AFX_NO_SPLITTER_RESOURCES
#define _AFX_NO_OLE_RESOURCES
#define _AFX_NO_TRACKER_RESOURCES
#define _AFX_NO_PROPERTY_RESOURCES
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE 9, 1
#pragma code_page(1252)
#endif //_WIN32
#include "afxres.rc" // Standard components
#include "afxisapi.rc" // Internet Support resources
#endif
#endif // not APSTUDIO_INVOKED

20
fcltisapi.sln Normal file
View File

@@ -0,0 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HTTPonly", "fcltisapi.vcproj", "{E01673B8-BD25-48E4-993A-EF3C7F7BA4B8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E01673B8-BD25-48E4-993A-EF3C7F7BA4B8}.Debug|Win32.ActiveCfg = Debug|Win32
{E01673B8-BD25-48E4-993A-EF3C7F7BA4B8}.Debug|Win32.Build.0 = Debug|Win32
{E01673B8-BD25-48E4-993A-EF3C7F7BA4B8}.Release|Win32.ActiveCfg = Release|Win32
{E01673B8-BD25-48E4-993A-EF3C7F7BA4B8}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

310
fcltisapi.vcproj Normal file
View File

@@ -0,0 +1,310 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Name="FCLTIsapi"
ProjectGUID="{E01673B8-BD25-48E4-993A-EF3C7F7BA4B8}"
Keyword="MFCProj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="2"
UseOfMFC="1"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName=".\Debug/fcltisapi.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="stdafx.h"
PrecompiledHeaderFile=".\Debug/fcltisapi.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="5129"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile=".\Debug/fcltisapi.dll"
LinkIncremental="2"
SuppressStartupBanner="true"
ModuleDefinitionFile=".\fcltisapi.def"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\Debug/fcltisapi.pdb"
SubSystem="2"
ImportLibrary=".\Debug/fcltisapi.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile=".\Debug/fcltisapi.bsc"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="2"
UseOfMFC="1"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName=".\Release/fcltisapi.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL"
StringPooling="true"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="stdafx.h"
PrecompiledHeaderFile=".\Release/fcltisapi.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="5129"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile=".\Release/fcltisapi.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
ModuleDefinitionFile=".\fcltisapi.def"
ProgramDatabaseFile=".\Release/fcltisapi.pdb"
SubSystem="2"
ImportLibrary=".\Release/fcltisapi.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile=".\Release/fcltisapi.bsc"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
RelativePath="fcltisapi.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="fcltisapi.rc"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="StdAfx.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions=""
UsePrecompiledHeader="1"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions=""
UsePrecompiledHeader="1"
/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl"
>
<File
RelativePath="fcltisapi.h"
>
</File>
<File
RelativePath="Resource.h"
>
</File>
<File
RelativePath="StdAfx.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
>
<File
RelativePath="fcltisapi.rc2"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>