Why do old windows API's require you to pass so many parameters?
example(from stack overflow) :
// additional information
STARTUPINFO si;
PROCESS_INFORMATION pi;
// set the size of the structures
ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
ZeroMemory( &pi, sizeof(pi) );
// start the program up
CreateProcess( lpApplicationName, // the path
argv[1], // Command line
NULL, // Process handle not inheritable
NULL, // Thread handle not inheritable
FALSE, // Set handle inheritance to FALSE
0, // No creation flags
NULL, // Use parent's environment block
NULL, // Use parent's starting directory
&si, // Pointer to STARTUPINFO structure
&pi ) // Pointer to PROCESS_INFORMATION structure
)
// Close process and thread handles.
CloseHandle( pi.hProcess );
CloseHandle( pi.hThread
);
Why so complicated? Every parameter is required, we do not need to force the users to pass in every parameters at once, they could be setup later, provide a "constructor" and so on.
edit : The C language doesn't support default values, so I remove this option