The Case of the Notepad that Wouldn't Run

Published 06-26-2019 11:29 PM 278 Views
Microsoft
First published on TechNet on Oct 01, 2006

Dave Solomon was on campus a couple of weeks ago presenting a Windows internals seminar to Microsoft developers. Before I joined Microsoft I taught the classes here at Microsoft with him, but now with my other responsibilities here I step into the class and guest present a module or two if my schedule permits. This time I presented the security module, which describes logon (authentication) and the access check (authorization) model. It also includes a separate section on Vista’s User Account Control (UAC) feature, which consists of several technologies including virtualization and a new Mandatory Integrity Control (MIC) security model that’s layered on top of the existing Discretionary Access Control model that Windows NT introduced in its first release.

UAC allows for users, even administrators, to run as standard users most of the time, while giving them the ability to run executables with administrator rights when necessary. There are several mechanisms by which executables can trigger a request for administrator rights:


  1. If the executable image includes a Vista manifest file that specifies a desire or need for administrator rights (this would be added by the developer who creates the image).
  2. If the executable is in Vista’s application compatibility database as a legacy application that Microsoft has identified as requiring administrator rights to run correctly.
  3. If the user explicitly requests an elevation using Explorer’s “Run as administrator” menu item in the context menu for executables (also can be set as an advanced shortcut property). Note that this does not run the executable under the Administrator account, but rather under the account of the logged in user, but with the Administrator group enabled in the process security token.
  4. If the executable is determined to be a setup or installer program (for example, if the word “setup” or “update” is in the image’s name).

Perhaps the most common need for administrator rights comes from setup programs, which generally can’t install properly without write access to HKLM\Software and \Program Files, two locations that only administrators can modify. As an ad-hoc demonstration of the last request method, during the presentation I copied \Windows\Notepad.exe to my account’s profile directory, renaming it to Notepad-setup.exe in the process. Then I launched it, expecting to see a Consent dialog like the one below ask me to grant the renamed Notepad administrative rights:


To my consternation, no such dialog appeared. In fact, nothing happened. I reran it and got the same result. I was thoroughly confused, but didn’t have time to investigate in front of the class, so I moved on.

When I later got a chance to investigate what had happened, I started Notepad-setup.exe using Windbg (part of the free Debugging Tools for Windows ) by clicking “File->Open Executable” followed by “Debug->Go” (or you can press F5). I then stepped through the initial instructions of Notepad’s entry point, Winmain. I saw it call an initialization function named NPInit that invokes LoadAccelerators to load Notepad’s keyboard accelerators. Strangely, LoadAccelerators was failing, causing NPInit to return an error to Winmain and Notepad to silently exit. But why would Notepad fail to load its accelerators, which should be included in the Notepad image itself?

My next step was to see if the file’s name was somehow causing the different behavior so I tried running a copy of Notepad.exe with the original name from my user directory, but got the same behavior (or lack thereof). It was time to watch what was happening with Filemon .

This scenario called for logging the operation of Notepad’s successful execution and comparing that to the log of the failing execution. I started Filemon, set the Include filter to Notepad.exe and the Exclude filter to list the processes that reference Notepad’s image when Notepad launches, including Svchost (where the prefetcher runs) and Explorer (which I was using to launch Notepad):


I collected both traces, but before I could compare them I had to remove the columns that are always different in different execution traces: Sequence, Timestamp, and Process. To do this I loaded the traces into Excel, selected the data in the first three columns, deleted it, and saved the traces back out as tab-demitted text. You can get the two trace files here .

There are a number of text comparison tools available, but one that’s both free and that serves the needs of this type of comparison is Microsoft’s Windiff . Simply open both files and red and yellow lines highlight differences.

The first few lines that Windiff flags are Notepad reading its prefetch file, which has a different name in each trace because the name encodes the full path of the Notepad image it is associated with in a hash number:


The next set of differences are operations present only in the successful run of Notepad, and appear to be queries of some kind of global Windows resource cache that’s new to Windows Vista:


It wasn't clear to me why one run references the cache and the other doesn’t, so I continued to scan through the differences. The next group of differences are at lines 47-51 and are simply due to the different paths of the two Notepad copies:


Finally, at line 121 I came across something that looked like it might be the source of the problem:


The execution of \Windows\Notepad.exe successfully reads a file named Notepad.exe.mui from the \Windows\En-us subdirectory. Further, at line 172 in the trace comparison the failed launch of Notepad tries to read a file of the same name from an En-us subdirectory, but fails because the subdirectory doesn’t exist:


I knew that .mui files store language-dependent resources like strings and accelerators, so I was pretty certain that Notepad’s failure to load its accelerators was due to its inability to find the appropriate resource file for my local, US English (En-us). To verify this I made an En-us subdirectory in my profile directory and copied Notepad.exe.mui into it, reran Notepad from my directory, and it worked.

Previous versions of Windows used .mui files to separate language-specific data from executables, but didn’t know that in Windows Vista this capability is exposed for applications to use. The nice thing about the .mui support is that resource-related functions like LoadAccelerators and FindResourceEx do the magic of the language-specific resource files so application developers don’t need to do anything special coding to take advantage of it.

Now that I had Notepad working outside of the Windows directory I turned my attention to why I hadn’t been presented with a UAC Consent dialog asking me to give it permission to run with administrator rights. What I discovered empirically and then confirmed later in the Understanding and Configuring User Account Control in Windows Vista article on Microsoft.com, is that heuristic setup detection only applies to files that don’t have an embedded manifest that specifies a security TrustLevel. Notepad, like all the Windows executables in Windows Vista, does include a manifest. You can see it when you do a dump of Notepad’s strings with the Sysinternals Strings utility:


So, thanks to Filemon, the case of the Notepad that wouldn’t run was closed!

%3CLINGO-SUB%20id%3D%22lingo-sub-723535%22%20slang%3D%22en-US%22%3EThe%20Case%20of%20the%20Notepad%20that%20Wouldn't%20Run%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-723535%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%20Oct%2001%2C%202006%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%3CP%3E%3CA%20href%3D%22http%3A%2F%2Fwww.solsem.com%2F%22%20mce_href%3D%22http%3A%2F%2Fwww.solsem.com%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EDave%20Solomon%20%3C%2FA%3E%20was%20on%20campus%20a%20couple%20of%20weeks%20ago%20presenting%20a%20Windows%20internals%20seminar%20to%20Microsoft%20developers.%20Before%20I%20joined%20Microsoft%20I%20taught%20the%20classes%20here%20at%20Microsoft%20with%20him%2C%20but%20now%20with%20my%20other%20responsibilities%20here%20I%20step%20into%20the%20class%20and%20guest%20present%20a%20module%20or%20two%20if%20my%20schedule%20permits.%20This%20time%20I%20presented%20the%20security%20module%2C%20which%20describes%20logon%20(authentication)%20and%20the%20access%20check%20(authorization)%20model.%20It%20also%20includes%20a%20separate%20section%20on%20Vista%E2%80%99s%20User%20Account%20Control%20(UAC)%20feature%2C%20which%20consists%20of%20several%20technologies%20including%20virtualization%20and%20a%20new%20Mandatory%20Integrity%20Control%20(MIC)%20security%20model%20that%E2%80%99s%20layered%20on%20top%20of%20the%20existing%20Discretionary%20Access%20Control%20model%20that%20Windows%20NT%20introduced%20in%20its%20first%20release.%20%3CBR%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3EUAC%20allows%20for%20users%2C%20even%20administrators%2C%20to%20run%20as%20standard%20users%20most%20of%20the%20time%2C%20while%20giving%20them%20the%20ability%20to%20run%20executables%20with%20administrator%20rights%20when%20necessary.%20There%20are%20several%20mechanisms%20by%20which%20executables%20can%20trigger%20a%20request%20for%20administrator%20rights%3A%20%3CBR%20%2F%3E%3C%2FP%3E%0A%20%20%3COL%3E%3CBR%20%2F%3E%3CLI%3EIf%20the%20executable%20image%20includes%20a%20Vista%20manifest%20file%20that%20specifies%20a%20desire%20or%20need%20for%20administrator%20rights%20(this%20would%20be%20added%20by%20the%20developer%20who%20creates%20the%20image).%20%3CBR%20%2F%3E%3C%2FLI%3E%0A%20%20%20%3CLI%3EIf%20the%20executable%20is%20in%20Vista%E2%80%99s%20application%20compatibility%20database%20as%20a%20legacy%20application%20that%20Microsoft%20has%20identified%20as%20requiring%20administrator%20rights%20to%20run%20correctly.%20%3CBR%20%2F%3E%3C%2FLI%3E%0A%20%20%20%3CLI%3EIf%20the%20user%20explicitly%20requests%20an%20elevation%20using%20Explorer%E2%80%99s%20%E2%80%9CRun%20as%20administrator%E2%80%9D%20menu%20item%20in%20the%20context%20menu%20for%20executables%20(also%20can%20be%20set%20as%20an%20advanced%20shortcut%20property).%20Note%20that%20this%20does%20not%20run%20the%20executable%20under%20the%20Administrator%20account%2C%20but%20rather%20under%20the%20account%20of%20the%20logged%20in%20user%2C%20but%20with%20the%20Administrator%20group%20enabled%20in%20the%20process%20security%20token.%20%3CBR%20%2F%3E%3C%2FLI%3E%0A%20%20%20%3CLI%3EIf%20the%20executable%20is%20determined%20to%20be%20a%20setup%20or%20installer%20program%20(for%20example%2C%20if%20the%20word%20%E2%80%9Csetup%E2%80%9D%20or%20%E2%80%9Cupdate%E2%80%9D%20is%20in%20the%20image%E2%80%99s%20name).%3C%2FLI%3E%0A%20%20%3C%2FOL%3E%3CBR%20%2F%3E%3CP%3EPerhaps%20the%20most%20common%20need%20for%20administrator%20rights%20comes%20from%20setup%20programs%2C%20which%20generally%20can%E2%80%99t%20install%20properly%20without%20write%20access%20to%20HKLM%5CSoftware%20and%20%5CProgram%20Files%2C%20two%20locations%20that%20only%20administrators%20can%20modify.%20As%20an%20ad-hoc%20demonstration%20of%20the%20last%20request%20method%2C%20during%20the%20presentation%20I%20copied%20%5CWindows%5CNotepad.exe%20to%20my%20account%E2%80%99s%20profile%20directory%2C%20renaming%20it%20to%20Notepad-setup.exe%20in%20the%20process.%20Then%20I%20launched%20it%2C%20expecting%20to%20see%20a%20Consent%20dialog%20like%20the%20one%20below%20ask%20me%20to%20grant%20the%20renamed%20Notepad%20administrative%20rights%3A%20%3CBR%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20mce_src%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F460301%2Foriginal.aspx%22%20original-url%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F460301%2Foriginal.aspx%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F120941i4B8CF8FA87CFBB05%22%20%2F%3E%20%3CBR%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3ETo%20my%20consternation%2C%20no%20such%20dialog%20appeared.%20In%20fact%2C%20nothing%20happened.%20I%20reran%20it%20and%20got%20the%20same%20result.%20I%20was%20thoroughly%20confused%2C%20but%20didn%E2%80%99t%20have%20time%20to%20investigate%20in%20front%20of%20the%20class%2C%20so%20I%20moved%20on.%20%3CBR%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3EWhen%20I%20later%20got%20a%20chance%20to%20investigate%20what%20had%20happened%2C%20I%20started%20Notepad-setup.exe%20using%20Windbg%20(part%20of%20the%20free%20%3CA%20href%3D%22http%3A%2F%2Fwww.microsoft.com%2Fwhdc%2Fdevtools%2Fdebugging%2Fdefault.mspx%22%20mce_href%3D%22http%3A%2F%2Fwww.microsoft.com%2Fwhdc%2Fdevtools%2Fdebugging%2Fdefault.mspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%20Debugging%20Tools%20for%20Windows%20%3C%2FA%3E%20)%20by%20clicking%20%E2%80%9CFile-%26gt%3BOpen%20Executable%E2%80%9D%20followed%20by%20%E2%80%9CDebug-%26gt%3BGo%E2%80%9D%20(or%20you%20can%20press%20F5).%20I%20then%20stepped%20through%20the%20initial%20instructions%20of%20Notepad%E2%80%99s%20entry%20point%2C%20Winmain.%20I%20saw%20it%20call%20an%20initialization%20function%20named%20NPInit%20that%20invokes%20LoadAccelerators%20to%20load%20Notepad%E2%80%99s%20keyboard%20accelerators.%20Strangely%2C%20LoadAccelerators%20was%20failing%2C%20causing%20NPInit%20to%20return%20an%20error%20to%20Winmain%20and%20Notepad%20to%20silently%20exit.%20But%20why%20would%20Notepad%20fail%20to%20load%20its%20accelerators%2C%20which%20should%20be%20included%20in%20the%20Notepad%20image%20itself%3F%20%3CBR%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3EMy%20next%20step%20was%20to%20see%20if%20the%20file%E2%80%99s%20name%20was%20somehow%20causing%20the%20different%20behavior%20so%20I%20tried%20running%20a%20copy%20of%20Notepad.exe%20with%20the%20original%20name%20from%20my%20user%20directory%2C%20but%20got%20the%20same%20behavior%20(or%20lack%20thereof).%20It%20was%20time%20to%20watch%20what%20was%20happening%20with%20%3CA%20href%3D%22http%3A%2F%2Fwww.sysinternals.com%2Futilities%2Ffilemon.html%22%20mce_href%3D%22http%3A%2F%2Fwww.sysinternals.com%2Futilities%2Ffilemon.html%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3E%20Filemon%20%3C%2FA%3E%20.%20%3CBR%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3EThis%20scenario%20called%20for%20logging%20the%20operation%20of%20Notepad%E2%80%99s%20successful%20execution%20and%20comparing%20that%20to%20the%20log%20of%20the%20failing%20execution.%20I%20started%20Filemon%2C%20set%20the%20Include%20filter%20to%20Notepad.exe%20and%20the%20Exclude%20filter%20to%20list%20the%20processes%20that%20reference%20Notepad%E2%80%99s%20image%20when%20Notepad%20launches%2C%20including%20Svchost%20(where%20the%20prefetcher%20runs)%20and%20Explorer%20(which%20I%20was%20using%20to%20launch%20Notepad)%3A%20%3CBR%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20mce_src%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F460302%2Foriginal.aspx%22%20original-url%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F460302%2Foriginal.aspx%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F120942i3456BE82D6AE8476%22%20%2F%3E%20%3CBR%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3EI%20collected%20both%20traces%2C%20but%20before%20I%20could%20compare%20them%20I%20had%20to%20remove%20the%20columns%20that%20are%20always%20different%20in%20different%20execution%20traces%3A%20Sequence%2C%20Timestamp%2C%20and%20Process.%20To%20do%20this%20I%20loaded%20the%20traces%20into%20Excel%2C%20selected%20the%20data%20in%20the%20first%20three%20columns%2C%20deleted%20it%2C%20and%20saved%20the%20traces%20back%20out%20as%20tab-demitted%20text.%20You%20can%20get%20the%20two%20trace%20files%20%3CA%20href%3D%22http%3A%2F%2Fwww.sysinternals.com%2Fblog%2Ffiles%2Fmissing-notepad-logs.zip%22%20mce_href%3D%22http%3A%2F%2Fwww.sysinternals.com%2Fblog%2Ffiles%2Fmissing-notepad-logs.zip%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3E%20here%20%3C%2FA%3E%20.%20%3CBR%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3EThere%20are%20a%20number%20of%20text%20comparison%20tools%20available%2C%20but%20one%20that%E2%80%99s%20both%20free%20and%20that%20serves%20the%20needs%20of%20this%20type%20of%20comparison%20is%20Microsoft%E2%80%99s%20%3CA%20href%3D%22http%3A%2F%2Fwww.microsoft.com%2Fdownloads%2Fdetails.aspx%3FFamilyID%3D49ae8576-9bb9-4126-9761-ba8011fabf38%26amp%3BdisplayLang%3Den%22%20mce_href%3D%22http%3A%2F%2Fwww.microsoft.com%2Fdownloads%2Fdetails.aspx%3FFamilyID%3D49ae8576-9bb9-4126-9761-ba8011fabf38%26amp%3BdisplayLang%3Den%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%20Windiff%20%3C%2FA%3E%20.%20Simply%20open%20both%20files%20and%20red%20and%20yellow%20lines%20highlight%20differences.%20%3CBR%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3EThe%20first%20few%20lines%20that%20Windiff%20flags%20are%20Notepad%20reading%20its%20prefetch%20file%2C%20which%20has%20a%20different%20name%20in%20each%20trace%20because%20the%20name%20encodes%20the%20full%20path%20of%20the%20Notepad%20image%20it%20is%20associated%20with%20in%20a%20hash%20number%3A%20%3CBR%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20mce_src%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F460294%2Foriginal.aspx%22%20original-url%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F460294%2Foriginal.aspx%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F120943i4D9B746A55CC8572%22%20%2F%3E%20%3CBR%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3EThe%20next%20set%20of%20differences%20are%20operations%20present%20only%20in%20the%20successful%20run%20of%20Notepad%2C%20and%20appear%20to%20be%20queries%20of%20some%20kind%20of%20global%20Windows%20resource%20cache%20that%E2%80%99s%20new%20to%20Windows%20Vista%3A%20%3CBR%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20mce_src%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F460295%2Foriginal.aspx%22%20original-url%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F460295%2Foriginal.aspx%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F120944i193DF21030B6665A%22%20%2F%3E%20%3CBR%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3EIt%20wasn't%20clear%20to%20me%20why%20one%20run%20references%20the%20cache%20and%20the%20other%20doesn%E2%80%99t%2C%20so%20I%20continued%20to%20scan%20through%20the%20differences.%20The%20next%26nbsp%3Bgroup%20of%20differences%26nbsp%3Bare%20at%20lines%2047-51%20and%20are%20simply%20due%20to%20the%20different%20paths%20of%20the%20two%20Notepad%20copies%3A%20%3CBR%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20mce_src%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F460296%2Foriginal.aspx%22%20original-url%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F460296%2Foriginal.aspx%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F120945iF3684CC8B43C5838%22%20%2F%3E%20%3CBR%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3EFinally%2C%20at%20line%20121%20I%20came%20across%20something%20that%20looked%20like%20it%20might%20be%20the%20source%20of%20the%20problem%3A%20%3CBR%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20mce_src%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F460297%2Foriginal.aspx%22%20original-url%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F460297%2Foriginal.aspx%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F120946iFC5AEE1EC6616043%22%20%2F%3E%20%3CBR%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3EThe%20execution%20of%20%5CWindows%5CNotepad.exe%20successfully%20reads%20a%20file%20named%20Notepad.exe.mui%20from%20the%20%5CWindows%5CEn-us%20subdirectory.%20Further%2C%20at%20line%20172%20in%20the%20trace%20comparison%20the%20failed%20launch%20of%20Notepad%20tries%20to%20read%20a%20file%20of%20the%20same%20name%20from%20an%20En-us%20subdirectory%2C%20but%20fails%20because%20the%20subdirectory%20doesn%E2%80%99t%20exist%3A%20%3CBR%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20mce_src%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F460299%2Foriginal.aspx%22%20original-url%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F460299%2Foriginal.aspx%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F120947i4C31CDA047789710%22%20%2F%3E%20%3CBR%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3EI%20knew%20that%20.mui%20files%20store%20language-dependent%20resources%20like%20strings%20and%20accelerators%2C%20so%20I%20was%20pretty%20certain%20that%20Notepad%E2%80%99s%20failure%20to%20load%20its%20accelerators%20was%20due%20to%20its%20inability%20to%20find%20the%20appropriate%20resource%20file%20for%20my%20local%2C%20US%20English%20(En-us).%20To%20verify%20this%20I%20made%20an%20En-us%20subdirectory%20in%20my%20profile%20directory%20and%20copied%20Notepad.exe.mui%20into%20it%2C%20reran%20Notepad%20from%20my%20directory%2C%20and%20it%20worked.%20%3CBR%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3EPrevious%20versions%20of%20Windows%20used%20.mui%20files%20to%20separate%20language-specific%20data%20from%20executables%2C%20but%20didn%E2%80%99t%20know%20that%20in%20Windows%20Vista%20this%20capability%20is%20exposed%20for%20applications%20to%20use.%20The%20nice%20thing%20about%20the%20.mui%20support%20is%20that%20resource-related%20functions%20like%20LoadAccelerators%20and%20FindResourceEx%20do%20the%20magic%20of%20the%20language-specific%20resource%20files%20so%20application%20developers%20don%E2%80%99t%20need%20to%20do%20anything%20special%20coding%20to%20take%20advantage%20of%20it.%20%3CBR%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3ENow%20that%20I%20had%20Notepad%20working%20outside%20of%20the%20Windows%20directory%20I%20turned%20my%20attention%20to%20why%20I%20hadn%E2%80%99t%20been%20presented%20with%20a%20UAC%20Consent%20dialog%20asking%20me%20to%20give%20it%20permission%20to%20run%20with%20administrator%20rights.%20What%20I%20discovered%20empirically%20and%20then%20confirmed%20later%20in%20the%20%3CA%20href%3D%22http%3A%2F%2Fwww.microsoft.com%2Ftechnet%2FWindowsVista%2Flibrary%2F00d04415-2b2f-422c-b70e-b18ff918c281.mspx%22%20mce_href%3D%22http%3A%2F%2Fwww.microsoft.com%2Ftechnet%2FWindowsVista%2Flibrary%2F00d04415-2b2f-422c-b70e-b18ff918c281.mspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%20Understanding%20and%20Configuring%20User%20Account%20Control%20in%20Windows%20Vista%20%3C%2FA%3E%20article%20on%20Microsoft.com%2C%20is%20that%20heuristic%20setup%20detection%20only%20applies%20to%20files%20that%20don%E2%80%99t%20have%20an%20embedded%20manifest%20that%20specifies%20a%20security%20TrustLevel.%20Notepad%2C%20like%20all%20the%20Windows%20executables%20in%20Windows%20Vista%2C%20does%20include%20a%20manifest.%20You%20can%20see%20it%20when%20you%20do%20a%20dump%20of%20Notepad%E2%80%99s%20strings%20with%20the%20Sysinternals%20%3CA%20href%3D%22http%3A%2F%2Fwww.sysinternals.com%2Futilities%2Fstrings.html%22%20mce_href%3D%22http%3A%2F%2Fwww.sysinternals.com%2Futilities%2Fstrings.html%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3E%20Strings%20%3C%2FA%3E%20utility%3A%20%3CBR%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20mce_src%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F460300%2Foriginal.aspx%22%20original-url%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F460300%2Foriginal.aspx%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F120948iD19998671E6BDB70%22%20%2F%3E%20%3CBR%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3ESo%2C%20thanks%20to%20Filemon%2C%20the%20case%20of%20the%20Notepad%20that%20wouldn%E2%80%99t%20run%20was%20closed!%3C%2FP%3E%0A%20%0A%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-723535%22%20slang%3D%22en-US%22%3EFirst%20published%20on%20TechNet%20on%20Oct%2001%2C%202006%20Dave%20Solomon%20was%20on%20campus%20a%20couple%20of%20weeks%20ago%20presenting%20a%20Windows%20internals%20seminar%20to%20Microsoft%20developers.%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-723535%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMark%20Russinovich%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Version history
Last update:
‎Jun 26 2019 11:29 PM
Updated by: