Showing results for Code - The Old New Thing

Mar 25, 2015
Post comments count0
Post likes count0

What's the difference between PathIsSystemFolder and Protected Operating System Files?

Raymond Chen
Raymond Chen

The way to detect weird directories that should be excluded from the user interface is to check for the and attributes being set simultaneously. This is the mechanism used when you uncheck Hide protected operating system files in the Folder Options dialog. (Programmatically, you detect whether the user wants to see protected operating system fi...

Code
Mar 16, 2015
Post comments count0
Post likes count0

Does the CLR really call CoInitializeEx on the first call to unmanaged code, even if you don't deal with COM at all and are just calling native code via p/invoke?

Raymond Chen
Raymond Chen

Some time ago, I called out this part of the documentation regarding managed and unmanaged threading: On the first call to unmanaged code, the runtime calls Co­Initialize­Ex to initialize the COM apartment as either an MTA or an STA apartment. You can control the type of apartment created by setting the System.Threading.ApartmentState ...

Code