Problems creating the interop library for managed Exchange sinks

Hi there.

I followed the instructions on [1]:
- Downloaded the sample distribution from [2]
- (Since I didn't own Visual Studio) Installed the current MS Windows Platform SDK
- Installed .NET 2.0, SDK
- Entered the Interop directory, run <platformSDKdir>\SetEnv.cmd and nmake
- Got this:

C:\Programme\Exchange SDK\ManagedSinksWP\Interop>nmake

Microsoft (R) Program Maintenance Utility Version 7.00.8882
Copyright (C) Microsoft Corp 1988-2000. All rights reserved.

md .\obj
Ein Unterverzeichnis oder eine Datei mit dem Namen ".\obj" existiert bereits.
midl Microsoft.Exchange.Transport.EventInterop.idl /robust /out .\obj
Microsoft (R) 32b/64b MIDL Compiler Version 6.00.0366
Copyright (c) Microsoft Corporation 1991-2002. All rights reserved.
Processing .\Microsoft.Exchange.Transport.EventInterop.idl
Microsoft.Exchange.Transport.EventInterop.idl
Processing C:\Programme\Microsoft Platform SDK\Include\mailmsg.idl
mailmsg.idl
Processing C:\Programme\Microsoft Platform SDK\Include\oaidl.idl
oaidl.idl
Processing C:\Programme\Microsoft Platform SDK\Include\objidl.idl
objidl.idl
Processing C:\Programme\Microsoft Platform SDK\Include\unknwn.idl
unknwn.idl
Processing C:\Programme\Microsoft Platform SDK\Include\wtypes.idl
wtypes.idl
Processing C:\Programme\Microsoft Platform SDK\Include\basetsd.h
basetsd.h
Processing C:\Programme\Microsoft Platform SDK\Include\guiddef.h
guiddef.h
Processing C:\Programme\Microsoft Platform SDK\Include\ocidl.idl
ocidl.idl
Processing C:\Programme\Microsoft Platform SDK\Include\oleidl.idl
oleidl.idl
Processing C:\Programme\Microsoft Platform SDK\Include\servprov.idl
servprov.idl
Processing C:\Programme\Microsoft Platform SDK\Include\urlmon.idl
urlmon.idl
Processing C:\Programme\Microsoft Platform SDK\Include\msxml.idl
msxml.idl
Processing C:\Programme\Microsoft Platform SDK\Include\smtpevent.idl
smtpevent.idl
Processing C:\Programme\Microsoft Platform SDK\Include\seo.idl
seo.idl
Processing C:\Programme\Microsoft Platform SDK\Include\oaidl.acf
oaidl.acf
Processing C:\Programme\Microsoft Platform SDK\Include\ocidl.acf
ocidl.acf
tlbimp .\obj\Microsoft.Exchange.Transport.EventInterop.tlb /primary /out
:.\obj\Microsoft.Exchange.Transport.EventInterop.dll /namespace:Microsoft.Exchan
ge.Transport.EventInterop /keyfile:Microsoft.Exchange.Transport.EventInterop.snk

Microsoft (R) .NET Framework Type Library to Assembly Converter 2.0.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.

TlbImp : warning TI0000 : At least one of the arguments for 'IMailMsgProperties.
MapContent' cannot be marshaled by the runtime marshaler. Such arguments will t
herefore be passed as a pointer and may require unsafe code to manipulate.
TlbImp : warning TI0000 : At least one of the arguments for 'ISmtpInCallbackCont
ext.QueryBlob' cannot be marshaled by the runtime marshaler. Such arguments wil
l therefore be passed as a pointer and may require unsafe code to manipulate.
TlbImp : warning TI0000 : At least one of the arguments for 'IMailMsgBind.GetBin
ding' cannot be marshaled by the runtime marshaler. Such arguments will therefo
re be passed as a pointer and may require unsafe code to manipulate.
TlbImp : warning TI0000 : At least one of the arguments for 'IMailMsgPropertyStr
eam.ReadBlocks' cannot be marshaled by the runtime marshaler. Such arguments wi
ll therefore be passed as a pointer and may require unsafe code to manipulate.
TlbImp : warning TI0000 : At least one of the arguments for 'IMailMsgPropertyStr
eam.WriteBlocks' cannot be marshaled by the runtime marshaler. Such arguments w
ill therefore be passed as a pointer and may require unsafe code to manipulate.
TlbImp : warning TI0000 : At least one of the arguments for 'IMailMsgStoreDriver
.AllocMessage' cannot be marshaled by the runtime marshaler. Such arguments wil
l therefore be passed as a pointer and may require unsafe code to manipulate.
TlbImp : warning TI0000 : At least one of the arguments for 'IMailMsgStoreDriver
.ReOpen' cannot be marshaled by the runtime marshaler. Such arguments will ther
efore be passed as a pointer and may require unsafe code to manipulate.
TlbImp : warning TI0000 : At least one of the arguments for 'IMailMsgStoreDriver
.ReAllocMessage' cannot be marshaled by the runtime marshaler. Such arguments w
ill therefore be passed as a pointer and may require unsafe code to manipulate.
TlbImp : warning TI0000 : At least one of the arguments for 'IMailMsgEnumMessage
s.Next' cannot be marshaled by the runtime marshaler. Such arguments will there
fore be passed as a pointer and may require unsafe code to manipulate.
TlbImp : warning TI0000 : At least one of the arguments for 'ICategorizerItemAtt
ributes.GetAllAttributeValues' cannot be marshaled by the runtime marshaler. Su
ch arguments will therefore be passed as a pointer and may require unsafe code t
o manipulate.
TlbImp : warning TI0000 : At least one of the arguments for 'ICategorizerParamet
ers.GetAllAttributes' cannot be marshaled by the runtime marshaler. Such argume
nts will therefore be passed as a pointer and may require unsafe code to manipul
ate.
TlbImp : warning TI0000 : At least one of the arguments for 'ICategorizerParamet
ers.GetCCatConfigInfo' cannot be marshaled by the runtime marshaler. Such argum
ents will therefore be passed as a pointer and may require unsafe code to manipu
late.
TlbImp : warning TI0000 : At least one of the arguments for 'MailMsg.MapContent'
cannot be marshaled by the runtime marshaler. Such arguments will therefore be
passed as a pointer and may require unsafe code to manipulate.
TlbImp : warning TI0000 : The type library importer could not convert the signat
ure for the member 'tagBIND_OPTS2.pServerInfo'.
TlbImp : warning TI0000 : The type library importer could not convert the signat
ure for the member '_COSERVERINFO.pAuthInfo'.
TlbImp : warning TI0000 : The type library importer could not convert the signat
ure for the member '_COAUTHINFO.pAuthIdentityData'.
TlbImp : warning TI0000 : The type library importer could not convert the signat
ure for the member '_COAUTHIDENTITY.User'.
TlbImp : warning TI0000 : The type library importer could not convert the signat
ure for the member '_COAUTHIDENTITY.Domain'.
TlbImp : warning TI0000 : The type library importer could not convert the signat
ure for the member '_COAUTHIDENTITY.Password'.
Type library imported to C:\Programme\Exchange SDK\ManagedSinksWP\Interop\obj\Mi
crosoft.Exchange.Transport.EventInterop.dll
ildasm .\obj\Microsoft.Exchange.Transport.EventInterop.dll /out=.\obj\Mi
crosoft.Exchange.Transport.EventInterop.il.orig
patch .\obj\Microsoft.Exchange.Transport.EventInterop.il.orig Microsoft.
Exchange.Transport.EventInterop.diff -o .\obj\Microsoft.Exchange.Transport.Event
Interop.il
patching file '.\obj\Microsoft.Exchange.Transport.EventInterop.il.orig'
Hunk #1 FAILED at 925.
Hunk #2 FAILED at 930.
Hunk #3 FAILED at 932.
Hunk #4 FAILED at 1002.
Hunk #5 FAILED at 1011.
Hunk #6 FAILED at 1117.
Hunk #7 FAILED at 1122.
Hunk #8 FAILED at 1125.
Hunk #9 FAILED at 1233.
Hunk #10 FAILED at 1238.
Hunk #11 FAILED at 1241.
Hunk #12 FAILED at 1313.
Hunk #13 FAILED at 1319.
Hunk #14 FAILED at 1325.
Hunk #15 FAILED at 1331.
Hunk #16 FAILED at 1503.
Hunk #17 FAILED at 1509.
Hunk #18 FAILED at 1515.
Hunk #19 FAILED at 1598.
Hunk #20 FAILED at 1604.
Hunk #21 FAILED at 1610.
Hunk #22 FAILED at 1991.
Hunk #23 FAILED at 1996.
Hunk #24 FAILED at 1999.
Hunk #25 FAILED at 2201.
Hunk #26 FAILED at 2242.
Hunk #27 FAILED at 2252.
Hunk #28 FAILED at 2361.
Hunk #29 FAILED at 2366.
Hunk #30 FAILED at 2368.
Hunk #31 FAILED at 2435.
Hunk #32 FAILED at 2440.
Hunk #33 FAILED at 2442.
Hunk #34 FAILED at 2620.
Hunk #35 FAILED at 2625.
Hunk #36 FAILED at 2628.
Hunk #37 FAILED at 2663.
Hunk #38 FAILED at 3520.
Hunk #39 FAILED at 3526.
Hunk #40 FAILED at 3528.
Hunk #41 FAILED at 3609.
Hunk #42 FAILED at 3619.
42 out of 42 hunks FAILED -- saving rejects to file '.\obj\Microsoft.Exchange.Tr
ansport.EventInterop.il.rej'
NMAKE : fatal error U1077: 'patch' : return code '0x1'
Stop.

Which looks like "yes, I could compile it but the patch absolutely doesn't fit" to me. Is that a problem related to using .Net 2.0 instead of 1.1? I'd apply the patch manually, but it's just impossible to do (not enough information to find the right lines).
Can anyone recommend a solution here? Did I something very stupid/wrong?

Thanks in advance,
Ben

[1]: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsmtps/html/writingmngsinks.asp
[2]: http://www.microsoft.com/downloads/details.aspx?FamilyID=0cd7f344-cad6-416e-9bc1-0d7c214e1d0b&DisplayLang=en

[9296 byte] By [DarKlajid] at [2007-12-18]
# 1
Just tried it with .NET 1.1

Well - at least most of the sample works now, but I still get

patching file '.\obj\Microsoft.Exchange.Transport.EventInterop.il.orig'
Hunk #5 FAILED at 1011.
Hunk #42 FAILED at 3619.
2 out of 42 hunks FAILED -- saving rejects to file '.\obj\Microsoft.Exchange.Tra
nsport.EventInterop.il.rej'
NMAKE : fatal error U1077: 'patch' : return code '0x1'
Stop.

Anyone able to lend me a helping hand here?

Regards,
Ben

DarKlajid at 2007-9-8 > top of Msdn Tech,Software Development for Windows Vista,General Windows Vista Development Issues...
# 2

This is the exact same problem I am having. I've gave up on trying to compile my own copy of that dll a few months ago. I don't know what is going wrong, but I get the same output. I tried all the different versions of .net framework. Anyway, just wanted to say I'm having the same problem.

PS: I'm running Win2k3 server and was trying with the current PSDK and the Visual C++ toolkit

1337 at 2007-9-8 > top of Msdn Tech,Software Development for Windows Vista,General Windows Vista Development Issues...
# 3

Im having a problem creating the interop dll from the source provided by Microsoft

.

The problem is as described in this thread:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=186706&SiteID=1

1337 at 2007-9-8 > top of Msdn Tech,Software Development for Windows Vista,General Windows Vista Development Issues...
# 4

Please post this in the general CLR questions forum
This issue seems to be a p/invoke issue

http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=44&SiteID=1

DurgaprasadGorti at 2007-9-8 > top of Msdn Tech,Software Development for Windows Vista,General Windows Vista Development Issues...

Software Development for Windows Vista

Site Classified