cache nuget packages
This commit is contained in:
5
local-nuget/ephemeralmongo/3.0.0/.nupkg.metadata
Normal file
5
local-nuget/ephemeralmongo/3.0.0/.nupkg.metadata
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"version": 2,
|
||||
"contentHash": "6Qw78tAIFVxhgO8d4v7Gtw654iWEjbqyt0jBr09PHdiAPgyJcchaKfZyMXyAi5SEqL25kpaY/q+5/XFM8ZtK6A==",
|
||||
"source": "https://api.nuget.org/v3/index.json"
|
||||
}
|
||||
BIN
local-nuget/ephemeralmongo/3.0.0/.signature.p7s
Normal file
BIN
local-nuget/ephemeralmongo/3.0.0/.signature.p7s
Normal file
Binary file not shown.
25
local-nuget/ephemeralmongo/3.0.0/EphemeralMongo.nuspec
Normal file
25
local-nuget/ephemeralmongo/3.0.0/EphemeralMongo.nuspec
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>EphemeralMongo</id>
|
||||
<version>3.0.0</version>
|
||||
<authors>Anthony Simmon</authors>
|
||||
<license type="expression">Apache-2.0</license>
|
||||
<licenseUrl>https://licenses.nuget.org/Apache-2.0</licenseUrl>
|
||||
<readme>README.md</readme>
|
||||
<projectUrl>https://github.com/asimmon/ephemeral-mongo</projectUrl>
|
||||
<description>Provides access to preconfigured MongoDB servers for testing purposes, without Docker or other dependencies.</description>
|
||||
<copyright>Copyright © Anthony Simmon 2025</copyright>
|
||||
<tags>MongoDB Mongo test testing unittest integrationtest</tags>
|
||||
<repository type="git" url="https://github.com/asimmon/ephemeral-mongo" branch="main" commit="1809712ab28adb04ef3c3acbafe522a61143d710" />
|
||||
<dependencies>
|
||||
<group targetFramework="net8.0">
|
||||
<dependency id="MongoDB.Driver" version="3.3.0" exclude="Build,Analyzers" />
|
||||
</group>
|
||||
<group targetFramework=".NETStandard2.1">
|
||||
<dependency id="MongoDB.Driver" version="3.3.0" exclude="Build,Analyzers" />
|
||||
<dependency id="System.Text.Json" version="8.0.5" exclude="Build,Analyzers" />
|
||||
</group>
|
||||
</dependencies>
|
||||
</metadata>
|
||||
</package>
|
||||
205
local-nuget/ephemeralmongo/3.0.0/README.md
Normal file
205
local-nuget/ephemeralmongo/3.0.0/README.md
Normal file
@@ -0,0 +1,205 @@
|
||||
<!-- omit from toc -->
|
||||
# EphemeralMongo
|
||||
|
||||
[](https://github.com/asimmon/ephemeral-mongo/actions/workflows/ci.yml) [](https://github.com/asimmon/ephemeral-mongo/actions/workflows/release.yml)
|
||||
|
||||
- [About](#about)
|
||||
- [Installation](#installation)
|
||||
- [Usage](#usage)
|
||||
- [How it works](#how-it-works)
|
||||
- [MongoDB Enterprise and in-memory storage engine](#mongodb-enterprise-and-in-memory-storage-engine)
|
||||
- [Windows Defender Firewall prompt](#windows-defender-firewall-prompt)
|
||||
- [Reusing runners across tests](#reusing-runners-across-tests)
|
||||
- [Changelog](#changelog)
|
||||
|
||||
## About
|
||||
|
||||
**EphemeralMongo** is a .NET library that provides a simple way to run temporary and disposable MongoDB servers for integration tests and local debugging, without any dependencies or external tools. It is as simple as:
|
||||
|
||||
```csharp
|
||||
using var runner = await MongoRunner.RunAsync();
|
||||
Console.WriteLine(runner.ConnectionString);
|
||||
```
|
||||
|
||||
Use the resulting connection string to access the MongoDB server. It will automatically be stopped and cleaned up when the `runner` is disposed. You can pass options to customize the server, such as the data directory, port, and replica set configuration. More details can be found in the [usage section](#usage).
|
||||
|
||||
List of features and capabilities:
|
||||
|
||||
- Multiple ephemeral and **isolated MongoDB databases** for running tests.
|
||||
- A quick way to set up a MongoDB database for a local development environment.
|
||||
- Access to **MongoDB 6**, **7**, and **8**.
|
||||
- Access to **MongoDB Community** and **Enterprise editions**.
|
||||
- Support for **single-node replica sets**, enabling transactions and change streams.
|
||||
- _mongoexport_ and _mongoimport_ tools for [exporting](https://www.mongodb.com/docs/database-tools/mongoexport/) and [importing](https://docs.mongodb.com/database-tools/mongoimport/) collections.
|
||||
- Support for .NET Standard 2.0, .NET Standard 2.1, .NET 8.0 and later.
|
||||
- Support for Linux, macOS, and Windows.
|
||||
- Supports **MongoDB C# driver version 2.x and 3.x**.
|
||||
|
||||
This project follows in the footsteps of [Mongo2Go](https://github.com/Mongo2Go/Mongo2Go) and expands upon its foundation.
|
||||
|
||||
## Installation
|
||||
|
||||
| Package | Description |
|
||||
| --- | --- |
|
||||
| [](https://www.nuget.org/packages/EphemeralMongo/) | Install this package if you use MongoDB C# driver version 3.x. |
|
||||
| [](https://www.nuget.org/packages/EphemeralMongo.v2/) | Install this package if you use MongoDB C# driver version 2.x. |
|
||||
|
||||
## Usage
|
||||
|
||||
Use `MongoRunner.RunAsync()` or `MongoRunner.Run()` methods to create a disposable instance that provides access to a **MongoDB connection string**, **import**, and **export tools**. An optional `MongoRunnerOptions` parameter can be provided to customize the MongoDB server.
|
||||
|
||||
```csharp
|
||||
// All the following properties are OPTIONAL.
|
||||
var options = new MongoRunnerOptions
|
||||
{
|
||||
// The desired MongoDB version to download and use.
|
||||
// Possible values are V6, V7 and V8. Default is V8.
|
||||
Version = MongoVersion.V8,
|
||||
|
||||
// The desired MongoDB edition to download and use.
|
||||
// Possible values are Community and Enterprise. Default is Community.
|
||||
Edition = MongoEdition.Community,
|
||||
|
||||
// If true, the MongoDB server will run as a single-node replica set. Default is false.
|
||||
UseSingleNodeReplicaSet = true,
|
||||
|
||||
// Additional arguments to pass to the MongoDB server. Default is null.
|
||||
AdditionalArguments = ["--quiet"],
|
||||
|
||||
// The port on which the MongoDB server will listen.
|
||||
// Default is null, which means a random available port will be assigned.
|
||||
MongoPort = 27017,
|
||||
|
||||
// The directory where the MongoDB server will store its data.
|
||||
// Default is null, which means a temporary directory will be created.
|
||||
DataDirectory = "/path/to/data/",
|
||||
|
||||
// Provide your own MongoDB binaries in this directory.
|
||||
// Default is null, which means the library will download them automatically.
|
||||
BinaryDirectory = "/path/to/mongo/bin/",
|
||||
|
||||
// A delegate that receives the MongoDB server's standard output.
|
||||
StandardOutputLogger = Console.WriteLine,
|
||||
|
||||
// A delegate that receives the MongoDB server's standard error output.
|
||||
StandardErrorLogger = Console.WriteLine,
|
||||
|
||||
// Timeout for the MongoDB server to start. Default is 30 seconds.
|
||||
ConnectionTimeout = TimeSpan.FromSeconds(10),
|
||||
|
||||
// Timeout for the replica set to be initialized. Default is 10 seconds.
|
||||
ReplicaSetSetupTimeout = TimeSpan.FromSeconds(5),
|
||||
|
||||
// The duration for which temporary data directories will be kept.
|
||||
// Ignored when you provide your own data directory. Default is 12 hours.
|
||||
DataDirectoryLifetime = TimeSpan.FromDays(1),
|
||||
|
||||
// Override this property to provide your own HTTP transport.
|
||||
// Useful when behind a proxy or firewall. Default is a shared reusable instance.
|
||||
Transport = new HttpTransport(new HttpClient()),
|
||||
|
||||
// Delay before checking for a new version of the MongoDB server. Default is 1 day.
|
||||
NewVersionCheckTimeout = TimeSpan.FromDays(2)
|
||||
};
|
||||
```
|
||||
|
||||
```csharp
|
||||
// Disposing the runner will kill the MongoDB process (mongod) and delete the associated data directory
|
||||
using (await var runner = MongoRunner.RunAsync(options))
|
||||
{
|
||||
var database = new MongoClient(runner.ConnectionString).GetDatabase("default");
|
||||
|
||||
// Do something with the database
|
||||
database.CreateCollection("people");
|
||||
|
||||
// Export a collection to a file. A synchronous version is also available.
|
||||
await runner.ExportAsync("default", "people", "/path/to/default.json");
|
||||
|
||||
// Import a collection from a file. A synchronous version is also available.
|
||||
await runner.ImportAsync("default", "people", "/path/to/default.json");
|
||||
}
|
||||
```
|
||||
|
||||
## How it works
|
||||
|
||||
* At runtime, the MongoDB binaries (`mongod`, `mongoimport`, and `mongoexport`) are downloaded when needed (if not already present) and extracted to your local application data directory.
|
||||
* Official download links are retrieved from [this JSON file](https://downloads.mongodb.org/current.json) for the server and [this JSON file](https://downloads.mongodb.org/tools/db/release.json) for the tools.
|
||||
* SHA256 checksums are used to verify the integrity of the downloaded files.
|
||||
* `MongoRunner.Run` or `MongoRunner.RunAsync` always starts a new `mongod` process with a random available port.
|
||||
* The resulting connection string will depend on your options (`UseSingleNodeReplicaSet`).
|
||||
* By default, a unique temporary data directory is used and deleted when the `runner` is disposed.
|
||||
|
||||
## MongoDB Enterprise and in-memory storage engine
|
||||
|
||||
Make sure you are allowed to use MongoDB Enterprise binaries in your projects. The [official download page](https://www.mongodb.com/try/download/enterprise) states:
|
||||
|
||||
> MongoDB Enterprise Server is also available free of charge for evaluation and development purposes.
|
||||
|
||||
The Enterprise edition provides access to the in-memory storage engine, which is faster and more efficient for tests:
|
||||
|
||||
```csharp
|
||||
var options = new MongoRunnerOptions
|
||||
{
|
||||
Edition = MongoEdition.Enterprise,
|
||||
AdditionalArguments = ["--storageEngine", "inMemory"],
|
||||
};
|
||||
|
||||
using var runner = await MongoRunner.RunAsync(options);
|
||||
// [...]
|
||||
```
|
||||
|
||||
## Windows Defender Firewall prompt
|
||||
|
||||
On Windows, you might get a **Windows Defender Firewall prompt**.
|
||||
This is because EphemeralMongo starts the `mongod.exe` process from your local app data directory, and `mongod.exe` tries to open an available port.
|
||||
|
||||
## Reusing runners across tests
|
||||
|
||||
Avoid calling `MongoRunner.Run` or `MongoRunner.RunAsync` concurrently, as this will create many `mongod` processes and make your operating system slower. Instead, try to use a single instance and reuse it - create as many databases as you need, one per test, for example.
|
||||
|
||||
For this, version 3.0.0 introduces a new *experimental* `PooledMongoRunner` class. Once created, you can rent and return `MongoRunner` instances. Once rented a certain number of times, new instances will be created. This way, `mongod` processes will be reused, but not too often. This will avoid uncontrolled usage of system resources.
|
||||
|
||||
```csharp
|
||||
var options = new MongoRunnerOptions
|
||||
{
|
||||
Version = MongoVersion.V7,
|
||||
UseSingleNodeReplicaSet = true
|
||||
};
|
||||
|
||||
using var pool = new MongoRunnerPool(options);
|
||||
|
||||
var runner1 = await pool.RentAsync();
|
||||
var runner2 = await pool.RentAsync();
|
||||
|
||||
try
|
||||
{
|
||||
// Same connection string, same mongod process
|
||||
Console.WriteLine(runner1.ConnectionString);
|
||||
Console.WriteLine(runner2.ConnectionString);
|
||||
}
|
||||
finally
|
||||
{
|
||||
pool.Return(runner1);
|
||||
pool.Return(runner2);
|
||||
}
|
||||
|
||||
// This is a new mongod process
|
||||
var runner3 = await pool.RentAsync();
|
||||
```
|
||||
|
||||
## Changelog
|
||||
|
||||
### 3.0.0
|
||||
|
||||
See [this announcement](https://github.com/asimmon/ephemeral-mongo/issues/80).
|
||||
|
||||
### 2.0.0
|
||||
|
||||
- **Breaking change**: Support for MongoDB 5.0 and 6.0 has been removed, as their [end-of-life](https://www.mongodb.com/legal/support-policy/lifecycles) has passed.
|
||||
- **Breaking change**: arm64 is now the default target for macOS. The previous target was x64.
|
||||
- **Breaking change**: The Linux runtime package now uses Ubuntu 22.04's MongoDB binaries instead of the 18.04 ones. OpenSSL 3.0 is now required.
|
||||
- **Breaking change**: Updated the MongoDB C# driver to 2.28.0, [which now uses strong-named assemblies](https://www.mongodb.com/community/forums/t/net-driver-2-28-0-released/289745).
|
||||
- Added support for MongoDB 8.0.
|
||||
- Introduced data directory management to delete old data directories automatically.
|
||||
- Use direct connection in replica set connection strings.
|
||||
- Fixed the spelling issue in `MongoRunnerOptions.StandardOutputLogger`.
|
||||
BIN
local-nuget/ephemeralmongo/3.0.0/ephemeralmongo.3.0.0.nupkg
Normal file
BIN
local-nuget/ephemeralmongo/3.0.0/ephemeralmongo.3.0.0.nupkg
Normal file
Binary file not shown.
@@ -0,0 +1 @@
|
||||
CUOYnTMKKvdqEBXMQZ+Xxn46KgKOnMV9gnXnGDQ7qbTfHLafyv4lxYd73HimfWhBw6d6xQ3AvTUMfePGXAHNAQ==
|
||||
331
local-nuget/ephemeralmongo/3.0.0/lib/net8.0/EphemeralMongo.xml
Normal file
331
local-nuget/ephemeralmongo/3.0.0/lib/net8.0/EphemeralMongo.xml
Normal file
@@ -0,0 +1,331 @@
|
||||
<?xml version="1.0"?>
|
||||
<doc>
|
||||
<assembly>
|
||||
<name>EphemeralMongo</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="P:EphemeralMongo.MongoRunnerOptions.Version">
|
||||
<summary>
|
||||
The desired MongoDB version to download and use.
|
||||
</summary>
|
||||
<exception cref="T:System.ArgumentOutOfRangeException">The version is not supported.</exception>
|
||||
</member>
|
||||
<member name="P:EphemeralMongo.MongoRunnerOptions.Edition">
|
||||
<summary>
|
||||
The desired MongoDB edition to download and use.
|
||||
</summary>
|
||||
<exception cref="T:System.ArgumentOutOfRangeException">The edition is not supported.</exception>
|
||||
</member>
|
||||
<member name="P:EphemeralMongo.MongoRunnerOptions.DataDirectory">
|
||||
<summary>
|
||||
The directory where the mongod instance stores its data. If not specified, a temporary directory will be used.
|
||||
</summary>
|
||||
<exception cref="T:System.ArgumentException">The path is invalid.</exception>
|
||||
<seealso href="https://www.mongodb.com/docs/manual/reference/program/mongod/#std-option-mongod.--dbpath"/>
|
||||
</member>
|
||||
<member name="P:EphemeralMongo.MongoRunnerOptions.BinaryDirectory">
|
||||
<summary>
|
||||
The directory where your own MongoDB binaries can be found (mongod, mongoexport and mongoimport).
|
||||
</summary>
|
||||
<exception cref="T:System.ArgumentException">The path is invalid.</exception>
|
||||
</member>
|
||||
<member name="P:EphemeralMongo.MongoRunnerOptions.AdditionalArguments">
|
||||
<summary>
|
||||
Additional mongod CLI arguments.
|
||||
</summary>
|
||||
<seealso href="https://www.mongodb.com/docs/manual/reference/program/mongod/#options"/>
|
||||
</member>
|
||||
<member name="P:EphemeralMongo.MongoRunnerOptions.ConnectionTimeout">
|
||||
<summary>
|
||||
Maximum timespan to wait for mongod process to be ready to accept connections.
|
||||
</summary>
|
||||
<exception cref="T:System.ArgumentOutOfRangeException">The timeout cannot be negative.</exception>
|
||||
</member>
|
||||
<member name="P:EphemeralMongo.MongoRunnerOptions.UseSingleNodeReplicaSet">
|
||||
<summary>
|
||||
Whether to create a single node replica set or use a standalone mongod instance.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:EphemeralMongo.MongoRunnerOptions.ReplicaSetSetupTimeout">
|
||||
<summary>
|
||||
Maximum timespan to wait for the replica set to accept database writes.
|
||||
</summary>
|
||||
<exception cref="T:System.ArgumentOutOfRangeException">The timeout cannot be negative.</exception>
|
||||
</member>
|
||||
<member name="P:EphemeralMongo.MongoRunnerOptions.StandardOutputLogger">
|
||||
<summary>
|
||||
A delegate that provides access to any MongodDB-related process standard output.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:EphemeralMongo.MongoRunnerOptions.StandardErrorLogger">
|
||||
<summary>
|
||||
A delegate that provides access to any MongodDB-related process error output.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:EphemeralMongo.MongoRunnerOptions.MongoPort">
|
||||
<summary>
|
||||
The mongod port to use. If not specified, a random available port will be used.
|
||||
</summary>
|
||||
<exception cref="T:System.ArgumentOutOfRangeException">The port must be greater than zero.</exception>
|
||||
</member>
|
||||
<member name="P:EphemeralMongo.MongoRunnerOptions.DataDirectoryLifetime">
|
||||
<summary>
|
||||
The lifetime of data directories that are automatically created when they are not specified by the user.
|
||||
When their age exceeds this value, they will be deleted on the next run of MongoRunner.
|
||||
</summary>
|
||||
<exception cref="T:System.ArgumentOutOfRangeException">The lifetime cannot be negative.</exception>
|
||||
</member>
|
||||
<member name="P:EphemeralMongo.MongoRunnerOptions.Transport">
|
||||
<summary>
|
||||
The HTTP transport to use for downloading MongoDB binaries and MongoDB release information.
|
||||
</summary>
|
||||
<exception cref="T:System.ArgumentNullException"></exception>
|
||||
</member>
|
||||
<member name="P:EphemeralMongo.MongoRunnerOptions.NewVersionCheckTimeout">
|
||||
<summary>
|
||||
The maximum timespan to wait before checking for a newer version of MongoDB binaries.
|
||||
</summary>
|
||||
<exception cref="T:System.ArgumentOutOfRangeException">The timeout cannot be negative.</exception>
|
||||
</member>
|
||||
<member name="T:Windows.Win32.Foundation.PCWSTR">
|
||||
<summary>
|
||||
A pointer to a null-terminated, constant character string.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.Foundation.PCWSTR.Value">
|
||||
<summary>
|
||||
A pointer to the first character in the string. The content should be considered readonly, as it was typed as constant in the SDK.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Windows.Win32.Foundation.PCWSTR.Length">
|
||||
<summary>
|
||||
Gets the number of characters up to the first null character (exclusive).
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Windows.Win32.Foundation.PCWSTR.ToString">
|
||||
<summary>
|
||||
Returns a <see langword="string"/> with a copy of this character array, up to the first null character (exclusive).
|
||||
</summary>
|
||||
<returns>A <see langword="string"/>, or <see langword="null"/> if <see cref="F:Windows.Win32.Foundation.PCWSTR.Value"/> is <see langword="null"/>.</returns>
|
||||
</member>
|
||||
<member name="M:Windows.Win32.Foundation.PCWSTR.AsSpan">
|
||||
<summary>
|
||||
Returns a span of the characters in this string, up to the first null character (exclusive).
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Windows.Win32.System.Threading.IO_COUNTERS">
|
||||
<summary>Contains I/O accounting information for a process or a job object.</summary>
|
||||
<remarks>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/winnt/ns-winnt-io_counters">Learn more about this API from docs.microsoft.com</see>.</para>
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.Threading.IO_COUNTERS.ReadOperationCount">
|
||||
<summary>The number of read operations performed.</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.Threading.IO_COUNTERS.WriteOperationCount">
|
||||
<summary>The number of write operations performed.</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.Threading.IO_COUNTERS.OtherOperationCount">
|
||||
<summary>The number of I/O operations performed, other than read and write operations.</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.Threading.IO_COUNTERS.ReadTransferCount">
|
||||
<summary>The number of bytes read.</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.Threading.IO_COUNTERS.WriteTransferCount">
|
||||
<summary>The number of bytes written.</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.Threading.IO_COUNTERS.OtherTransferCount">
|
||||
<summary>The number of bytes transferred during operations other than read and write operations.</summary>
|
||||
</member>
|
||||
<member name="T:Windows.Win32.System.JobObjects.JOBOBJECT_BASIC_LIMIT_INFORMATION">
|
||||
<summary>Contains basic limit information for a job object.</summary>
|
||||
<remarks>
|
||||
<para>Processes can still empty their working sets using the <a href="https://docs.microsoft.com/windows/win32/api/memoryapi/nf-memoryapi-setprocessworkingsetsize">SetProcessWorkingSetSize</a> function with (<b>SIZE_T</b>)-1, even when <b>JOB_OBJECT_LIMIT_WORKINGSET</b> is used. However, you cannot use <b>SetProcessWorkingSetSize</b> change the minimum or maximum working set size of a process in a job object. The system increments the active process count when you attempt to associate a process with a job. If the limit is exceeded, the system decrements the active process count only when the process terminates and all handles to the process are closed. Therefore, if you have an open handle to a process that has been terminated in such a manner, you cannot associate any new processes until the handle is closed and the active process count is below the limit.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/winnt/ns-winnt-jobobject_basic_limit_information#">Read more on docs.microsoft.com</see>.</para>
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.JobObjects.JOBOBJECT_BASIC_LIMIT_INFORMATION.PerProcessUserTimeLimit">
|
||||
<summary>
|
||||
<para>If <b>LimitFlags</b> specifies <b>JOB_OBJECT_LIMIT_PROCESS_TIME</b>, this member is the per-process user-mode execution time limit, in 100-nanosecond ticks. Otherwise, this member is ignored.</para>
|
||||
<para>The system periodically checks to determine whether each process associated with the job has accumulated more user-mode time than the set limit. If it has, the process is terminated. If the job is nested, the effective limit is the most restrictive limit in the job chain.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/winnt/ns-winnt-jobobject_basic_limit_information#members">Read more on docs.microsoft.com</see>.</para>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.JobObjects.JOBOBJECT_BASIC_LIMIT_INFORMATION.PerJobUserTimeLimit">
|
||||
<summary>
|
||||
<para>If <b>LimitFlags</b> specifies <b>JOB_OBJECT_LIMIT_JOB_TIME</b>, this member is the per-job user-mode execution time limit, in 100-nanosecond ticks. Otherwise, this member is ignored.</para>
|
||||
<para>The system adds the current time of the processes associated with the job to this limit. For example, if you set this limit to 1 minute, and the job has a process that has accumulated 5 minutes of user-mode time, the limit actually enforced is 6 minutes. The system periodically checks to determine whether the sum of the user-mode execution time for all processes is greater than this end-of-job limit. If it is, the action specified in the <b>EndOfJobTimeAction</b> member of the <a href="https://docs.microsoft.com/windows/desktop/api/winnt/ns-winnt-jobobject_end_of_job_time_information">JOBOBJECT_END_OF_JOB_TIME_INFORMATION</a> structure is carried out. By default, all processes are terminated and the status code is set to <b>ERROR_NOT_ENOUGH_QUOTA</b>. To register for notification when this limit is exceeded without terminating processes, use the <a href="https://docs.microsoft.com/windows/desktop/api/jobapi2/nf-jobapi2-setinformationjobobject">SetInformationJobObject</a> function with the <b>JobObjectNotificationLimitInformation</b> information class.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/winnt/ns-winnt-jobobject_basic_limit_information#members">Read more on docs.microsoft.com</see>.</para>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.JobObjects.JOBOBJECT_BASIC_LIMIT_INFORMATION.LimitFlags">
|
||||
<summary></summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.JobObjects.JOBOBJECT_BASIC_LIMIT_INFORMATION.MinimumWorkingSetSize">
|
||||
<summary>
|
||||
<para>If <b>LimitFlags</b> specifies <b>JOB_OBJECT_LIMIT_WORKINGSET</b>, this member is the minimum working set size in bytes for each process associated with the job. Otherwise, this member is ignored. If <b>MaximumWorkingSetSize</b> is nonzero, <b>MinimumWorkingSetSize</b> cannot be zero.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/winnt/ns-winnt-jobobject_basic_limit_information#members">Read more on docs.microsoft.com</see>.</para>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.JobObjects.JOBOBJECT_BASIC_LIMIT_INFORMATION.MaximumWorkingSetSize">
|
||||
<summary>
|
||||
<para>If <b>LimitFlags</b> specifies <b>JOB_OBJECT_LIMIT_WORKINGSET</b>, this member is the maximum working set size in bytes for each process associated with the job. Otherwise, this member is ignored. If <b>MinimumWorkingSetSize</b> is nonzero, <b>MaximumWorkingSetSize</b> cannot be zero.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/winnt/ns-winnt-jobobject_basic_limit_information#members">Read more on docs.microsoft.com</see>.</para>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.JobObjects.JOBOBJECT_BASIC_LIMIT_INFORMATION.ActiveProcessLimit">
|
||||
<summary>
|
||||
<para>If <b>LimitFlags</b> specifies <b>JOB_OBJECT_LIMIT_ACTIVE_PROCESS</b>, this member is the active process limit for the job. Otherwise, this member is ignored. If you try to associate a process with a job, and this causes the active process count to exceed this limit, the process is terminated and the association fails.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/winnt/ns-winnt-jobobject_basic_limit_information#members">Read more on docs.microsoft.com</see>.</para>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.JobObjects.JOBOBJECT_BASIC_LIMIT_INFORMATION.Affinity">
|
||||
<summary>
|
||||
<para>If <b>LimitFlags</b> specifies <b>JOB_OBJECT_LIMIT_AFFINITY</b>, this member is the processor affinity for all processes associated with the job. Otherwise, this member is ignored. The affinity must be a subset of the system affinity mask obtained by calling the <a href="https://docs.microsoft.com/windows/desktop/api/winbase/nf-winbase-getprocessaffinitymask">GetProcessAffinityMask</a> function. The affinity of each thread is set to this value, but threads are free to subsequently set their affinity, as long as it is a subset of the specified affinity mask. Processes cannot set their own affinity mask.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/winnt/ns-winnt-jobobject_basic_limit_information#members">Read more on docs.microsoft.com</see>.</para>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.JobObjects.JOBOBJECT_BASIC_LIMIT_INFORMATION.PriorityClass">
|
||||
<summary>
|
||||
<para>If <b>LimitFlags</b> specifies <b>JOB_OBJECT_LIMIT_PRIORITY_CLASS</b>, this member is the priority class for all processes associated with the job. Otherwise, this member is ignored. Processes and threads cannot modify their priority class. The calling process must enable the <b>SE_INC_BASE_PRIORITY_NAME</b> privilege.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/winnt/ns-winnt-jobobject_basic_limit_information#members">Read more on docs.microsoft.com</see>.</para>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.JobObjects.JOBOBJECT_BASIC_LIMIT_INFORMATION.SchedulingClass">
|
||||
<summary>
|
||||
<para>If <b>LimitFlags</b> specifies <b>JOB_OBJECT_LIMIT_SCHEDULING_CLASS</b>, this member is the scheduling class for all processes associated with the job. Otherwise, this member is ignored. The valid values are 0 to 9. Use 0 for the least favorable scheduling class relative to other threads, and 9 for the most favorable scheduling class relative to other threads. By default, this value is 5. To use a scheduling class greater than 5, the calling process must enable the <b>SE_INC_BASE_PRIORITY_NAME</b> privilege.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/winnt/ns-winnt-jobobject_basic_limit_information#members">Read more on docs.microsoft.com</see>.</para>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Windows.Win32.System.JobObjects.JOBOBJECT_EXTENDED_LIMIT_INFORMATION">
|
||||
<summary>Contains basic and extended limit information for a job object.</summary>
|
||||
<remarks>
|
||||
<para>The system tracks the value of <b>PeakProcessMemoryUsed</b> and <b>PeakJobMemoryUsed</b> constantly. This allows you know the peak memory usage of each job. You can use this information to establish a memory limit using the <b>JOB_OBJECT_LIMIT_PROCESS_MEMORY</b> or <b>JOB_OBJECT_LIMIT_JOB_MEMORY</b> value. Note that the job memory and process memory limits are very similar in operation, but they are independent. You could set a job-wide limit of 100 MB with a per-process limit of 10 MB. In this scenario, no single process could commit more than 10 MB, and the set of processes associated with a job could never exceed 100 MB. To register for notifications that a job has exceeded its peak memory limit while allowing processes to continue to commit memory, use the <a href="https://docs.microsoft.com/windows/desktop/api/jobapi2/nf-jobapi2-setinformationjobobject">SetInformationJobObject</a> function with the <b>JobObjectNotificationLimitInformation</b> information class.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/winnt/ns-winnt-jobobject_extended_limit_information#">Read more on docs.microsoft.com</see>.</para>
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.JobObjects.JOBOBJECT_EXTENDED_LIMIT_INFORMATION.BasicLimitInformation">
|
||||
<summary>
|
||||
<para>A <a href="https://docs.microsoft.com/windows/desktop/api/winnt/ns-winnt-jobobject_basic_limit_information">JOBOBJECT_BASIC_LIMIT_INFORMATION</a> structure that contains basic limit information.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/winnt/ns-winnt-jobobject_extended_limit_information#members">Read more on docs.microsoft.com</see>.</para>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.JobObjects.JOBOBJECT_EXTENDED_LIMIT_INFORMATION.IoInfo">
|
||||
<summary>Reserved.</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.JobObjects.JOBOBJECT_EXTENDED_LIMIT_INFORMATION.ProcessMemoryLimit">
|
||||
<summary>
|
||||
<para>If the <b>LimitFlags</b> member of the <a href="https://docs.microsoft.com/windows/desktop/api/winnt/ns-winnt-jobobject_basic_limit_information">JOBOBJECT_BASIC_LIMIT_INFORMATION</a> structure specifies the <b>JOB_OBJECT_LIMIT_PROCESS_MEMORY</b> value, this member specifies the limit for the virtual memory that can be committed by a process. Otherwise, this member is ignored.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/winnt/ns-winnt-jobobject_extended_limit_information#members">Read more on docs.microsoft.com</see>.</para>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.JobObjects.JOBOBJECT_EXTENDED_LIMIT_INFORMATION.JobMemoryLimit">
|
||||
<summary>
|
||||
<para>If the <b>LimitFlags</b> member of the <a href="https://docs.microsoft.com/windows/desktop/api/winnt/ns-winnt-jobobject_basic_limit_information">JOBOBJECT_BASIC_LIMIT_INFORMATION</a> structure specifies the <b>JOB_OBJECT_LIMIT_JOB_MEMORY</b> value, this member specifies the limit for the virtual memory that can be committed for the job. Otherwise, this member is ignored.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/winnt/ns-winnt-jobobject_extended_limit_information#members">Read more on docs.microsoft.com</see>.</para>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.JobObjects.JOBOBJECT_EXTENDED_LIMIT_INFORMATION.PeakProcessMemoryUsed">
|
||||
<summary>The peak memory used by any process ever associated with the job.</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.JobObjects.JOBOBJECT_EXTENDED_LIMIT_INFORMATION.PeakJobMemoryUsed">
|
||||
<summary>The peak memory usage of all processes currently associated with the job.</summary>
|
||||
</member>
|
||||
<member name="T:Windows.Win32.PInvoke">
|
||||
<content>
|
||||
Contains extern methods from "KERNEL32.dll".
|
||||
</content>
|
||||
</member>
|
||||
<member name="M:Windows.Win32.PInvoke.CloseHandle(Windows.Win32.Foundation.HANDLE)">
|
||||
<summary>Closes an open object handle.</summary>
|
||||
<param name="hObject">A valid handle to an open object.</param>
|
||||
<returns>
|
||||
<para>If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call <a href="https://docs.microsoft.com/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror">GetLastError</a>. If the application is running under a debugger, the function will throw an exception if it receives either a handle value that is not valid or a pseudo-handle value. This can happen if you close a handle twice, or if you call <b>CloseHandle</b> on a handle returned by the <a href="https://docs.microsoft.com/windows/desktop/api/fileapi/nf-fileapi-findfirstfilea">FindFirstFile</a> function instead of calling the <a href="https://docs.microsoft.com/windows/desktop/api/fileapi/nf-fileapi-findclose">FindClose</a> function.</para>
|
||||
</returns>
|
||||
<remarks>
|
||||
<para>The <b>CloseHandle</b> function closes handles to the following objects: </para>
|
||||
<para>This doc was truncated.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/handleapi/nf-handleapi-closehandle#">Read more on docs.microsoft.com</see>.</para>
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="M:Windows.Win32.PInvoke.CreateJobObject(System.Nullable{Windows.Win32.Security.SECURITY_ATTRIBUTES},System.String)">
|
||||
<inheritdoc cref="M:Windows.Win32.PInvoke.CreateJobObject(Windows.Win32.Security.SECURITY_ATTRIBUTES*,Windows.Win32.Foundation.PCWSTR)"/>
|
||||
</member>
|
||||
<member name="M:Windows.Win32.PInvoke.CreateJobObject(Windows.Win32.Security.SECURITY_ATTRIBUTES*,Windows.Win32.Foundation.PCWSTR)">
|
||||
<summary>Creates or opens a job object. (CreateJobObjectW)</summary>
|
||||
<param name="lpJobAttributes">
|
||||
<para>A pointer to a <a href="https://docs.microsoft.com/previous-versions/windows/desktop/legacy/aa379560(v=vs.85)">SECURITY_ATTRIBUTES</a> structure that specifies the security descriptor for the job object and determines whether child processes can inherit the returned handle. If <i>lpJobAttributes</i> is <b>NULL</b>, the job object gets a default security descriptor and the handle cannot be inherited. The ACLs in the default security descriptor for a job object come from the primary or impersonation token of the creator.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/jobapi2/nf-jobapi2-createjobobjectw#parameters">Read more on docs.microsoft.com</see>.</para>
|
||||
</param>
|
||||
<param name="lpName">
|
||||
<para>The name of the job. The name is limited to <b>MAX_PATH</b> characters. Name comparison is case-sensitive.</para>
|
||||
<para>If <i>lpName</i> is <b>NULL</b>, the job is created without a name. If <i>lpName</i> matches the name of an existing event, semaphore, mutex, waitable timer, or file-mapping object, the function fails and the <a href="https://docs.microsoft.com/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror">GetLastError</a> function returns <b>ERROR_INVALID_HANDLE</b>. This occurs because these objects share the same namespace. The object can be created in a private namespace. For more information, see <a href="https://docs.microsoft.com/windows/desktop/Sync/object-namespaces">Object Namespaces</a>. <b>Terminal Services: </b>The name can have a "Global\\" or "Local\\" prefix to explicitly create the object in the global or session namespace. The remainder of the name can contain any character except the backslash character (\\). For more information, see <a href="https://docs.microsoft.com/windows/desktop/TermServ/kernel-object-namespaces">Kernel Object Namespaces</a>.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/jobapi2/nf-jobapi2-createjobobjectw#parameters">Read more on docs.microsoft.com</see>.</para>
|
||||
</param>
|
||||
<returns>
|
||||
<para>If the function succeeds, the return value is a handle to the job object. The handle has the <b>JOB_OBJECT_ALL_ACCESS</b> access right. If the object existed before the function call, the function returns a handle to the existing job object and <a href="https://docs.microsoft.com/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror">GetLastError</a> returns <b>ERROR_ALREADY_EXISTS</b>. If the function fails, the return value is NULL. To get extended error information, call <a href="https://docs.microsoft.com/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror">GetLastError</a>.</para>
|
||||
</returns>
|
||||
<remarks>
|
||||
<para>When a job is created, its accounting information is initialized to zero, all limits are inactive, and there are no associated processes. To assign a process to a job object, use the <a href="https://docs.microsoft.com/windows/desktop/api/jobapi2/nf-jobapi2-assignprocesstojobobject">AssignProcessToJobObject</a> function. To set limits for a job, use the <a href="https://docs.microsoft.com/windows/desktop/api/jobapi2/nf-jobapi2-setinformationjobobject">SetInformationJobObject</a> function. To query accounting information, use the <a href="https://docs.microsoft.com/windows/desktop/api/jobapi2/nf-jobapi2-queryinformationjobobject">QueryInformationJobObject</a> function. All processes associated with a job must run in the same session. A job is associated with the session of the first process to be assigned to the job. <b>Windows Server 2003 and Windows XP: </b>A job is associated with the session of the process that created it. To close a job object handle, use the <a href="https://docs.microsoft.com/windows/desktop/api/handleapi/nf-handleapi-closehandle">CloseHandle</a> function. The job is destroyed when its last handle has been closed and all associated processes have exited. However, if the job has the <b>JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE</b> flag specified, closing the last job object handle terminates all associated processes and then destroys the job object itself. To compile an application that uses this function, define <b>_WIN32_WINNT</b> as 0x0500 or later. For more information, see <a href="https://docs.microsoft.com/windows/desktop/WinProg/using-the-windows-headers">Using the Windows Headers</a>.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/jobapi2/nf-jobapi2-createjobobjectw#">Read more on docs.microsoft.com</see>.</para>
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="M:Windows.Win32.PInvoke.SetInformationJobObject(System.Runtime.InteropServices.SafeHandle,Windows.Win32.System.JobObjects.JOBOBJECTINFOCLASS,System.Void*,System.UInt32)">
|
||||
<inheritdoc cref="M:Windows.Win32.PInvoke.SetInformationJobObject(Windows.Win32.Foundation.HANDLE,Windows.Win32.System.JobObjects.JOBOBJECTINFOCLASS,System.Void*,System.UInt32)"/>
|
||||
</member>
|
||||
<member name="M:Windows.Win32.PInvoke.SetInformationJobObject(Windows.Win32.Foundation.HANDLE,Windows.Win32.System.JobObjects.JOBOBJECTINFOCLASS,System.Void*,System.UInt32)">
|
||||
<summary>Sets limits for a job object.</summary>
|
||||
<param name="hJob">
|
||||
<para>A handle to the job whose limits are being set. The <a href="https://docs.microsoft.com/windows/desktop/api/winbase/nf-winbase-createjobobjecta">CreateJobObject</a> or <a href="https://docs.microsoft.com/windows/desktop/api/winbase/nf-winbase-openjobobjecta">OpenJobObject</a> function returns this handle. The handle must have the <b>JOB_OBJECT_SET_ATTRIBUTES</b> access right. For more information, see <a href="https://docs.microsoft.com/windows/desktop/ProcThread/job-object-security-and-access-rights">Job Object Security and Access Rights</a>.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/jobapi2/nf-jobapi2-setinformationjobobject#parameters">Read more on docs.microsoft.com</see>.</para>
|
||||
</param>
|
||||
<param name="JobObjectInformationClass"></param>
|
||||
<param name="lpJobObjectInformation">The limits or job state to be set for the job. The format of this data depends on the value of <i>JobObjectInfoClass</i>.</param>
|
||||
<param name="cbJobObjectInformationLength">The size of the job information being set, in bytes.</param>
|
||||
<returns>
|
||||
<para>If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call <a href="https://docs.microsoft.com/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror">GetLastError</a>.</para>
|
||||
</returns>
|
||||
<remarks>
|
||||
<para>Use the <b>SetInformationJobObject</b> function to set several limits in a single call. To establish the limits one at a time or change a subset of the limits, call the <a href="https://docs.microsoft.com/windows/desktop/api/jobapi2/nf-jobapi2-queryinformationjobobject">QueryInformationJobObject</a> function to obtain the current limits, modify these limits, and then call <b>SetInformationJobObject</b>. You must set security limits individually for each process associated with a job object, rather than setting them for the job object itself. For information, see <a href="https://docs.microsoft.com/windows/desktop/ProcThread/process-security-and-access-rights">Process Security and Access Rights</a>. <b>Windows Server 2003 and Windows XP: </b>Use the <b>SetInformationJobObject</b> function to set security limits for the job object. To compile an application that uses this function, define _WIN32_WINNT as 0x0500 or later. For more information, see <a href="https://docs.microsoft.com/windows/desktop/WinProg/using-the-windows-headers">Using the Windows Headers</a>.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/jobapi2/nf-jobapi2-setinformationjobobject#">Read more on docs.microsoft.com</see>.</para>
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="M:Windows.Win32.PInvoke.AssignProcessToJobObject(System.Runtime.InteropServices.SafeHandle,System.Runtime.InteropServices.SafeHandle)">
|
||||
<inheritdoc cref="M:Windows.Win32.PInvoke.AssignProcessToJobObject(Windows.Win32.Foundation.HANDLE,Windows.Win32.Foundation.HANDLE)"/>
|
||||
</member>
|
||||
<member name="M:Windows.Win32.PInvoke.AssignProcessToJobObject(Windows.Win32.Foundation.HANDLE,Windows.Win32.Foundation.HANDLE)">
|
||||
<summary>Assigns a process to an existing job object.</summary>
|
||||
<param name="hJob">
|
||||
<para>A handle to the job object to which the process will be associated. The <a href="https://docs.microsoft.com/windows/desktop/api/winbase/nf-winbase-createjobobjecta">CreateJobObject</a> or <a href="https://docs.microsoft.com/windows/desktop/api/winbase/nf-winbase-openjobobjecta">OpenJobObject</a> function returns this handle. The handle must have the JOB_OBJECT_ASSIGN_PROCESS access right. For more information, see <a href="https://docs.microsoft.com/windows/desktop/ProcThread/job-object-security-and-access-rights">Job Object Security and Access Rights</a>.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/jobapi2/nf-jobapi2-assignprocesstojobobject#parameters">Read more on docs.microsoft.com</see>.</para>
|
||||
</param>
|
||||
<param name="hProcess">
|
||||
<para>A handle to the process to associate with the job object. The handle must have the PROCESS_SET_QUOTA and PROCESS_TERMINATE access rights. For more information, see <a href="https://docs.microsoft.com/windows/desktop/ProcThread/process-security-and-access-rights">Process Security and Access Rights</a>. If the process is already associated with a job, the job specified by <i>hJob</i> must be empty or it must be in the hierarchy of nested jobs to which the process already belongs, and it cannot have UI limits set (<a href="https://docs.microsoft.com/windows/desktop/api/jobapi2/nf-jobapi2-setinformationjobobject">SetInformationJobObject</a> with <b>JobObjectBasicUIRestrictions</b>). For more information, see Remarks. <b>Windows 7, Windows Server 2008 R2, Windows XP with SP3, Windows Server 2008, Windows Vista and Windows Server 2003: </b>The process must not already be assigned to a job; if it is, the function fails with ERROR_ACCESS_DENIED. This behavior changed starting in Windows 8 and Windows Server 2012. <b>Terminal Services: </b>All processes within a job must run within the same session as the job.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/jobapi2/nf-jobapi2-assignprocesstojobobject#parameters">Read more on docs.microsoft.com</see>.</para>
|
||||
</param>
|
||||
<returns>
|
||||
<para>If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call <a href="https://docs.microsoft.com/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror">GetLastError</a>.</para>
|
||||
</returns>
|
||||
<remarks>
|
||||
<para>After you associate a process with a job object using <b>AssignProcessToJobObject</b>, the process is subject to the limits set for the job. To set limits for a job, use the <a href="https://docs.microsoft.com/windows/desktop/api/jobapi2/nf-jobapi2-setinformationjobobject">SetInformationJobObject</a> function. If the job has a user-mode time limit, and the time limit has been exhausted, <b>AssignProcessToJobObject</b> fails and the specified process is terminated. If the time limit would be exceeded by associating the process, <b>AssignProcessToJobObject</b> still succeeds. However, the time limit violation will be reported. If the job has an active process limit, and the limit would be exceeded by associating this process, <b>AssignProcessToJobObject</b> fails, and the specified process is terminated. Memory operations performed by a process associated with a job that has a memory limit are subject to the memory limit. Memory operations performed by the process before it was associated with the job are not examined by <b>AssignProcessToJobObject</b>. If the process is already running and the job has security limitations, <b>AssignProcessToJobObject</b> may fail. For example, if the primary token of the process contains the local administrators group, but the job object has the security limitation JOB_OBJECT_SECURITY_NO_ADMIN, the function fails. If the job has the security limitation JOB_OBJECT_SECURITY_ONLY_TOKEN, the process must be created suspended. To create a suspended process, call the <a href="https://docs.microsoft.com/windows/desktop/api/processthreadsapi/nf-processthreadsapi-createprocessa">CreateProcess</a> function with the CREATE_SUSPENDED flag. A process can be associated with more than one job in a hierarchy of nested jobs. For priority class, affinity, commit charge, per-process execution time limit, scheduling class limit, and working set minimum and maximum, the process inherits an effective limit which is the most restrictive limit of all the jobs in its parent job chain. For other resource limits, the process inherits limits from its immediate job in the hierarchy. Accounting information is added to the immediate job and aggregated in each parent job in the job chain. By default, all child processes are associated with the immediate job and every job in the parent job chain. To create a child process that is not part of the same job chain, call the <a href="https://docs.microsoft.com/windows/desktop/api/processthreadsapi/nf-processthreadsapi-createprocessa">CreateProcess</a> function with the CREATE_BREAKAWAY_FROM_JOB flag. The child process breaks away from every job in the job chain unless a job in the chain does not allow breakaway. In this case, the child process does not break away from that job or any job above it in the job chain. For more information, see <a href="https://docs.microsoft.com/windows/desktop/ProcThread/nested-jobs">Nested Jobs</a>. <b>Windows 7, Windows Server 2008 R2, Windows XP with SP3, Windows Server 2008, Windows Vista and Windows Server 2003: </b>A process can be associated only with a single job. A process inherits limits from the job it is associated with and adds its accounting information to the job. If a process is associated with a job, all child processes it creates are associated with that job by default. To create a child process that is not part of the same job, call the <a href="https://docs.microsoft.com/windows/desktop/api/processthreadsapi/nf-processthreadsapi-createprocessa">CreateProcess</a> function with the CREATE_BREAKAWAY_FROM_JOB flag. A process can be associated with more than one job starting in Windows 8 and Windows Server 2012. <b>Windows 7, Windows Server 2008 R2, Windows Server 2008 and Windows Vista: </b>If the process is being monitored by the Program Compatibility Assistant (PCA), it is placed into a compatibility job. Therefore, the process must be created using CREATE_BREAKAWAY_FROM_JOB before it can be placed in another job. Alternatively, you can embed an application manifest that specifies a User Account Control (UAC) level in your application and PCA will not add the process to the compatibility job. For more information, see <a href="https://docs.microsoft.com/previous-versions/dotnet/articles/bb530410(v=msdn.10)">Application Development Requirements for User Account Control Compatibility</a>. If the job or any of its parent jobs in the job chain is terminating when <b>AssignProcessToJob</b> is called, the function fails. To compile an application that uses this function, define _WIN32_WINNT as 0x0500 or later. For more information, see <a href="https://docs.microsoft.com/windows/desktop/WinProg/using-the-windows-headers">Using the Windows Headers</a>.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/jobapi2/nf-jobapi2-assignprocesstojobobject#">Read more on docs.microsoft.com</see>.</para>
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="T:Windows.Win32.Security.SECURITY_ATTRIBUTES">
|
||||
<summary>The SECURITY_ATTRIBUTES structure contains the security descriptor for an object and specifies whether the handle retrieved by specifying this structure is inheritable.</summary>
|
||||
<remarks></remarks>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.Security.SECURITY_ATTRIBUTES.nLength">
|
||||
<summary>The size, in bytes, of this structure. Set this value to the size of the **SECURITY\_ATTRIBUTES** structure.</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.Security.SECURITY_ATTRIBUTES.lpSecurityDescriptor">
|
||||
<summary>
|
||||
<para>A pointer to a [**SECURITY\_DESCRIPTOR**](../winnt/ns-winnt-security_descriptor.md) structure that controls access to the object. If the value of this member is **NULL**, the object is assigned the default security descriptor associated with the [*access token*](/windows/win32/secauthz/access-tokens) of the calling process. This is not the same as granting access to everyone by assigning a **NULL** [*discretionary access control list*](/windows/win32/secauthz/dacls-and-aces) (DACL). By default, the default DACL in the access token of a process allows access only to the user represented by the access token. For information about creating a security descriptor, see [Creating a Security Descriptor](/windows/win32/secauthz/creating-a-security-descriptor-for-a-new-object-in-c--).</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/wtypesbase/ns-wtypesbase-security_attributes#members">Read more on docs.microsoft.com</see>.</para>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.Security.SECURITY_ATTRIBUTES.bInheritHandle">
|
||||
<summary>A Boolean value that specifies whether the returned handle is inherited when a new process is created. If this member is **TRUE**, the new process inherits the handle.</summary>
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
||||
@@ -0,0 +1,331 @@
|
||||
<?xml version="1.0"?>
|
||||
<doc>
|
||||
<assembly>
|
||||
<name>EphemeralMongo</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="P:EphemeralMongo.MongoRunnerOptions.Version">
|
||||
<summary>
|
||||
The desired MongoDB version to download and use.
|
||||
</summary>
|
||||
<exception cref="T:System.ArgumentOutOfRangeException">The version is not supported.</exception>
|
||||
</member>
|
||||
<member name="P:EphemeralMongo.MongoRunnerOptions.Edition">
|
||||
<summary>
|
||||
The desired MongoDB edition to download and use.
|
||||
</summary>
|
||||
<exception cref="T:System.ArgumentOutOfRangeException">The edition is not supported.</exception>
|
||||
</member>
|
||||
<member name="P:EphemeralMongo.MongoRunnerOptions.DataDirectory">
|
||||
<summary>
|
||||
The directory where the mongod instance stores its data. If not specified, a temporary directory will be used.
|
||||
</summary>
|
||||
<exception cref="T:System.ArgumentException">The path is invalid.</exception>
|
||||
<seealso href="https://www.mongodb.com/docs/manual/reference/program/mongod/#std-option-mongod.--dbpath"/>
|
||||
</member>
|
||||
<member name="P:EphemeralMongo.MongoRunnerOptions.BinaryDirectory">
|
||||
<summary>
|
||||
The directory where your own MongoDB binaries can be found (mongod, mongoexport and mongoimport).
|
||||
</summary>
|
||||
<exception cref="T:System.ArgumentException">The path is invalid.</exception>
|
||||
</member>
|
||||
<member name="P:EphemeralMongo.MongoRunnerOptions.AdditionalArguments">
|
||||
<summary>
|
||||
Additional mongod CLI arguments.
|
||||
</summary>
|
||||
<seealso href="https://www.mongodb.com/docs/manual/reference/program/mongod/#options"/>
|
||||
</member>
|
||||
<member name="P:EphemeralMongo.MongoRunnerOptions.ConnectionTimeout">
|
||||
<summary>
|
||||
Maximum timespan to wait for mongod process to be ready to accept connections.
|
||||
</summary>
|
||||
<exception cref="T:System.ArgumentOutOfRangeException">The timeout cannot be negative.</exception>
|
||||
</member>
|
||||
<member name="P:EphemeralMongo.MongoRunnerOptions.UseSingleNodeReplicaSet">
|
||||
<summary>
|
||||
Whether to create a single node replica set or use a standalone mongod instance.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:EphemeralMongo.MongoRunnerOptions.ReplicaSetSetupTimeout">
|
||||
<summary>
|
||||
Maximum timespan to wait for the replica set to accept database writes.
|
||||
</summary>
|
||||
<exception cref="T:System.ArgumentOutOfRangeException">The timeout cannot be negative.</exception>
|
||||
</member>
|
||||
<member name="P:EphemeralMongo.MongoRunnerOptions.StandardOutputLogger">
|
||||
<summary>
|
||||
A delegate that provides access to any MongodDB-related process standard output.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:EphemeralMongo.MongoRunnerOptions.StandardErrorLogger">
|
||||
<summary>
|
||||
A delegate that provides access to any MongodDB-related process error output.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:EphemeralMongo.MongoRunnerOptions.MongoPort">
|
||||
<summary>
|
||||
The mongod port to use. If not specified, a random available port will be used.
|
||||
</summary>
|
||||
<exception cref="T:System.ArgumentOutOfRangeException">The port must be greater than zero.</exception>
|
||||
</member>
|
||||
<member name="P:EphemeralMongo.MongoRunnerOptions.DataDirectoryLifetime">
|
||||
<summary>
|
||||
The lifetime of data directories that are automatically created when they are not specified by the user.
|
||||
When their age exceeds this value, they will be deleted on the next run of MongoRunner.
|
||||
</summary>
|
||||
<exception cref="T:System.ArgumentOutOfRangeException">The lifetime cannot be negative.</exception>
|
||||
</member>
|
||||
<member name="P:EphemeralMongo.MongoRunnerOptions.Transport">
|
||||
<summary>
|
||||
The HTTP transport to use for downloading MongoDB binaries and MongoDB release information.
|
||||
</summary>
|
||||
<exception cref="T:System.ArgumentNullException"></exception>
|
||||
</member>
|
||||
<member name="P:EphemeralMongo.MongoRunnerOptions.NewVersionCheckTimeout">
|
||||
<summary>
|
||||
The maximum timespan to wait before checking for a newer version of MongoDB binaries.
|
||||
</summary>
|
||||
<exception cref="T:System.ArgumentOutOfRangeException">The timeout cannot be negative.</exception>
|
||||
</member>
|
||||
<member name="T:Windows.Win32.Foundation.PCWSTR">
|
||||
<summary>
|
||||
A pointer to a null-terminated, constant character string.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.Foundation.PCWSTR.Value">
|
||||
<summary>
|
||||
A pointer to the first character in the string. The content should be considered readonly, as it was typed as constant in the SDK.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Windows.Win32.Foundation.PCWSTR.Length">
|
||||
<summary>
|
||||
Gets the number of characters up to the first null character (exclusive).
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Windows.Win32.Foundation.PCWSTR.ToString">
|
||||
<summary>
|
||||
Returns a <see langword="string"/> with a copy of this character array, up to the first null character (exclusive).
|
||||
</summary>
|
||||
<returns>A <see langword="string"/>, or <see langword="null"/> if <see cref="F:Windows.Win32.Foundation.PCWSTR.Value"/> is <see langword="null"/>.</returns>
|
||||
</member>
|
||||
<member name="M:Windows.Win32.Foundation.PCWSTR.AsSpan">
|
||||
<summary>
|
||||
Returns a span of the characters in this string, up to the first null character (exclusive).
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Windows.Win32.System.Threading.IO_COUNTERS">
|
||||
<summary>Contains I/O accounting information for a process or a job object.</summary>
|
||||
<remarks>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/winnt/ns-winnt-io_counters">Learn more about this API from docs.microsoft.com</see>.</para>
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.Threading.IO_COUNTERS.ReadOperationCount">
|
||||
<summary>The number of read operations performed.</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.Threading.IO_COUNTERS.WriteOperationCount">
|
||||
<summary>The number of write operations performed.</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.Threading.IO_COUNTERS.OtherOperationCount">
|
||||
<summary>The number of I/O operations performed, other than read and write operations.</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.Threading.IO_COUNTERS.ReadTransferCount">
|
||||
<summary>The number of bytes read.</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.Threading.IO_COUNTERS.WriteTransferCount">
|
||||
<summary>The number of bytes written.</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.Threading.IO_COUNTERS.OtherTransferCount">
|
||||
<summary>The number of bytes transferred during operations other than read and write operations.</summary>
|
||||
</member>
|
||||
<member name="T:Windows.Win32.System.JobObjects.JOBOBJECT_BASIC_LIMIT_INFORMATION">
|
||||
<summary>Contains basic limit information for a job object.</summary>
|
||||
<remarks>
|
||||
<para>Processes can still empty their working sets using the <a href="https://docs.microsoft.com/windows/win32/api/memoryapi/nf-memoryapi-setprocessworkingsetsize">SetProcessWorkingSetSize</a> function with (<b>SIZE_T</b>)-1, even when <b>JOB_OBJECT_LIMIT_WORKINGSET</b> is used. However, you cannot use <b>SetProcessWorkingSetSize</b> change the minimum or maximum working set size of a process in a job object. The system increments the active process count when you attempt to associate a process with a job. If the limit is exceeded, the system decrements the active process count only when the process terminates and all handles to the process are closed. Therefore, if you have an open handle to a process that has been terminated in such a manner, you cannot associate any new processes until the handle is closed and the active process count is below the limit.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/winnt/ns-winnt-jobobject_basic_limit_information#">Read more on docs.microsoft.com</see>.</para>
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.JobObjects.JOBOBJECT_BASIC_LIMIT_INFORMATION.PerProcessUserTimeLimit">
|
||||
<summary>
|
||||
<para>If <b>LimitFlags</b> specifies <b>JOB_OBJECT_LIMIT_PROCESS_TIME</b>, this member is the per-process user-mode execution time limit, in 100-nanosecond ticks. Otherwise, this member is ignored.</para>
|
||||
<para>The system periodically checks to determine whether each process associated with the job has accumulated more user-mode time than the set limit. If it has, the process is terminated. If the job is nested, the effective limit is the most restrictive limit in the job chain.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/winnt/ns-winnt-jobobject_basic_limit_information#members">Read more on docs.microsoft.com</see>.</para>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.JobObjects.JOBOBJECT_BASIC_LIMIT_INFORMATION.PerJobUserTimeLimit">
|
||||
<summary>
|
||||
<para>If <b>LimitFlags</b> specifies <b>JOB_OBJECT_LIMIT_JOB_TIME</b>, this member is the per-job user-mode execution time limit, in 100-nanosecond ticks. Otherwise, this member is ignored.</para>
|
||||
<para>The system adds the current time of the processes associated with the job to this limit. For example, if you set this limit to 1 minute, and the job has a process that has accumulated 5 minutes of user-mode time, the limit actually enforced is 6 minutes. The system periodically checks to determine whether the sum of the user-mode execution time for all processes is greater than this end-of-job limit. If it is, the action specified in the <b>EndOfJobTimeAction</b> member of the <a href="https://docs.microsoft.com/windows/desktop/api/winnt/ns-winnt-jobobject_end_of_job_time_information">JOBOBJECT_END_OF_JOB_TIME_INFORMATION</a> structure is carried out. By default, all processes are terminated and the status code is set to <b>ERROR_NOT_ENOUGH_QUOTA</b>. To register for notification when this limit is exceeded without terminating processes, use the <a href="https://docs.microsoft.com/windows/desktop/api/jobapi2/nf-jobapi2-setinformationjobobject">SetInformationJobObject</a> function with the <b>JobObjectNotificationLimitInformation</b> information class.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/winnt/ns-winnt-jobobject_basic_limit_information#members">Read more on docs.microsoft.com</see>.</para>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.JobObjects.JOBOBJECT_BASIC_LIMIT_INFORMATION.LimitFlags">
|
||||
<summary></summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.JobObjects.JOBOBJECT_BASIC_LIMIT_INFORMATION.MinimumWorkingSetSize">
|
||||
<summary>
|
||||
<para>If <b>LimitFlags</b> specifies <b>JOB_OBJECT_LIMIT_WORKINGSET</b>, this member is the minimum working set size in bytes for each process associated with the job. Otherwise, this member is ignored. If <b>MaximumWorkingSetSize</b> is nonzero, <b>MinimumWorkingSetSize</b> cannot be zero.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/winnt/ns-winnt-jobobject_basic_limit_information#members">Read more on docs.microsoft.com</see>.</para>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.JobObjects.JOBOBJECT_BASIC_LIMIT_INFORMATION.MaximumWorkingSetSize">
|
||||
<summary>
|
||||
<para>If <b>LimitFlags</b> specifies <b>JOB_OBJECT_LIMIT_WORKINGSET</b>, this member is the maximum working set size in bytes for each process associated with the job. Otherwise, this member is ignored. If <b>MinimumWorkingSetSize</b> is nonzero, <b>MaximumWorkingSetSize</b> cannot be zero.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/winnt/ns-winnt-jobobject_basic_limit_information#members">Read more on docs.microsoft.com</see>.</para>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.JobObjects.JOBOBJECT_BASIC_LIMIT_INFORMATION.ActiveProcessLimit">
|
||||
<summary>
|
||||
<para>If <b>LimitFlags</b> specifies <b>JOB_OBJECT_LIMIT_ACTIVE_PROCESS</b>, this member is the active process limit for the job. Otherwise, this member is ignored. If you try to associate a process with a job, and this causes the active process count to exceed this limit, the process is terminated and the association fails.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/winnt/ns-winnt-jobobject_basic_limit_information#members">Read more on docs.microsoft.com</see>.</para>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.JobObjects.JOBOBJECT_BASIC_LIMIT_INFORMATION.Affinity">
|
||||
<summary>
|
||||
<para>If <b>LimitFlags</b> specifies <b>JOB_OBJECT_LIMIT_AFFINITY</b>, this member is the processor affinity for all processes associated with the job. Otherwise, this member is ignored. The affinity must be a subset of the system affinity mask obtained by calling the <a href="https://docs.microsoft.com/windows/desktop/api/winbase/nf-winbase-getprocessaffinitymask">GetProcessAffinityMask</a> function. The affinity of each thread is set to this value, but threads are free to subsequently set their affinity, as long as it is a subset of the specified affinity mask. Processes cannot set their own affinity mask.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/winnt/ns-winnt-jobobject_basic_limit_information#members">Read more on docs.microsoft.com</see>.</para>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.JobObjects.JOBOBJECT_BASIC_LIMIT_INFORMATION.PriorityClass">
|
||||
<summary>
|
||||
<para>If <b>LimitFlags</b> specifies <b>JOB_OBJECT_LIMIT_PRIORITY_CLASS</b>, this member is the priority class for all processes associated with the job. Otherwise, this member is ignored. Processes and threads cannot modify their priority class. The calling process must enable the <b>SE_INC_BASE_PRIORITY_NAME</b> privilege.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/winnt/ns-winnt-jobobject_basic_limit_information#members">Read more on docs.microsoft.com</see>.</para>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.JobObjects.JOBOBJECT_BASIC_LIMIT_INFORMATION.SchedulingClass">
|
||||
<summary>
|
||||
<para>If <b>LimitFlags</b> specifies <b>JOB_OBJECT_LIMIT_SCHEDULING_CLASS</b>, this member is the scheduling class for all processes associated with the job. Otherwise, this member is ignored. The valid values are 0 to 9. Use 0 for the least favorable scheduling class relative to other threads, and 9 for the most favorable scheduling class relative to other threads. By default, this value is 5. To use a scheduling class greater than 5, the calling process must enable the <b>SE_INC_BASE_PRIORITY_NAME</b> privilege.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/winnt/ns-winnt-jobobject_basic_limit_information#members">Read more on docs.microsoft.com</see>.</para>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Windows.Win32.System.JobObjects.JOBOBJECT_EXTENDED_LIMIT_INFORMATION">
|
||||
<summary>Contains basic and extended limit information for a job object.</summary>
|
||||
<remarks>
|
||||
<para>The system tracks the value of <b>PeakProcessMemoryUsed</b> and <b>PeakJobMemoryUsed</b> constantly. This allows you know the peak memory usage of each job. You can use this information to establish a memory limit using the <b>JOB_OBJECT_LIMIT_PROCESS_MEMORY</b> or <b>JOB_OBJECT_LIMIT_JOB_MEMORY</b> value. Note that the job memory and process memory limits are very similar in operation, but they are independent. You could set a job-wide limit of 100 MB with a per-process limit of 10 MB. In this scenario, no single process could commit more than 10 MB, and the set of processes associated with a job could never exceed 100 MB. To register for notifications that a job has exceeded its peak memory limit while allowing processes to continue to commit memory, use the <a href="https://docs.microsoft.com/windows/desktop/api/jobapi2/nf-jobapi2-setinformationjobobject">SetInformationJobObject</a> function with the <b>JobObjectNotificationLimitInformation</b> information class.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/winnt/ns-winnt-jobobject_extended_limit_information#">Read more on docs.microsoft.com</see>.</para>
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.JobObjects.JOBOBJECT_EXTENDED_LIMIT_INFORMATION.BasicLimitInformation">
|
||||
<summary>
|
||||
<para>A <a href="https://docs.microsoft.com/windows/desktop/api/winnt/ns-winnt-jobobject_basic_limit_information">JOBOBJECT_BASIC_LIMIT_INFORMATION</a> structure that contains basic limit information.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/winnt/ns-winnt-jobobject_extended_limit_information#members">Read more on docs.microsoft.com</see>.</para>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.JobObjects.JOBOBJECT_EXTENDED_LIMIT_INFORMATION.IoInfo">
|
||||
<summary>Reserved.</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.JobObjects.JOBOBJECT_EXTENDED_LIMIT_INFORMATION.ProcessMemoryLimit">
|
||||
<summary>
|
||||
<para>If the <b>LimitFlags</b> member of the <a href="https://docs.microsoft.com/windows/desktop/api/winnt/ns-winnt-jobobject_basic_limit_information">JOBOBJECT_BASIC_LIMIT_INFORMATION</a> structure specifies the <b>JOB_OBJECT_LIMIT_PROCESS_MEMORY</b> value, this member specifies the limit for the virtual memory that can be committed by a process. Otherwise, this member is ignored.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/winnt/ns-winnt-jobobject_extended_limit_information#members">Read more on docs.microsoft.com</see>.</para>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.JobObjects.JOBOBJECT_EXTENDED_LIMIT_INFORMATION.JobMemoryLimit">
|
||||
<summary>
|
||||
<para>If the <b>LimitFlags</b> member of the <a href="https://docs.microsoft.com/windows/desktop/api/winnt/ns-winnt-jobobject_basic_limit_information">JOBOBJECT_BASIC_LIMIT_INFORMATION</a> structure specifies the <b>JOB_OBJECT_LIMIT_JOB_MEMORY</b> value, this member specifies the limit for the virtual memory that can be committed for the job. Otherwise, this member is ignored.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/winnt/ns-winnt-jobobject_extended_limit_information#members">Read more on docs.microsoft.com</see>.</para>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.JobObjects.JOBOBJECT_EXTENDED_LIMIT_INFORMATION.PeakProcessMemoryUsed">
|
||||
<summary>The peak memory used by any process ever associated with the job.</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.System.JobObjects.JOBOBJECT_EXTENDED_LIMIT_INFORMATION.PeakJobMemoryUsed">
|
||||
<summary>The peak memory usage of all processes currently associated with the job.</summary>
|
||||
</member>
|
||||
<member name="T:Windows.Win32.PInvoke">
|
||||
<content>
|
||||
Contains extern methods from "KERNEL32.dll".
|
||||
</content>
|
||||
</member>
|
||||
<member name="M:Windows.Win32.PInvoke.CloseHandle(Windows.Win32.Foundation.HANDLE)">
|
||||
<summary>Closes an open object handle.</summary>
|
||||
<param name="hObject">A valid handle to an open object.</param>
|
||||
<returns>
|
||||
<para>If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call <a href="https://docs.microsoft.com/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror">GetLastError</a>. If the application is running under a debugger, the function will throw an exception if it receives either a handle value that is not valid or a pseudo-handle value. This can happen if you close a handle twice, or if you call <b>CloseHandle</b> on a handle returned by the <a href="https://docs.microsoft.com/windows/desktop/api/fileapi/nf-fileapi-findfirstfilea">FindFirstFile</a> function instead of calling the <a href="https://docs.microsoft.com/windows/desktop/api/fileapi/nf-fileapi-findclose">FindClose</a> function.</para>
|
||||
</returns>
|
||||
<remarks>
|
||||
<para>The <b>CloseHandle</b> function closes handles to the following objects: </para>
|
||||
<para>This doc was truncated.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/handleapi/nf-handleapi-closehandle#">Read more on docs.microsoft.com</see>.</para>
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="M:Windows.Win32.PInvoke.CreateJobObject(System.Nullable{Windows.Win32.Security.SECURITY_ATTRIBUTES},System.String)">
|
||||
<inheritdoc cref="M:Windows.Win32.PInvoke.CreateJobObject(Windows.Win32.Security.SECURITY_ATTRIBUTES*,Windows.Win32.Foundation.PCWSTR)"/>
|
||||
</member>
|
||||
<member name="M:Windows.Win32.PInvoke.CreateJobObject(Windows.Win32.Security.SECURITY_ATTRIBUTES*,Windows.Win32.Foundation.PCWSTR)">
|
||||
<summary>Creates or opens a job object. (CreateJobObjectW)</summary>
|
||||
<param name="lpJobAttributes">
|
||||
<para>A pointer to a <a href="https://docs.microsoft.com/previous-versions/windows/desktop/legacy/aa379560(v=vs.85)">SECURITY_ATTRIBUTES</a> structure that specifies the security descriptor for the job object and determines whether child processes can inherit the returned handle. If <i>lpJobAttributes</i> is <b>NULL</b>, the job object gets a default security descriptor and the handle cannot be inherited. The ACLs in the default security descriptor for a job object come from the primary or impersonation token of the creator.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/jobapi2/nf-jobapi2-createjobobjectw#parameters">Read more on docs.microsoft.com</see>.</para>
|
||||
</param>
|
||||
<param name="lpName">
|
||||
<para>The name of the job. The name is limited to <b>MAX_PATH</b> characters. Name comparison is case-sensitive.</para>
|
||||
<para>If <i>lpName</i> is <b>NULL</b>, the job is created without a name. If <i>lpName</i> matches the name of an existing event, semaphore, mutex, waitable timer, or file-mapping object, the function fails and the <a href="https://docs.microsoft.com/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror">GetLastError</a> function returns <b>ERROR_INVALID_HANDLE</b>. This occurs because these objects share the same namespace. The object can be created in a private namespace. For more information, see <a href="https://docs.microsoft.com/windows/desktop/Sync/object-namespaces">Object Namespaces</a>. <b>Terminal Services: </b>The name can have a "Global\\" or "Local\\" prefix to explicitly create the object in the global or session namespace. The remainder of the name can contain any character except the backslash character (\\). For more information, see <a href="https://docs.microsoft.com/windows/desktop/TermServ/kernel-object-namespaces">Kernel Object Namespaces</a>.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/jobapi2/nf-jobapi2-createjobobjectw#parameters">Read more on docs.microsoft.com</see>.</para>
|
||||
</param>
|
||||
<returns>
|
||||
<para>If the function succeeds, the return value is a handle to the job object. The handle has the <b>JOB_OBJECT_ALL_ACCESS</b> access right. If the object existed before the function call, the function returns a handle to the existing job object and <a href="https://docs.microsoft.com/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror">GetLastError</a> returns <b>ERROR_ALREADY_EXISTS</b>. If the function fails, the return value is NULL. To get extended error information, call <a href="https://docs.microsoft.com/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror">GetLastError</a>.</para>
|
||||
</returns>
|
||||
<remarks>
|
||||
<para>When a job is created, its accounting information is initialized to zero, all limits are inactive, and there are no associated processes. To assign a process to a job object, use the <a href="https://docs.microsoft.com/windows/desktop/api/jobapi2/nf-jobapi2-assignprocesstojobobject">AssignProcessToJobObject</a> function. To set limits for a job, use the <a href="https://docs.microsoft.com/windows/desktop/api/jobapi2/nf-jobapi2-setinformationjobobject">SetInformationJobObject</a> function. To query accounting information, use the <a href="https://docs.microsoft.com/windows/desktop/api/jobapi2/nf-jobapi2-queryinformationjobobject">QueryInformationJobObject</a> function. All processes associated with a job must run in the same session. A job is associated with the session of the first process to be assigned to the job. <b>Windows Server 2003 and Windows XP: </b>A job is associated with the session of the process that created it. To close a job object handle, use the <a href="https://docs.microsoft.com/windows/desktop/api/handleapi/nf-handleapi-closehandle">CloseHandle</a> function. The job is destroyed when its last handle has been closed and all associated processes have exited. However, if the job has the <b>JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE</b> flag specified, closing the last job object handle terminates all associated processes and then destroys the job object itself. To compile an application that uses this function, define <b>_WIN32_WINNT</b> as 0x0500 or later. For more information, see <a href="https://docs.microsoft.com/windows/desktop/WinProg/using-the-windows-headers">Using the Windows Headers</a>.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/jobapi2/nf-jobapi2-createjobobjectw#">Read more on docs.microsoft.com</see>.</para>
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="M:Windows.Win32.PInvoke.SetInformationJobObject(System.Runtime.InteropServices.SafeHandle,Windows.Win32.System.JobObjects.JOBOBJECTINFOCLASS,System.Void*,System.UInt32)">
|
||||
<inheritdoc cref="M:Windows.Win32.PInvoke.SetInformationJobObject(Windows.Win32.Foundation.HANDLE,Windows.Win32.System.JobObjects.JOBOBJECTINFOCLASS,System.Void*,System.UInt32)"/>
|
||||
</member>
|
||||
<member name="M:Windows.Win32.PInvoke.SetInformationJobObject(Windows.Win32.Foundation.HANDLE,Windows.Win32.System.JobObjects.JOBOBJECTINFOCLASS,System.Void*,System.UInt32)">
|
||||
<summary>Sets limits for a job object.</summary>
|
||||
<param name="hJob">
|
||||
<para>A handle to the job whose limits are being set. The <a href="https://docs.microsoft.com/windows/desktop/api/winbase/nf-winbase-createjobobjecta">CreateJobObject</a> or <a href="https://docs.microsoft.com/windows/desktop/api/winbase/nf-winbase-openjobobjecta">OpenJobObject</a> function returns this handle. The handle must have the <b>JOB_OBJECT_SET_ATTRIBUTES</b> access right. For more information, see <a href="https://docs.microsoft.com/windows/desktop/ProcThread/job-object-security-and-access-rights">Job Object Security and Access Rights</a>.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/jobapi2/nf-jobapi2-setinformationjobobject#parameters">Read more on docs.microsoft.com</see>.</para>
|
||||
</param>
|
||||
<param name="JobObjectInformationClass"></param>
|
||||
<param name="lpJobObjectInformation">The limits or job state to be set for the job. The format of this data depends on the value of <i>JobObjectInfoClass</i>.</param>
|
||||
<param name="cbJobObjectInformationLength">The size of the job information being set, in bytes.</param>
|
||||
<returns>
|
||||
<para>If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call <a href="https://docs.microsoft.com/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror">GetLastError</a>.</para>
|
||||
</returns>
|
||||
<remarks>
|
||||
<para>Use the <b>SetInformationJobObject</b> function to set several limits in a single call. To establish the limits one at a time or change a subset of the limits, call the <a href="https://docs.microsoft.com/windows/desktop/api/jobapi2/nf-jobapi2-queryinformationjobobject">QueryInformationJobObject</a> function to obtain the current limits, modify these limits, and then call <b>SetInformationJobObject</b>. You must set security limits individually for each process associated with a job object, rather than setting them for the job object itself. For information, see <a href="https://docs.microsoft.com/windows/desktop/ProcThread/process-security-and-access-rights">Process Security and Access Rights</a>. <b>Windows Server 2003 and Windows XP: </b>Use the <b>SetInformationJobObject</b> function to set security limits for the job object. To compile an application that uses this function, define _WIN32_WINNT as 0x0500 or later. For more information, see <a href="https://docs.microsoft.com/windows/desktop/WinProg/using-the-windows-headers">Using the Windows Headers</a>.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/jobapi2/nf-jobapi2-setinformationjobobject#">Read more on docs.microsoft.com</see>.</para>
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="M:Windows.Win32.PInvoke.AssignProcessToJobObject(System.Runtime.InteropServices.SafeHandle,System.Runtime.InteropServices.SafeHandle)">
|
||||
<inheritdoc cref="M:Windows.Win32.PInvoke.AssignProcessToJobObject(Windows.Win32.Foundation.HANDLE,Windows.Win32.Foundation.HANDLE)"/>
|
||||
</member>
|
||||
<member name="M:Windows.Win32.PInvoke.AssignProcessToJobObject(Windows.Win32.Foundation.HANDLE,Windows.Win32.Foundation.HANDLE)">
|
||||
<summary>Assigns a process to an existing job object.</summary>
|
||||
<param name="hJob">
|
||||
<para>A handle to the job object to which the process will be associated. The <a href="https://docs.microsoft.com/windows/desktop/api/winbase/nf-winbase-createjobobjecta">CreateJobObject</a> or <a href="https://docs.microsoft.com/windows/desktop/api/winbase/nf-winbase-openjobobjecta">OpenJobObject</a> function returns this handle. The handle must have the JOB_OBJECT_ASSIGN_PROCESS access right. For more information, see <a href="https://docs.microsoft.com/windows/desktop/ProcThread/job-object-security-and-access-rights">Job Object Security and Access Rights</a>.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/jobapi2/nf-jobapi2-assignprocesstojobobject#parameters">Read more on docs.microsoft.com</see>.</para>
|
||||
</param>
|
||||
<param name="hProcess">
|
||||
<para>A handle to the process to associate with the job object. The handle must have the PROCESS_SET_QUOTA and PROCESS_TERMINATE access rights. For more information, see <a href="https://docs.microsoft.com/windows/desktop/ProcThread/process-security-and-access-rights">Process Security and Access Rights</a>. If the process is already associated with a job, the job specified by <i>hJob</i> must be empty or it must be in the hierarchy of nested jobs to which the process already belongs, and it cannot have UI limits set (<a href="https://docs.microsoft.com/windows/desktop/api/jobapi2/nf-jobapi2-setinformationjobobject">SetInformationJobObject</a> with <b>JobObjectBasicUIRestrictions</b>). For more information, see Remarks. <b>Windows 7, Windows Server 2008 R2, Windows XP with SP3, Windows Server 2008, Windows Vista and Windows Server 2003: </b>The process must not already be assigned to a job; if it is, the function fails with ERROR_ACCESS_DENIED. This behavior changed starting in Windows 8 and Windows Server 2012. <b>Terminal Services: </b>All processes within a job must run within the same session as the job.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/jobapi2/nf-jobapi2-assignprocesstojobobject#parameters">Read more on docs.microsoft.com</see>.</para>
|
||||
</param>
|
||||
<returns>
|
||||
<para>If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call <a href="https://docs.microsoft.com/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror">GetLastError</a>.</para>
|
||||
</returns>
|
||||
<remarks>
|
||||
<para>After you associate a process with a job object using <b>AssignProcessToJobObject</b>, the process is subject to the limits set for the job. To set limits for a job, use the <a href="https://docs.microsoft.com/windows/desktop/api/jobapi2/nf-jobapi2-setinformationjobobject">SetInformationJobObject</a> function. If the job has a user-mode time limit, and the time limit has been exhausted, <b>AssignProcessToJobObject</b> fails and the specified process is terminated. If the time limit would be exceeded by associating the process, <b>AssignProcessToJobObject</b> still succeeds. However, the time limit violation will be reported. If the job has an active process limit, and the limit would be exceeded by associating this process, <b>AssignProcessToJobObject</b> fails, and the specified process is terminated. Memory operations performed by a process associated with a job that has a memory limit are subject to the memory limit. Memory operations performed by the process before it was associated with the job are not examined by <b>AssignProcessToJobObject</b>. If the process is already running and the job has security limitations, <b>AssignProcessToJobObject</b> may fail. For example, if the primary token of the process contains the local administrators group, but the job object has the security limitation JOB_OBJECT_SECURITY_NO_ADMIN, the function fails. If the job has the security limitation JOB_OBJECT_SECURITY_ONLY_TOKEN, the process must be created suspended. To create a suspended process, call the <a href="https://docs.microsoft.com/windows/desktop/api/processthreadsapi/nf-processthreadsapi-createprocessa">CreateProcess</a> function with the CREATE_SUSPENDED flag. A process can be associated with more than one job in a hierarchy of nested jobs. For priority class, affinity, commit charge, per-process execution time limit, scheduling class limit, and working set minimum and maximum, the process inherits an effective limit which is the most restrictive limit of all the jobs in its parent job chain. For other resource limits, the process inherits limits from its immediate job in the hierarchy. Accounting information is added to the immediate job and aggregated in each parent job in the job chain. By default, all child processes are associated with the immediate job and every job in the parent job chain. To create a child process that is not part of the same job chain, call the <a href="https://docs.microsoft.com/windows/desktop/api/processthreadsapi/nf-processthreadsapi-createprocessa">CreateProcess</a> function with the CREATE_BREAKAWAY_FROM_JOB flag. The child process breaks away from every job in the job chain unless a job in the chain does not allow breakaway. In this case, the child process does not break away from that job or any job above it in the job chain. For more information, see <a href="https://docs.microsoft.com/windows/desktop/ProcThread/nested-jobs">Nested Jobs</a>. <b>Windows 7, Windows Server 2008 R2, Windows XP with SP3, Windows Server 2008, Windows Vista and Windows Server 2003: </b>A process can be associated only with a single job. A process inherits limits from the job it is associated with and adds its accounting information to the job. If a process is associated with a job, all child processes it creates are associated with that job by default. To create a child process that is not part of the same job, call the <a href="https://docs.microsoft.com/windows/desktop/api/processthreadsapi/nf-processthreadsapi-createprocessa">CreateProcess</a> function with the CREATE_BREAKAWAY_FROM_JOB flag. A process can be associated with more than one job starting in Windows 8 and Windows Server 2012. <b>Windows 7, Windows Server 2008 R2, Windows Server 2008 and Windows Vista: </b>If the process is being monitored by the Program Compatibility Assistant (PCA), it is placed into a compatibility job. Therefore, the process must be created using CREATE_BREAKAWAY_FROM_JOB before it can be placed in another job. Alternatively, you can embed an application manifest that specifies a User Account Control (UAC) level in your application and PCA will not add the process to the compatibility job. For more information, see <a href="https://docs.microsoft.com/previous-versions/dotnet/articles/bb530410(v=msdn.10)">Application Development Requirements for User Account Control Compatibility</a>. If the job or any of its parent jobs in the job chain is terminating when <b>AssignProcessToJob</b> is called, the function fails. To compile an application that uses this function, define _WIN32_WINNT as 0x0500 or later. For more information, see <a href="https://docs.microsoft.com/windows/desktop/WinProg/using-the-windows-headers">Using the Windows Headers</a>.</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/jobapi2/nf-jobapi2-assignprocesstojobobject#">Read more on docs.microsoft.com</see>.</para>
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="T:Windows.Win32.Security.SECURITY_ATTRIBUTES">
|
||||
<summary>The SECURITY_ATTRIBUTES structure contains the security descriptor for an object and specifies whether the handle retrieved by specifying this structure is inheritable.</summary>
|
||||
<remarks></remarks>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.Security.SECURITY_ATTRIBUTES.nLength">
|
||||
<summary>The size, in bytes, of this structure. Set this value to the size of the **SECURITY\_ATTRIBUTES** structure.</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.Security.SECURITY_ATTRIBUTES.lpSecurityDescriptor">
|
||||
<summary>
|
||||
<para>A pointer to a [**SECURITY\_DESCRIPTOR**](../winnt/ns-winnt-security_descriptor.md) structure that controls access to the object. If the value of this member is **NULL**, the object is assigned the default security descriptor associated with the [*access token*](/windows/win32/secauthz/access-tokens) of the calling process. This is not the same as granting access to everyone by assigning a **NULL** [*discretionary access control list*](/windows/win32/secauthz/dacls-and-aces) (DACL). By default, the default DACL in the access token of a process allows access only to the user represented by the access token. For information about creating a security descriptor, see [Creating a Security Descriptor](/windows/win32/secauthz/creating-a-security-descriptor-for-a-new-object-in-c--).</para>
|
||||
<para><see href="https://learn.microsoft.com/windows/win32/api/wtypesbase/ns-wtypesbase-security_attributes#members">Read more on docs.microsoft.com</see>.</para>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Windows.Win32.Security.SECURITY_ATTRIBUTES.bInheritHandle">
|
||||
<summary>A Boolean value that specifies whether the returned handle is inherited when a new process is created. If this member is **TRUE**, the new process inherits the handle.</summary>
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
||||
Reference in New Issue
Block a user