Skip to content

Commit 533debe

Browse files
Steve WhiteSteve White
authored andcommitted
Merged PR 21614: New APIs in appmodel dot aitch
New APIs in appmodel dot aitch
1 parent ac65ad4 commit 533debe

File tree

4 files changed

+166
-14
lines changed

4 files changed

+166
-14
lines changed

sdk-api-src/content/appmodel/ne-appmodel-addpackagedependencyoptions.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22
UID: NE:appmodel.AddPackageDependencyOptions
3-
tech.root: appxpkg
43
title: AddPackageDependencyOptions
4+
description: Defines options that can be applied when adding a package dependency.
55
ms.date: 7/12/2021
6+
tech.root: appxpkg
67
targetos: Windows
7-
description: Defines options that can be applied when adding a package dependency.
88
prerelease: false
99
req.construct-type: enumeration
1010
req.ddi-compliance:
@@ -44,10 +44,10 @@ No options are applied.
4444

4545
### -field AddPackageDependencyOptions_PrependIfRankCollision
4646

47-
If multiple packages are present in the package graph with the same rank as the call to **AddPackageDependency**, the resolved package is added before others of the same rank. For more information, see [AddPackageDependency](nf-appmodel-addpackagedependency.md).
47+
If multiple packages are present in the package graph with the same rank as the call to [AddPackageDependency](./nf-appmodel-addpackagedependency.md), then the resolved package is added before others of the same rank. For more info, see **AddPackageDependency**.
4848

4949
## -remarks
5050

5151
## -see-also
5252

53-
[AddPackageDependency](nf-appmodel-addpackagedependency.md)
53+
[AddPackageDependency](./nf-appmodel-addpackagedependency.md)
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
UID: NE:appmodel.AddPackageDependencyOptions2
3+
title: AddPackageDependencyOptions2
4+
description: Defines options (version 2) that can be applied when adding a package dependency.
5+
ms.date: 02/05/2025
6+
tech.root: appxpkg
7+
targetos: Windows
8+
prerelease: false
9+
req.construct-type: enumeration
10+
req.ddi-compliance:
11+
req.header: appmodel.h
12+
req.include-header:
13+
req.kmdf-ver:
14+
req.max-support:
15+
req.target-min-winverclnt: Windows 11, version 23H2 (10.0; Build 22631)
16+
req.target-min-winversvr:
17+
req.target-type:
18+
req.typenames:
19+
req.umdf-ver:
20+
topic_type:
21+
- apiref
22+
api_type:
23+
- HeaderDef
24+
api_location:
25+
- appmodel.h
26+
api_name:
27+
- AddPackageDependencyOptions2
28+
f1_keywords:
29+
- AddPackageDependencyOptions2
30+
- appmodel/AddPackageDependencyOptions2
31+
dev_langs:
32+
- c++
33+
---
34+
35+
## -description
36+
37+
Defines options (version 2) that can be applied when adding a run-time reference to a framework package by using the [AddPackageDependency2](./nf-appmodel-addpackagedependency2.md) function.
38+
39+
## -enum-fields
40+
41+
### -field AddPackageDependencyOptions2_None
42+
43+
No options are applied.
44+
45+
### -field AddPackageDependencyOptions2_PrependIfRankCollision
46+
47+
If multiple packages are present in the package graph with the same rank as the call to [AddPackageDependency2](./nf-appmodel-addpackagedependency2.md), then the resolved package is added before others of the same rank. For more info, see **AddPackageDependency2**.
48+
49+
### -field AddPackageDependencyOptions2_SpecifiedPackageFamilyOnly
50+
51+
Adds only the target package's family to the package graph. This provides you a way to more surgically manage your dependencies at runtime.
52+
53+
A Framework package can't declare dependencies in the Framework's manifest (that is, Framework package's dependency list is always a size of 1—`[TheFrameworkPackage]`. **AddPackageDependency2** targeting a Framework package adds only the target to the caller's package graph; a Framework package has declared dependencies. Thus targeting Framework packages avoids the need to restrict dynamic dependencies to the target's package family, but Framework packages can't replace Main packages for dynamic use because there are some things that only a Main package can do (for example, Packaged COM OOP Servers, windows.startupTask, and more). Main packages bring this additional indirect packages issue, and thus the need for the *AddPackageDependencyOptions2_SpecifiedPackageFamilyOnly* option, which narrows the scope of **AddPackageDependency2** to only the directly targeted package family.
54+
55+
## -remarks
56+
57+
## -see-also
58+
59+
* [AddPackageDependency2](nf-appmodel-addpackagedependency2.md)

sdk-api-src/content/appmodel/nf-appmodel-addpackagedependency.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
---
22
UID: NF:appmodel.AddPackageDependency
3-
tech.root: appxpkg
43
title: AddPackageDependency
4+
description: Resolves a previously defined PackageDependency to a specific package and adds it to the invoking process' package graph. After the dependency has been added, other code-loading methods (such as LoadLibrary and CoCreateInstance) can find the binaries in the resolved package.
55
ms.date: 7/12/2021
6+
tech.root: appxpkg
67
targetos: Windows
7-
description: Resolves a previously defined PackageDependency to a specific package and adds it to the invoking process' package graph. After the dependency has been added, other code-loading methods (such as LoadLibrary and CoCreateInstance) can find the binaries in the resolved package.
8-
prerelease: false
98
req.assembly:
109
req.construct-type: function
1110
req.ddi-compliance:
@@ -44,6 +43,8 @@ dev_langs:
4443

4544
Adds a run-time reference for the framework package dependency you created earlier by using the [TryCreatePackageDependency](nf-appmodel-trycreatepackagedependency.md) method, with the specified options. After this method successfully returns, your app can activate types and use content from the framework package.
4645

46+
Also see [AddPackageDependency2](nf-appmodel-addpackagedependency2.md).
47+
4748
## -parameters
4849

4950
### -param packageDependencyId
@@ -100,10 +101,6 @@ For more information, see [Use the dynamic dependency API to reference MSIX pack
100101

101102
## -see-also
102103

103-
[RemovePackageDependency](nf-appmodel-removepackagedependency.md)
104-
105-
106-
[TryCreatePackageDependency](nf-appmodel-trycreatepackagedependency.md)
107-
108-
109-
[Use the dynamic dependency API to reference MSIX packages at run time](/windows/apps/desktop/modernize/framework-packages/use-the-dynamic-dependency-api)
104+
* [RemovePackageDependency](./nf-appmodel-removepackagedependency.md)
105+
* [TryCreatePackageDependency](./nf-appmodel-trycreatepackagedependency.md)
106+
* [Use the dynamic dependency API to reference MSIX packages at run time](/windows/apps/desktop/modernize/framework-packages/use-the-dynamic-dependency-api)
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---
2+
UID: NF:appmodel.AddPackageDependency2
3+
title: AddPackageDependency2
4+
description: Resolves a previously defined package dependency to a specific package, and adds it to the invoking process' package graph. After the dependency has been added, other code-loading methods (such as LoadLibrary and CoCreateInstance) can find the binaries in the resolved package.
5+
ms.date: 02/05/2025
6+
tech.root: appxpkg
7+
targetos: Windows
8+
req.assembly:
9+
req.construct-type: function
10+
req.ddi-compliance:
11+
req.dll:
12+
req.header: appmodel.h
13+
req.idl:
14+
req.include-header:
15+
req.irql:
16+
req.kmdf-ver:
17+
req.lib:
18+
req.max-support:
19+
req.namespace:
20+
req.redist:
21+
req.target-min-winverclnt: Windows 11, version 23H2 (10.0; Build 22631)
22+
req.target-min-winversvr:
23+
req.target-type:
24+
req.type-library:
25+
req.umdf-ver:
26+
req.unicode-ansi:
27+
topic_type:
28+
- apiref
29+
api_type:
30+
- HeaderDef
31+
api_location:
32+
- appmodel.h
33+
api_name:
34+
- AddPackageDependency2
35+
f1_keywords:
36+
- AddPackageDependency2
37+
- appmodel/AddPackageDependency2
38+
dev_langs:
39+
- c++
40+
---
41+
42+
## -description
43+
44+
Adds a run-time reference for the framework package dependency you created earlier by using the [TryCreatePackageDependency](./nf-appmodel-trycreatepackagedependency.md) method, with the specified options. After this method successfully returns, your app can activate types and use content from the framework package.
45+
46+
## -parameters
47+
48+
### -param packageDependencyId
49+
50+
Type: <b>PCWSTR</b>
51+
52+
The ID of the package dependency to be resolved and added to the invoking process' package graph. This parameter must match a package dependency defined by using the [TryCreatePackageDependency](nf-appmodel-trycreatepackagedependency.md) function for the calling user or the system (via the [CreatePackageDependencyOptions_ScopeIsSystem](ne-appmodel-createpackagedependencyoptions.md) option), or else an error is returned.
53+
54+
### -param rank
55+
56+
Type: <b>INT32</b>
57+
58+
The rank to use to add the resolved package to the caller's package graph. For more information, see **Remarks**.
59+
60+
### -param options
61+
62+
Type: <b><a href="./ne-appmodel-addpackagedependencyoptions2.md">AddPackageDependencyOptions2</a></b>
63+
64+
The options to apply when adding the package dependency.
65+
66+
### -param packageDependencyContext
67+
68+
Type: <b>PACKAGEDEPENDENCY_CONTEXT*</b>
69+
70+
The handle of the added package dependency. This handle is valid until it is passed to <a href="nf-appmodel-removepackagedependency.md">RemovePackageDependency</a>.
71+
72+
### -param packageFullName
73+
74+
Type: <b>PCWSTR*</b>
75+
76+
When this method returns, contains the address of a pointer to a null-terminated Unicode string that specifies the full name of the package to which the dependency has been resolved. The caller is responsible for freeing this resource once it is no longer needed by calling [HeapFree](/windows/win32/api/heapapi/nf-heapapi-heapfree).
77+
78+
## -returns
79+
80+
Type: <b>HRESULT</b>
81+
82+
If the function succeeds it returns <b>ERROR_SUCCESS</b>. Otherwise, the function returns an error code. The possible error codes include the following.
83+
84+
| Return code | Description |
85+
|-------------|-------------|
86+
| E_INVALIDARG | The *packageDependencyId* or *packageDependencyContext* parameter is NULL on input. |
87+
88+
## -remarks
89+
90+
See **Remarks** for [AddPackageDependency](./nf-appmodel-addpackagedependency.md).
91+
92+
## -see-also
93+
94+
* [RemovePackageDependency](./nf-appmodel-removepackagedependency.md)
95+
* [TryCreatePackageDependency](./nf-appmodel-trycreatepackagedependency.md)
96+
* [Use the dynamic dependency API to reference MSIX packages at run time](/windows/apps/desktop/modernize/framework-packages/use-the-dynamic-dependency-api)

0 commit comments

Comments
 (0)