Functions in the Win32 SDK that return variable-sized data usually allow you to pass a zero-sized buffer, and then they tell you how much space you'll need. They tend to look like one of the following (simplified):Functions in the Win32 SDK that return variable