Sign in to follow this  
peter86

Reserved parameters?

Recommended Posts

peter86    123
I'm just wondering what reserved parameters are used for. They come up in a lot of functions, but since you cannot use them, they don't seem to do any good to me. So I'd like an explanation of what they are used for and why.

Share this post


Link to post
Share on other sites
hplus0603    11347
There are three kinds of reserved parameters; all three derive from the idea of shared library binary compatibility with separately compiled applications.

1) The API designer made some elbow room for future improvement. In some future version of the API, maybe the parameter gets re-named, and if it's 0, you get the old behavior, but if it's something else, you get a new, improved behavior from the function. Old programs keep working without re-compilation.

2) The API changed the other way -- a parameter that was sometimes used before, is removed and not really needed. Old program still pass some value in that argument, so it's now made "reserved" -- new programs don't need it.

3) Some internal, undocumented part of the system needs to call that function with special behavior, and uses the reserved parameter for this case. All other calls should pass 0 so they don't get the undocumented behavior and likely crashes or cause some bug.

Share this post


Link to post
Share on other sites
Decibit    140
Or in reverse: they were used in older versions but then became unused and are kept again for backwards compatibility.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this