1"use strict";(self.webpackChunkpc_thoughts=self.webpackChunkpc_thoughts||[]).push([[4398],{1615:(e,n,a)=>{a.r(n),a.d(n,{assets:()=>l,contentTitle:()=>r,default:()=>h,frontMatter:()=>o,metadata:()=>t,toc:()=>c});var t=a(18312),s=a(74848),i=a(28453);const o={authors:"paul",date:"2010-12-26T15:22",image:"assets/Exchange2010Logo.png",slug:"exchange-2000-2003-pia-patches-for-windows-sdk-7-0-and-7-1",tags:["c++","com","exchange","mailguard","microsoft","windows"],title:"Exchange 2000 / 2003 PIA Patches for Windows SDK 7.0 and 7.1"},r=void 0,l={authorsImageUrls:[void 0]},c=[{value:"Attachments",id:"attachments",level:2}];function d(e){const n={a:"a",code:"code",h2:"h2",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{class:"blog-post-image",children:(0,s.jsx)(n.img,{alt:"Exchange 2010 logo",src:a(42664).A+"",width:"166",height:"181"})}),"\n",(0,s.jsxs)(n.p,{children:['Now, there are no official binary PIAs for Exchange Server 2000 / 2003. However, Microsoft does provide such PIAs in\n"source" form (not really source code as such... but we\'ll get to that) that you can\n',(0,s.jsx)(n.a,{href:"http://www.microsoft.com/downloads/en/details.aspx?FamilyId=0CD7F344-CAD6-416E-9BC1-0D7C214E1D0B&displaylang=en",children:"download"}),"\nand compile yourself. There is an ",(0,s.jsx)(n.a,{href:"http://msdn.microsoft.com/en-us/library/ms998610.aspx",children:"MSDN article"}),' that explains\nhow to use the Exchange Server PIA wrappers, however I strongly recommend you download the code and read the included\n"Writing Managed Sinks for SMTP and Transport Events.doc" file instead - it is far more up to date than the MSDN article\nin areas that are quite significant (such as the actual build process).']}),"\n",(0,s.jsxs)(n.p,{children:["The PIA build process is defined by an ",(0,s.jsx)(n.a,{href:"http://msdn.microsoft.com/en-us/library/ms930369.aspx",children:(0,s.jsx)(n.code,{children:"nmake"})}),"-based Makefile,\nwhich performs the following:"]}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["generate a ",(0,s.jsx)(n.a,{href:"http://en.wikipedia.org/wiki/Component_Object_Model#Interface_Definition_Language_and_type_libraries",children:"COM type library"}),"\nfrom an included ",(0,s.jsx)(n.a,{href:"http://msdn.microsoft.com/en-us/library/aa367091(v=vs.85).aspx",children:"MIDL"}),"\nfile via the ",(0,s.jsx)(n.a,{href:"http://msdn.microsoft.com/en-us/library/aa367300(v=VS.85).aspx",children:"MIDL compiler"}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["convert the COM type definitions into an equivalent ",(0,s.jsx)(n.a,{href:"http://en.wikipedia.org/wiki/Common_Language_Runtime",children:"CLR"}),"\nassembly via ",(0,s.jsx)(n.a,{href:"http://msdn.microsoft.com/en-us/library/tt0cf3sx(v=VS.100).aspx",children:(0,s.jsx)(n.code,{children:"tblimp.exe"})}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["disassemble the CLR assembly via ",(0,s.jsx)(n.a,{href:"http://msdn.microsoft.com/en-us/library/f7dy01k1(v=VS.100).aspx",children:(0,s.jsx)(n.code,{children:"ildasm.exe"})}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["apply a patch to the disassembled intermediate language file (using an old\n",(0,s.jsx)(n.a,{href:"http://savannah.gnu.org/projects/patch/",children:"GNU patch"})," binary included in the download)."]}),"\n",(0,s.jsxs)(n.li,{children:["recompile the CLR assembly via ",(0,s.jsx)(n.a,{href:"http://msdn.microsoft.com/en-us/library/496e4ekx(v=vs.80).aspx",children:(0,s.jsx)(n.code,{children:"ilasm.exe"})}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["Just as an aside, although the Makefile is written for ",(0,s.jsx)(n.a,{href:"http://msdn.microsoft.com/en-us/library/ms930369.aspx",children:(0,s.jsx)(n.code,{children:"nmake"})}),",\nwhich (as far as I know) is only available with ",(0,s.jsx)(n.a,{href:"http://www.microsoft.com/australia/visualstudio",children:"Visual Studio"}),", the\nbuild process itself only uses utilities that are available with the\n",(0,s.jsx)(n.a,{href:"http://msdn.microsoft.com/en-us/windows/bb980924",children:"Windows SDK"})," and/or\n",(0,s.jsx)(n.a,{href:"http://www.microsoft.com/net/download.aspx",children:".NET Framework"}),", both of which a freely available from\n",(0,s.jsx)(n.a,{href:"http://www.microsoft.com/en/us/default.aspx",children:"Microsoft"}),". So with a very small bit of work, the ",(0,s.jsx)(n.code,{children:"nmake"})," dependency can\nbe removed by creating an equivalent Makefile for another make utility, or simply writing a batch/command script to use\ninstead."]}),"\n",(0,s.jsxs)(n.p,{children:["Anyway, the point of this post is all about step ",(0,s.jsx)(n.strong,{children:"4"}
1)," above - applying a patch. The patch file is, so far as I can\ntell, intended to fix a number of compile-time errors that occur when compiling managed code against the final CLR\nassembly. The errors themselves are all basic function/method signature errors, and are quite easy, but laborious, to\nfix, and the fixes are different for each version of the Windows SDK you choose to build against."]}),"\n",(0,s.jsxs)(n.p,{children:["The download from Microsoft includes patches for Visual Studio 2003 and Visual Studio 2005 only. However, while working\non ",(0,s.jsx)(n.a,{href:"http://www.mailguard.com.au/services/safeguard",children:"MailGuard's email archiving service"})," recently, I had need to compile\nthe Exchange Server PIA assemblies with Windows SDK 7.0 and 7.1, so I went ahead a created the required patch files\nmyself, and ",(0,s.jsx)(n.a,{href:"http://www.mailguard.com.au/",children:"MailGuard"})," has graciously allowed me to publish them here :)"]}),"\n",(0,s.jsx)(n.p,{children:"So, without any further ado, here they are:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.a,{target:"_blank","data-noBrokenLinkCheck":!0,href:a(20147).A+"",children:(0,s.jsx)(n.code,{children:"Microsoft.Exchange.Transport.EventInterop.WDK70.diff"})})," -\nfor Windows SDK 7.0 (and Visual Studio 2010 too?)"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.a,{target:"_blank","data-noBrokenLinkCheck":!0,href:a(90740).A+"",children:(0,s.jsx)(n.code,{children:"Microsoft.Exchange.Transport.EventInterop.WDK71.diff"})})," -\nfor Windows SDK 7.1"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:'It\'s worth noting that Visual Studio 2010 uses Windows SDK 7.0a internally, which is essentially identical to Windows\nSDK 7.0 (the "a" suffix is mostly just to allow side-by-side installation), so the patch I created for Windows SDK 7.0\nshould work (untested) with Visual Studio 2010. Please let me know how it goes if you happen to try it.'}),"\n",(0,s.jsx)(n.p,{children:"Enjoy :)"}),"\n",(0,s.jsx)(n.h2,{id:"attachments",children:"Attachments"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{target:"_blank","data-noBrokenLinkCheck":!0,href:a(20147).A+"",children:(0,s.jsx)(n.code,{children:"Microsoft.Exchange.Transport.EventInterop.WDK70.diff"})})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{target:"_blank","data-noBrokenLinkCheck":!0,href:a(90740).A+"",children:(0,s.jsx)(n.code,{children:"Microsoft.Exchange.Transport.EventInterop.WDK71.diff"})})}),"\n"]})]})}function h(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},18312:e=>{e.exports=JSON.parse('{"permalink":"/exchange-2000-2003-pia-patches-for-windows-sdk-7-0-and-7-1","source":"@site/blog/2010-12-26-exchange-2000-2003-pia-patches-for-windows-sdk-7-0-and-7-1.md","title":"Exchange 2000 / 2003 PIA Patches for Windows SDK 7.0 and 7.1","description":"Exchange 2010 logo","date":"2010-12-26T15:22:00.000Z","tags":[{"inline":true,"label":"c++","permalink":"/tags/c"},{"inline":true,"label":"com","permalink":"/tags/com"},{"inline":true,"label":"exchange","permalink":"/tags/exchange"},{"inline":true,"label":"mailguard","permalink":"/tags/mailguard"},{"inline":true,"label":"microsoft","permalink":"/tags/microsoft"},{"inline":true,"label":"windows","permalink":"/tags/windows"}],"readingTime":3.19,"hasTruncateMarker":true,"authors":[{"name":"Paul Colby","url":"https://github.com/pcolby","socials":{"github":"https://github.com/pcolby","linkedin":"https://www.linkedin.com/in/paulcolby1/","Qt":"https://forum.qt.io/user/paul-colby","x":"https://x.com/twitStirrer"},"imageURL":"https://github.com/pcolby.png","key":"paul","page":null}],"frontMatter":{"authors":"paul","date":"2010-12-26T15:22","image":"assets/Exchange2010Logo.png","slug":"exchange-2000-2003-pia-patches-for-windows-sdk-7-0-and-7-1","tags":["c++","com","exchange","mailguard","microsoft","windows"],"title":"Exchange 2000 / 2003 PIA Patches for Windows SDK 7.0 and 7.1"},"unlisted":false,"prevItem":{"title":"PHP binding for Apache Qpid\'s Messaging API","permalink":"/php-binding-for-apache-qpids-messaging-api"},"nextItem":{"title":"MeeGo Handset 1.1","permalink":"/meego-handset-1-1"}}')},20147:(e,n,a)=>{a.d(n,{A:()=>t});const t=a.p+"assets/files/Microsoft.Exchange.Transport.EventInterop.WDK70-cef0e15776834d1f3d133db605c3588d.diff"},28453:(e,n,a)=>{a.d(n,{R:()=>o,x:()=>r});var t=a(96540);const s={},i=t.createContext(s);function o(e){const n=t.useContext(i);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),t.createElement(i.Provider,{value:n},e.children)}},42664:(e,n,a)=>{a.d(n,{A:()=>t});const t=a.p+"assets/images/Exchange2010Logo-bd4535b9e7280b1d4e68908b1e4ad7b5.png"},90740:(e,n,a)=>{a.d(n,{A:()=>t});const t=a.p+"assets/files/Microsoft.Exchange.Transport.EventInterop.WDK71-1fc0f0fdff75f8c90ce10da4e123d8bf.diff"}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.