News for hackers. Stuff that matters.
Re:Microsoft reveals its server designs and releases open so... by Locke1689 on Tuesday March 11, 2014 @01:46PM (#7380887)
C programmers (including me when I'm lazy) will often simply allocate MAX_PATH characters for a file name buffer and not think about it.
Re:Microsoft reveals its server designs and releases open so... by gecko on Tuesday March 11, 2014 @03:33PM (#7381599)
Exactly; that's the problem. The usual correct way in Windows of calling the function with `NULL` to get the length, then allocating the buffer and passing it back in, is wicked annoying with path names, so most developers simply don't bother.

Interestingly, while that problem doesn't exist in .NET, and so you'd think that .NET would finally support long file names by default, Microsoft actually goes entirely the opposite direction: the BCL strips out any leading `\\?\` in paths to force you to stay at MAX_PATH or below. The more things change...

Re:Microsoft reveals its server designs and releases open so... by brokenparser on Tuesday March 11, 2014 @05:37PM (#7382338)
You know there's a way around having to do those things every time you use CreateFile, right? It's a neat thing they invented many moons ago, starts with an F and ends with "nction".
Re:Microsoft reveals its server designs and releases open so... by Locke1689 on Wednesday March 12, 2014 @02:17PM (#7387276)
Which leads to an ever-growing file called "Utilities.cpp" that gets copied into every C++ project you ever write and god forbid there's ever a bug fix you have to do because it now needs to be applied to 20 separate projects in 20 separate version control systems.
Re:Microsoft reveals its server designs and releases open so... by brokenparser on Thursday March 13, 2014 @07:44AM (#7391177)
There are ways around having to apply a patch 20 times, too. Libraries and git submodules to name a few.

Secondly, if you use 20 version control systems, you're doing it horribly, horribly wrong.