Skip to content

Commit a0b471a

Browse files
authored
Merge pull request #787 from Matthew-J625/docs-editor/iprofadmin-setdefaultprofile-1732662406
Document MAPI "App" Profiles
2 parents 7ae4656 + 45fe418 commit a0b471a

7 files changed

Lines changed: 78 additions & 26 deletions

docs/outlook/mapi/iprofadmin-copyprofile.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,16 @@ HRESULTCopyProfile(
5353

5454
> [in] A bitmask of flags that controls how the profile is copied. The following flags can be set:
5555
56+
MAPI_APP_PROFILE
57+
58+
> Allows copying an "app" profile. This flag must be set if the existing profile is an "app" profile.
59+
>
60+
> This flag may not be recognized or supported in all MAPI implementations.
61+
5662
MAPI_DIALOG
57-
58-
> Displays a dialog box that prompts the user for the correct password of the profile to copy. If this flag is not set, no dialog box is displayed.
5963

64+
> Displays a dialog box that prompts the user for the correct password of the profile to copy. If this flag is not set, no dialog box is displayed.
6065
## Return value
61-
6266
S_OK
6367

6468
> The profile was successfully copied.
@@ -71,6 +75,10 @@ MAPI_E_LOGON_FAILED
7175

7276
> The password for the profile to copy is incorrect, and a dialog box could not be displayed to the user to request the correct password because MAPI_DIALOG was not set in the _ulFlags_ parameter.
7377
78+
MAPI_E_NO_ACCESS
79+
80+
> The existing profile is an "app" profile, and the MAPI_APP_PROFILE flag was not set.
81+
7482
MAPI_E_NOT_FOUND
7583

7684
> The specified profile does not exist.
@@ -91,7 +99,9 @@ The name of the original profile, its password, and the copy can be up to 64 cha
9199
Profile passwords are not supported on all operating systems. On operating systems that do not support profile passwords, _lpszOldPassword_ can be NULL or a pointer to a zero-length string.
92100

93101
If _lpszOldPassword_ is set to NULL, the profile to be copied requires a password, and the MAPI_DIALOG flag is set; a dialog box that prompts the user to provide the password is displayed. If a password is required, but _lpszOldPassword_ is set to NULL and the MAPI_DIALOG flag is not set, **CopyProfile** returns MAPI_E_LOGON_FAILED.
94-
102+
103+
If the existing profile is an "app" profile, and the MAPI_APP_PROFILE flag is not set, **CopyProfile** returns MAPI_E_NO_ACCESS. If the existing profile is an "app" profile, and the MAPI_APP_PROFILE is set, the new profile will also be an "app" profile. If the existing profile is not an "app" profile, the new profile will not be an "app" profile regardless of the MAPI_APP_PROFILE flag.
104+
95105
## See also
96106

97107
[IProfAdmin : IUnknown](iprofadminiunknown.md)

docs/outlook/mapi/iprofadmin-createprofile.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,13 @@ HRESULT CreateProfile(
4949
_ulFlags_
5050

5151
> [in] A bitmask of flags that controls how the profile is created. The following flags can be set:
52-
52+
53+
MAPI_APP_PROFILE
54+
55+
> MAPI should create this profile as an "app" profile, which limits discoverability and interactions.
56+
>
57+
> This flag may not be recognized or supported in all MAPI implementations.
58+
5359
MAPI_DEFAULT_SERVICES
5460

5561
> MAPI should populate the new profile with the message services that are included in the [Default Services] section of the Mapisvc.inf file.
@@ -87,7 +93,7 @@ The name of the new profile and its password can be up to 64 characters in lengt
8793
- Embedded spaces, but not leading or trailing spaces.
8894

8995
The _lpszPassword_ parameter must be NULL or a pointer to a zero-length string.
90-
96+
9197
## See also
9298

9399

docs/outlook/mapi/iprofadmin-deleteprofile.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,24 @@ HRESULT DeleteProfile(
3737
3838
_ulFlags_
3939

40-
> [in] Always NULL.
41-
40+
> [in] A bitmask of flags that controls how a profile is deleted. The following flag can be set:
41+
42+
MAPI_APP_PROFILE
43+
44+
> Allows deleting an "app" profile. This flag must be set if the profile to be deleted is an "app" profile.
45+
>
46+
> This flag may not be recognized or supported in all MAPI implementations.
47+
4248
## Return value
4349

4450
S_OK
4551

4652
> The profile was successfully deleted.
47-
53+
54+
MAPI_E_NO_ACCESS
55+
56+
> The profile is an "app" profile, and the MAPI_APP_PROFILE flag was not set.
57+
4858
MAPI_E_NOT_FOUND
4959

5060
> The specified profile does not exist.
@@ -56,7 +66,9 @@ The **IProfAdmin::DeleteProfile** method deletes a profile. If the profile to de
5666
The entry point function for each message service in the profile is called with the MSG_SERVICE_DELETE value set in the _ulContext_ parameter. First, the function deletes the service, and then it deletes the service's profile section. The message service entry point function is not called again after the service has been deleted.
5767

5868
No password is required to delete a profile.
59-
69+
70+
71+
6072
## MFCMAPI reference
6173

6274
For MFCMAPI sample code, see the following table.

docs/outlook/mapi/iprofadmin-getprofiletable.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,14 @@ HRESULT GetProfileTable(
3333

3434
_ulFlags_
3535

36-
> [in] Always NULL.
37-
36+
> [in] A bitmask of flags that controls how the profile table is populated. The following flag can be set:
37+
38+
MAPI_APP_PROFILE
39+
40+
> Include "app" profiles in the profile table. If this flag is not set, "app" profiles are not included.
41+
>
42+
> This flag may not be recognized or supported in all MAPI implementations.
43+
3844
_lppTable_
3945

4046
> [out] A pointer to a pointer to the profile table.
@@ -50,11 +56,11 @@ S_OK
5056
The **IProfAdmin::GetProfileTable** method provides access to the profile table, which contains one row for every available profile. There are only two columns in each row: the profile's display name, and a flag that indicates whether the profile is the default.
5157

5258
Profiles that have been deleted, or that are in use but have been marked for deletion, are not included in the profile table. The profile table is static; subsequent additions and deletions of profiles are not reflected in the table.
53-
59+
5460
If no profiles exist, **GetProfileTable** returns a table with zero rows.
5561

5662
For more information about the profile table, see [Profile Tables](profile-tables.md).
57-
63+
5864
## MFCMAPI reference
5965

6066
For MFCMAPI sample code, see the following table.

docs/outlook/mapi/iprofadmin-renameprofile.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,28 @@ HRESULT RenameProfile(
5353
5454
_ulFlags_
5555

56-
> [in] Always NULL.
57-
56+
> [in] A bitmask of flags that controls how the profile is renamed. The following flag can be set:
57+
58+
MAPI_APP_PROFILE
59+
60+
> Allows renaming an "app" profile. This flag must be set if the profile is an "app" profile.
61+
>
62+
> This flag may not be recognized or supported in all MAPI implementations.
63+
5864
## Return value
5965

6066
S_OK
6167

6268
> The profile was successfully renamed.
63-
69+
6470
MAPI_E_LOGON_FAILED
65-
71+
6672
> The profile password is incorrect.
67-
73+
74+
MAPI_E_NO_ACCESS
75+
76+
> The profile is an "app" profile, and the MAPI_APP_PROFILE flag was not set.
77+
6878
MAPI_E_USER_CANCEL
6979

7080
> The user canceled the operation, typically by clicking the **Cancel** button in a dialog box.
@@ -80,7 +90,7 @@ The old and new names of the profile can be up to 64 characters in length and ca
8090
- Embedded spaces, but not leading or trailing spaces.
8191

8292
The _lpszPassword_ should always be NULL or a pointer to a zero-length string.
83-
93+
8494
## See also
8595

8696

docs/outlook/mapi/iprofadmin-setdefaultprofile.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,17 @@ S_OK
5050

5151
> A default profile was successfully established or removed.
5252
53+
E_FAIL
54+
55+
> The specified profile cannot be set as the default profile.
56+
5357
MAPI_E_NOT_FOUND
54-
58+
5559
> The specified profile does not exist.
56-
5760
## Remarks
5861

59-
The **IProfAdmin::SetDefaultProfile** method either establishes a particular profile as the client's default profile or clears the current default profile. The default profile is the profile that is automatically used whenever the client begins a MAPI session. **SetDefaultProfile** also sets the new default profile's **PR_DEFAULT_PROFILE** ([PidTagDefaultProfile](pidtagdefaultprofile-canonical-property.md)) property to TRUE.
60-
62+
The **IProfAdmin::SetDefaultProfile** method either establishes a particular profile as the client's default profile or clears the current default profile. An "app" profile cannot be set as the default profile. The default profile is the profile that is automatically used whenever the client begins a MAPI session. **SetDefaultProfile** also sets the new default profile's **PR_DEFAULT_PROFILE** ([PidTagDefaultProfile](pidtagdefaultprofile-canonical-property.md)) property to TRUE.
63+
6164
## Notes to callers
6265

6366
To start a session with the default profile, pass the MAPI_USE_DEFAULT flag to the [MAPILogonEx](mapilogonex.md) function.

docs/outlook/mapi/mapilogonex.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,12 @@ HRESULT MAPILogonEx(
5959
MAPI_ALLOW_OTHERS
6060

6161
> The shared session should be returned, which allows later clients to obtain the session without providing any user credentials.
62-
62+
63+
MAPI_APP_PROFILE
64+
65+
> Include "app" profiles in the logon dialog list. If this flag is not set, "app" profiles are not included.
66+
> This flag may not be recognized or supported in all MAPI implementations.
67+
6368
MAPI_BG_SESSION
6469

6570
> Log on to a session and run any operations in the background. In general, if a client intends to do processing on a background thread or in a separate process in a manner that is unobtrusive to the foreground thread, it should call with the MAPI_BG_SESSION flag. A client application such as an indexing engine or opening a Personal Folders File (PST) for background type access are some examples of where to use MAPI_BG_SESSION.MAPILogonEx.
@@ -135,7 +140,7 @@ MAPI_E_USER_CANCEL
135140
MAPI client applications call the MAPILogonEx function to log on to a session with the messaging system. All strings that are passed in and returned to and from MAPI calls are null-terminated and must be specified in the current character set or code page of the calling client or provider's operating system.
136141

137142
The _lpszProfileName_ parameter is ignored if there is an existing previous session that called MapiLogonEx with the MAPI_ALLOW_OTHERS flag set and if the flag MAPI_NEW_SESSION is not set. If the _lpszProfileName_ parameter is NULL or points to an empty string, and the _flFlags_ parameter includes the MAPI_LOGON_UI flag, the MAPILogonEx function generates a logon dialog box that has an empty field for the profile name.
138-
143+
139144
When logging on to a specific profile, a client should pass the MAPI_NEW_SESSION flag into MAPILogonEx in addition to the profile name. Otherwise, if another client has established a shared session by logging on with MAPI_ALLOW_OTHERS, the client will be logged on to the shared session instead of to the profile requested.
140145

141146
The MAPI_EXPLICIT_PROFILE flag does not cause the default profile name to be used when _lpszProfileName_ is NULL or empty unless the MAPI_USE_DEFAULT flag is also present.

0 commit comments

Comments
 (0)