The Software Development Kit (SDK) for Forefront Threat Management Gateway (TMG) 2010 is available for download from the Microsoft download center here.
We have received a number of questions about issues compiling the SDK samples and wanted to share a few tips with you.
When compiling the SDK with Visual Studio 2008/2005, the MIDL compiler may fail with the following error: midl : error MIDL2379 : the compiler reached a limit for a format string representation. See documentation for advice.
To solve this issue, do the following:
a. Verify that Visual Studio 2005/2008 SP1 is installed (you can download VS 2005 SP1 from here and VS 2008 SP1 from here ).
b. Install the updated Windows 7 SDK, which contains a newer version of the MIDL compiler, using the instructions provided in http://blogs.msdn.com/windowssdk/archive/2009/08/07/using-the-win-7-sdk-build-environment-with-vs-2008.aspx
1. Make sure you’ve implemented the steps above. Failing to complete these steps will result in a MIDL compiler error on a 64 bit platform.
2. Start Visual Studio 2008.
3. Open the requested sample solution.
4. Complete the conversion wizard (to convert a Visual Studio 6.0 solution to a Visual Studio 2005/2008 solution).
5. By default, the solution targets a 32 bit environment. For Forefront TMG to work with this project you will need to change the target platform to 64 bit. Please follow these steps:
6. You can now build the solution for the x64 bit platform.
1. Web filters
2. Application filters
Support for Large Files
The Web Filters API has been changed so that it supports large files. To declare itself as large-size aware a filter must include the SF_NOTIFY_FLAG_LARGE_SIZE_AWARE flag in the dwFlags field of the HTTP_FILTER_VERSION structure passed to GetFilterVersion() and GetWPXFilterVersion() filter entry points. After setting the flag the filter will get all the regular notifications. The only difference is that the structure passed to the HttpFilterProc() filter entry point for SF_NOTIFY_LOG notification is actually WPX_FILTER_LOG which is an extension of HTTP_FILTER_LOG. The new structure adds two new DWORD fields required for supporting files larger than 4GB: dwBytesSentHigh and dwBytesRecvdHigh.
Author: Noam Ilovich, Program Manager
Reviewers: Ori Yosefi, Senior Program Manager Meir Feinberg, Technical Writer
I compile WebResponseModifier sample from latest forefront SDK. After registration(regsvr32) this filter and restarting fwsrv service i have this message in
application event log:
Warning 07.05.2010 16:52:03 Microsoft Forefront TMG Web Proxy 31505 None
The Web filter C:\Program Files\Microsoft Forefront Threat Management Gateway\\WebResponseModifier.dll cannot process content that is larger than 4 gigabytes. Web content larger than 4 gigabytes that is sent to this Web filter for processing will be blocked. To resolve the issue, either disable this Web filter or upgrade it to a version that supports Web content larger than 4 gigabytes.
Log Name: Application
Source: Microsoft Forefront TMG Web Proxy
Date: 07.05.2010 16:52:03
Event ID: 31505
Task Category: None
<Provider Name="Microsoft Forefront TMG Web Proxy" />
<TimeCreated SystemTime="2010-05-07T12:52:03.000000000Z" />
<Data>C:\Program Files\Microsoft Forefront Threat Management Gateway\\WebResponseModifier.dll</Data>
I use: Visual Studio Standart 2008 sp1,Windows 7 SDK. Project settings as described above (x64 platfom, linker settings - MachineX64 (/MACHINE:X64)).
guys can you please explain what's going on? we have same issue like "web filter cannot process content that is larger than 4 gigabytes" with our own plugin and webresponsemodifier sample from forefront SDK.
Thanks for the comments - we've updated the blog entry to describe large file support.
I try to compile "Socks5" and I'am confronted to a problem :
I compile in x64 and i obtain a dll file.
I put the dll file into the "C:\Program Files\Microsoft Forefront Threat Management Gateway" directory and after i enter the command regsvr32 "C:\Program Files\Microsoft Forefront Threat Management Gateway\socksfltr.dll"
The plugin didn't display into "Application Filters".
What I Do wrong ?
It is good for me now, i response on social.technet.microsoft.com/.../a64935fd-6e82-4cb2-adc5-e1b20eb8ba51