The GetProfileServiceVersion function in the code sample accepts a profile as an input parameter. Depending on whether the PR_PROFILE_SERVER_VERSION property and the PR_PROFILE_SERVER_FULL_VERSION property exist in the given profile, the function gets each property and returns the appropriate version information as output parameters.
GetProfileServiceVersion first calls the MAPIAdminProfiles function to create a profile administration object. It then uses the profile administration object to call IProfAdmin::AdminServices to obtain a message service administration object. Using the message service administration object, it calls IMsgServiceAdmin::OpenProfileSection to obtain a section of the current profile, and then calls HrGetOneProp to verify if each of the two properties exists in that section of the profile, and if so, sets the version information in the appropriate output parameters.