Home
%3CLINGO-SUB%20id%3D%22lingo-sub-723585%22%20slang%3D%22en-US%22%3EThe%20Case%20of%20the%20Failed%20File%20Compression%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-723585%22%20slang%3D%22en-US%22%3E%0A%20%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3DUTF-8%22%20%2F%26gt%3B%3CSTRONG%3E%20First%20published%20on%20TechNet%20on%20Aug%2006%2C%202007%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3EThe%20other%20day%20Bryce%20tried%20to%20use%20Explorer%E2%80%99s%20%3CB%20style%3D%22mso-bidi-font-weight%3A%20normal%22%3ESend%20To%20Compressed%20(zipped)%20Folder%20%3C%2FB%3Efeature%2C%20seen%20below%2C%20to%20package%20up%20his%20latest%20%3C%2FFONT%3E%3CA%20href%3D%22http%3A%2F%2Fwww.microsoft.com%2Ftechnet%2Fsysinternals%2Fprocessesandthreads%2Fprocessmonitor.mspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3EProcess%20Monitor%20%3C%2FFONT%3E%3C%2FA%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3Esource%20code%20updates%20to%20send%20me.%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20%3CIMG%20height%3D%22152%22%20mce_src%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F1702268%2Foriginal.aspx%22%20original-url%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F1702268%2Foriginal.aspx%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F120974iED9A8493C927E841%22%20style%3D%22WIDTH%3A%20445px%3B%20HEIGHT%3A%20152px%22%20width%3D%22445%22%20%2F%3E%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20Instead%20of%20presenting%20compression%20progress%20dialog%20followed%20by%20an%20opportunity%20to%20edit%20the%20name%20of%20resulting%20compressed%20file%2C%20Explorer%20aborted%20the%20compression%20with%20this%20error%3A%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20%3CIMG%20height%3D%22172%22%20mce_src%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F1702271%2Foriginal.aspx%22%20original-url%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F1702271%2Foriginal.aspx%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F120975iAF4BEFFB01594EAF%22%20style%3D%22WIDTH%3A%20408px%3B%20HEIGHT%3A%20172px%22%20width%3D%22408%22%20%2F%3E%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20Bryce%20was%20perplexed.%20The%20error%20didn%E2%80%99t%20seem%20to%20make%20any%20sense%20because%20he%20obviously%20had%20read%20permission%20to%20the%20files%20in%20the%20selection%2C%20which%20he%E2%80%99d%20just%20finished%20editing%2C%20and%20compressing%20files%20shouldn%E2%80%99t%20involve%20some%20kind%20of%20search%20that%20could%20result%20in%20a%20file%20not%20being%20found.%20%3CSPAN%20style%3D%22mso-spacerun%3A%20yes%22%3E%20%3C%2FSPAN%3E%20He%20retried%20the%20compression%20operation%2C%20but%20got%20the%20same%20error%2C%20this%20time%20after%20a%20different%20number%20of%20files%20had%20finished%20compressing.%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20I%20happened%20to%20walk%20into%20his%20office%20at%20this%20point%20and%20he%20showed%20me%20the%20behavior%20by%20trying%20a%20few%20more%20times%2C%20all%20with%20the%20same%20outcome.%20%3CSPAN%20style%3D%22mso-spacerun%3A%20yes%22%3E%20%3C%2FSPAN%3E%20Now%20both%20of%20us%20were%20perplexed.%20It%20was%20time%20to%20investigate%2C%20and%20the%20tool%20we%20called%20on%20for%20the%20job%20was%2C%20somewhat%20ironically%2C%20Process%20Monitor.%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20We%20launched%20Process%20Monitor%2C%20reproduced%20the%20failure%2C%20stopped%20the%20capture%2C%20and%20scanned%20through%20the%20thousands%20of%20operations%20in%20the%20trace%20looking%20for%20errors.%20We%20saw%20a%20slew%20of%20NOT%20FOUND%20errors%20near%20the%20start%20of%20the%20log%2C%20which%20are%20the%20generally%20innocuous%20result%20of%20an%20application%20checking%20for%20the%20pre-existence%20of%20a%20file.%20In%20fact%2C%20there%20were%20literally%20hundreds%20of%20them%20near%20the%20beginning%20of%20the%20log%2C%20all%20of%20which%20were%20queries%20for%20the%20file%20into%20which%20the%20compressed%20files%20would%20be%20placed%3A%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20mce_keep%3D%22true%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CIMG%20height%3D%22210%22%20mce_src%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F1702272%2Foriginal.aspx%22%20original-url%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F1702272%2Foriginal.aspx%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F120976i61995A10F9E4B9F6%22%20style%3D%22WIDTH%3A%20550px%3B%20HEIGHT%3A%20210px%22%20width%3D%22550%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20That%20was%20disturbing%2C%20but%20not%20directly%20related%20to%20our%20troubleshooting%20effort%2C%20so%20I%20filed%20it%20away%20to%20look%20at%20later.%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20Several%20hundred%20events%20into%20the%20trace%20later%20we%20came%20across%20a%20SHARING%20VIOLATION%20error%20that%20bore%20a%20closer%20look%3A%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20%3CIMG%20height%3D%22111%22%20mce_src%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F1702275%2Foriginal.aspx%22%20original-url%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F1702275%2Foriginal.aspx%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F120977i13431E5D9AA40614%22%20style%3D%22WIDTH%3A%20550px%3B%20HEIGHT%3A%20111px%22%20width%3D%22550%22%20%2F%3E%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20When%20a%20process%20opens%20a%20file%20it%20can%20specify%20if%20and%20how%20it%20wants%20to%20share%20the%20file%20with%20other%20processes%20while%20it%20has%20the%20file%20opened.%20The%20three%20types%20of%20sharing%20are%20read%2C%20write%20and%20delete%2C%20and%20each%20is%20represented%20with%20a%20flag%20that%20a%20process%20passes%20to%20the%20CreateFile%20API.%20In%20the%20operation%20that%20failed%2C%20Explorer%20didn%E2%80%99t%20pass%20any%20of%20the%20flags%2C%20indicating%20that%20it%20didn%E2%80%99t%20want%20to%20share%20the%20file%2C%20as%20seen%20in%20the%20ShareMode%20field%3A%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20%3CIMG%20height%3D%22118%22%20mce_src%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F1702276%2Foriginal.aspx%22%20original-url%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F1702276%2Foriginal.aspx%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F120978iA721B62F64A47733%22%20style%3D%22WIDTH%3A%20426px%3B%20HEIGHT%3A%20118px%22%20width%3D%22426%22%20%2F%3E%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20For%20an%20open%20to%20succeed%2C%20the%20sharing%20mode%20of%20the%20opener%20must%20be%20compatible%20with%20the%20sharing%20allowed%20by%20a%20process%20that%20already%20has%20the%20file%20opened%2C%20so%20the%20explanation%20for%20the%20error%20was%20that%20another%20process%20already%20had%20the%20file%20opened.%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20Looking%20back%20at%20the%20trace%2C%20the%20open%20operation%20immediately%20preceding%20the%20one%20with%20the%20error%20is%20an%20open%20of%20the%20same%20file%20by%20a%20process%20named%20Inort.exe.%20Inort%E2%80%99s%20close%20of%20the%20file%20isn%E2%80%99t%20visible%20in%20the%20screenshot%20because%20it%20comes%20long%20after%20Explorer%E2%80%99s%20failed%20attempt%20to%20open%20the%20file.%20That%20confirmed%20that%20Explorer%E2%80%99s%20unwillingness%20to%20share%20the%20file%20conflicted%20with%20Inort%20having%20the%20file%20open%2C%20despite%20the%20fact%20that%20Inort%20specified%20read%2C%20write%20and%20delete%20sharing%20in%20its%20open%20of%20the%20file.%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20Process%20Monitor%20had%20closed%20another%20case%3A%20Inort%20holding%20the%20file%20open%20when%20Explorer%20tried%20to%20open%20it%20was%20the%20cause%20of%20the%20sharing%20violation%20and%20almost%20certainly%20the%20reason%20for%20the%20misleading%20error%20message.%20Next%20we%20had%20to%20identify%20Inort%20so%20that%20we%20could%20come%20up%20with%20a%20fix%20or%20workaround.%20Process%20Monitor%20also%20answered%20that%20question%20with%20its%20image%20tooltip%3A%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20%3CIMG%20mce_src%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F1702279%2Foriginal.aspx%22%20original-url%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F1702279%2Foriginal.aspx%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F120979i37AFE8AA1E0C9041%22%20%2F%3E%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20size%3D%223%22%3E%20%3CFONT%20face%3D%22Calibri%22%3E%20eTrust%2C%20Computer%20Associates%E2%80%99%20Antivirus%20scanner%2C%20was%20apparently%20opening%20the%20file%20to%20scan%20it%20for%20viruses%2C%20but%20interfering%20with%20the%20operation%20of%20Explorer.%20Antivirus%20should%20be%20invisible%20to%20the%20system%2C%20so%20the%20error%20revealed%20a%20bug%20in%20eTrust.%20The%20workaround%20was%20for%20Bryce%20to%20set%20a%20directory%20filter%20that%20excludes%20his%20source%20directories%20from%20real-time%20scanning.%20%3CSPAN%20style%3D%22mso-spacerun%3A%20yes%22%3E%20%3C%2FSPAN%3E%20%3C%2FFONT%3E%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20I%20couldn%E2%80%99t%20reproduce%20the%20error%20when%20I%20went%20back%20to%20my%20office%2C%20so%20I%20suspected%20that%20I%20had%20a%20different%20version%20of%20Inoculan%20on%20my%20system%20than%20Bryce.%20Process%20Monitor%E2%80%99s%20process%20page%20on%20the%20event%20properties%20dialog%20for%20an%20Inort.exe%20event%20showed%20that%20Bryce%20had%20version%207.01.0192.0001%20and%20I%20had%20the%20more%20recent%207.01.0501.000%3A%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20%3C%2FFONT%3E%20%3CSPAN%20style%3D%22mso-no-proof%3A%20yes%22%3E%20%3CSPAN%20style%3D%22mso-no-proof%3A%20yes%22%3E%20%3CIMG%20height%3D%22149%22%20mce_src%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F1702283%2Foriginal.aspx%22%20original-url%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F1702283%2Foriginal.aspx%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F120980i3863BB76D22FB6DD%22%20style%3D%22WIDTH%3A%20294px%3B%20HEIGHT%3A%20149px%22%20width%3D%22294%22%20%2F%3E%20%3C%2FSPAN%3E%20%3CIMG%20height%3D%22152%22%20mce_src%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F1702281%2Foriginal.aspx%22%20original-url%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F1702281%2Foriginal.aspx%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F120981iAA59A4C17D703871%22%20style%3D%22WIDTH%3A%20307px%3B%20HEIGHT%3A%20152px%22%20width%3D%22307%22%20%2F%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20Why%20we%20have%20different%20versions%20isn%E2%80%99t%20clear%20since%20we%E2%80%99re%20both%20using%20images%20deployed%20and%20managed%20by%20Microsoft%20IT%2C%20but%20it%20appears%20that%20Computer%20Associates%20has%20fixed%20the%20bug%20in%20newer%20releases.%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20Now%20I%20turned%20my%20attention%20back%20to%20the%20inefficiencies%20of%20Explorer%E2%80%99s%20compression%20feature.%20I%20captured%20a%20Process%20Monitor%20trace%20of%20the%20compression%20of%20a%20single%20file%20and%20counted%20the%20associated%20operations.%20Just%20for%20this%20simple%20case%2C%20Explorer%20opened%20the%20target%20ZIP%20file%2014%20times%2C%2012%20of%20those%20before%20it%20had%20actually%20created%20the%20file%20and%20therefore%20with%20NOT%20FOUND%20results%2C%20and%20performed%20directory%20look%20ups%20of%20the%20target%2019%20times.%20It%20was%20also%20redundant%20with%20the%20source%20file%2C%20opening%20it%2028%20times%20and%20querying%20the%20file%E2%80%99s%20basic%20properties%2017%20times.%20It%E2%80%99s%20not%20like%20Explorer%20doesn%E2%80%99t%20give%20eTrust%20plenty%20of%20opportunities%20to%20cause%20sharing%20problems.%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20In%20order%20to%20verify%20that%20Explorer%20itself%20was%20at%20fault%2C%20and%20not%20some%20third-party%20extension%2C%20I%20looked%20at%20the%20stacks%20of%20various%20events%20by%20selecting%20the%20event%20and%20typing%20Ctrl%2BK%20to%20open%20the%20event%20properties%20dialog%20to%20the%20stack%20page%3A%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20%3CIMG%20height%3D%22191%22%20mce_src%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F1702286%2Foriginal.aspx%22%20original-url%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F1702286%2Foriginal.aspx%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F120982iB02A34183B112719%22%20style%3D%22WIDTH%3A%20550px%3B%20HEIGHT%3A%20191px%22%20width%3D%22550%22%20%2F%3E%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20Zipfldr.dll%2C%20the%20Explorer%20file%20compression%20DLL%2C%20was%20in%20most%20of%20the%20stack%20traces%2C%20meaning%20that%26nbsp%3Bthe%20compression%20engine%20itself%20was%20ultimately%20responsible%20for%20the%20waste.%20Further%2C%20the%20number%20of%20repetitious%20operations%20explodes%20when%20you%20compress%20multiple%20files.%20There%20are%20clearly%20easy%20ways%20to%20improve%20the%20algorithm%2C%20so%20hopefully%20we%E2%80%99ll%20see%20a%20more%20efficient%20compression%20engine%20in%20Windows%207.%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20%3CEM%3E%20Update%3A%20I've%20learned%20that%20the%20compression%20engine%20has%20been%20updated%20in%20Vista%20SP1%20to%20perform%20fewer%20file%20operations.%20%3C%2FEM%3E%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3EOn%20a%20closing%20note%2C%20if%20you%E2%80%99d%20like%20to%20catch%20me%20at%20my%20next%20public%20speaking%20engagement%2C%20come%20to%20%3C%2FFONT%3E%3CA%20href%3D%22https%3A%2F%2Fwww.devscovery.com%2FRegistration%2FDevscoveryRegistration.aspx%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3EWintellect%E2%80%99s%20Devscovery%20%3C%2FFONT%3E%3C%2FA%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3Econference%20in%20Redmond%2C%20August%2014-16%2C%20where%20I%E2%80%99m%20delivering%20a%20keynote%20on%20Vista%20kernel%20changes.%20%3C%2FFONT%3E%3C%2FP%3E%0A%20%0A%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-723585%22%20slang%3D%22en-US%22%3EFirst%20published%20on%20TechNet%20on%20Aug%2006%2C%202007%20The%20other%20day%20Bryce%20tried%20to%20use%20Explorer%E2%80%99s%20Send%20To%20Compressed%20(zipped)%20Folder%20feature%2C%20seen%20below%2C%20to%20package%20up%20his%20latest%20Process%20Monitor%20source%20code%20updates%20to%20send%20me.%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-723585%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMark%20Russinovich%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft
First published on TechNet on Aug 06, 2007

The other day Bryce tried to use Explorer’s Send To Compressed (zipped) Folder feature, seen below, to package up his latest Process Monitor source code updates to send me.



Instead of presenting compression progress dialog followed by an opportunity to edit the name of resulting compressed file, Explorer aborted the compression with this error:



Bryce was perplexed. The error didn’t seem to make any sense because he obviously had read permission to the files in the selection, which he’d just finished editing, and compressing files shouldn’t involve some kind of search that could result in a file not being found. He retried the compression operation, but got the same error, this time after a different number of files had finished compressing.


I happened to walk into his office at this point and he showed me the behavior by trying a few more times, all with the same outcome. Now both of us were perplexed. It was time to investigate, and the tool we called on for the job was, somewhat ironically, Process Monitor.


We launched Process Monitor, reproduced the failure, stopped the capture, and scanned through the thousands of operations in the trace looking for errors. We saw a slew of NOT FOUND errors near the start of the log, which are the generally innocuous result of an application checking for the pre-existence of a file. In fact, there were literally hundreds of them near the beginning of the log, all of which were queries for the file into which the compressed files would be placed:



That was disturbing, but not directly related to our troubleshooting effort, so I filed it away to look at later.


Several hundred events into the trace later we came across a SHARING VIOLATION error that bore a closer look:



When a process opens a file it can specify if and how it wants to share the file with other processes while it has the file opened. The three types of sharing are read, write and delete, and each is represented with a flag that a process passes to the CreateFile API. In the operation that failed, Explorer didn’t pass any of the flags, indicating that it didn’t want to share the file, as seen in the ShareMode field:



For an open to succeed, the sharing mode of the opener must be compatible with the sharing allowed by a process that already has the file opened, so the explanation for the error was that another process already had the file opened.


Looking back at the trace, the open operation immediately preceding the one with the error is an open of the same file by a process named Inort.exe. Inort’s close of the file isn’t visible in the screenshot because it comes long after Explorer’s failed attempt to open the file. That confirmed that Explorer’s unwillingness to share the file conflicted with Inort having the file open, despite the fact that Inort specified read, write and delete sharing in its open of the file.


Process Monitor had closed another case: Inort holding the file open when Explorer tried to open it was the cause of the sharing violation and almost certainly the reason for the misleading error message. Next we had to identify Inort so that we could come up with a fix or workaround. Process Monitor also answered that question with its image tooltip:



eTrust, Computer Associates’ Antivirus scanner, was apparently opening the file to scan it for viruses, but interfering with the operation of Explorer. Antivirus should be invisible to the system, so the error revealed a bug in eTrust. The workaround was for Bryce to set a directory filter that excludes his source directories from real-time scanning.


I couldn’t reproduce the error when I went back to my office, so I suspected that I had a different version of Inoculan on my system than Bryce. Process Monitor’s process page on the event properties dialog for an Inort.exe event showed that Bryce had version 7.01.0192.0001 and I had the more recent 7.01.0501.000:



Why we have different versions isn’t clear since we’re both using images deployed and managed by Microsoft IT, but it appears that Computer Associates has fixed the bug in newer releases.


Now I turned my attention back to the inefficiencies of Explorer’s compression feature. I captured a Process Monitor trace of the compression of a single file and counted the associated operations. Just for this simple case, Explorer opened the target ZIP file 14 times, 12 of those before it had actually created the file and therefore with NOT FOUND results, and performed directory look ups of the target 19 times. It was also redundant with the source file, opening it 28 times and querying the file’s basic properties 17 times. It’s not like Explorer doesn’t give eTrust plenty of opportunities to cause sharing problems.


In order to verify that Explorer itself was at fault, and not some third-party extension, I looked at the stacks of various events by selecting the event and typing Ctrl+K to open the event properties dialog to the stack page:



Zipfldr.dll, the Explorer file compression DLL, was in most of the stack traces, meaning that the compression engine itself was ultimately responsible for the waste. Further, the number of repetitious operations explodes when you compress multiple files. There are clearly easy ways to improve the algorithm, so hopefully we’ll see a more efficient compression engine in Windows 7.


Update: I've learned that the compression engine has been updated in Vista SP1 to perform fewer file operations.


On a closing note, if you’d like to catch me at my next public speaking engagement, come to Wintellect’s Devscovery conference in Redmond, August 14-16, where I’m delivering a keynote on Vista kernel changes.