Fun stuff with \?

This comes up in an internal discussion about MAX_PATH limit. People do mention that the core file services supports syntax like \\?\ for path longer than MAX_PATH. The caveat is that file name with \\?\ is not canonicalized by the OS. This can lead to many funny behavior. One of our senior developer writes the following…


WritePrivateProfileString and AnitVirus

Another shocking discovery. WritePrivateProfileString hangs because AntiVirus is accessing the ini file. I really don’t know what to do now.


How to make an application as both GUI and Console application?

This is another common asked question. But it is a Win32 question. In Windows GUI applications and Console applications are very different. GUI applications have at least one window, and a message loop, but no standard in/out/error. Console applications have standard in/out/error, but no window, no message loop. An application is either a GUI application or Console…



Learned a hard lesson. Contention between GetPrivateProfileString and WritePrivateProfileString may cause a deadlock, even for multiple processes. If you intent to Read/Write the same ini file, you have to lock the file yourself. Yes, I know they are marked as deprecated. But they are really handy when you only have small settings. I don’t want…