Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
ca49dae
Moved winbase FS APIs to the winbase region.
May 14, 2021
f990184
Removed stale includes.
May 14, 2021
b793c8f
Moved topology headers to Threading.
May 14, 2021
00d039f
Moved namespace APIs to Threading.
May 14, 2021
3480bd7
Moved SetThreadPriority to Threading.
May 14, 2021
cd43467
Updated the baseline.
May 14, 2021
eb0cdde
Moved printing APIs to Graphics.Printing.
May 15, 2021
6964e1b
Refactored PrintTicket and XPS printing APIs.
May 15, 2021
1aecfb6
Added argument completion for partition names.
May 16, 2021
54e9f41
Made partitionName positional.
May 16, 2021
734b31a
Removed unnecessary -partitionName from examples.
May 16, 2021
8eec130
Refactored Security APIs.
May 16, 2021
627b862
Removed unnecessary using statements.
May 16, 2021
d80fecc
Merge branch 'master' into user/mikebattista/namespaces
May 16, 2021
d1c49de
Added notes about maintainability.
May 16, 2021
83e5c4e
Associated more remaps with headers.
May 16, 2021
93dca3d
Grouped filesystem APIs by header.
May 16, 2021
c7a7131
Additional cleanup.
May 16, 2021
4e73a34
Created System.SystemInformation.
May 16, 2021
4bd9095
Additional cleanup.
May 16, 2021
c063216
Organized security and services APIs.
May 16, 2021
e21fb33
Additional winnt.h and fileapi.h changes.
May 16, 2021
28b44df
Grouped WinRT APIs by header.
May 16, 2021
ff4fc82
Fixed typo.
May 16, 2021
81f6611
Moved input APIs under winuser.h.
May 16, 2021
c3a104c
Moved Recovery and OperationRecorder to winbase.h.
May 17, 2021
2bc0377
Moved HiDpi to respective header regions.
May 17, 2021
14072ae
Grouped more remaps by header and removed a few.
May 17, 2021
9c4d250
Merged duplicate combaseapi.h region.
May 17, 2021
2d55840
Merge branch 'master' into user/mikebattista/namespaces
May 18, 2021
b73f91e
Updated the baseline.
May 18, 2021
8d78ccc
Merge branch 'master' into user/mikebattista/namespaces
May 18, 2021
0818c6d
Fixed script conflict and updated the baseline.
May 18, 2021
73dae14
Merge branch 'master' into user/mikebattista/namespaces
May 18, 2021
cc74484
Updated the baseline.
May 18, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,14 @@ Partitions are defined as [folders](generation/scraper/Partitions) with [main.cp
* [main.cpp](generation/scraper/Partitions/Registry/main.cpp) contains `#include` statements like you would use to call the APIs directly. This typically includes the header files to be associated with the partition as well as any other dependent headers, included in the proper order.
* [settings.rsp](generation/scraper/Partitions/Registry/settings.rsp) associates a list of header files to a namespace. Reference existing [partitions](generation/scraper/Partitions) to understand the template for this file. The important sections are `--traverse`, which lists the header files to include, and `--namespace` which lists the namespace to associate with the content of those header files. Note that headers should be listed alphabetically by convention, and the casing needs to match the casing of the filenames.

You can test localized changes to a partition by running `./scripts/GenerateMetadataSourceForPartition.ps1 -PartitionName <PARTITION>` from the repo root. If it compiles, the changes are likely correct. A common reason for failure is main.cpp either doesn't include all the necessary dependent headers needed to use the target headers or doesn't include them in the proper order.
You can test localized changes to a partition by running `./scripts/GenerateMetadataSourceForPartition.ps1 <PARTITION>` from the repo root. If it compiles, the changes are likely correct. A common reason for failure is main.cpp either doesn't include all the necessary dependent headers needed to use the target headers or doesn't include them in the proper order.

### Split a header file among multiple namespaces

If a header file doesn't cleanly map to one namespace, it should be associated with a partition and namespace that makes sense for the majority of its APIs (using the steps above for a single namespace), and then the rest of the APIs should be manually remapped using [requiredNamespacesForNames.rsp](generation/emitter/requiredNamespacesForNames.rsp). This file contains one line per API and follows the format `<API>=<NAMESPACE>`. It is a single file that is shared across all partitions.

For maintainability, it is important to keep [requiredNamespacesForNames.rsp](generation/emitter/requiredNamespacesForNames.rsp) organized with APIs grouped by header files. APIs should be added within `# region <HEADER>` sections based on the header files where they are defined. APIs within a `# region` should be sorted alphabetically by selecting them and then using Visual Studio Code's `Sort Lines Ascending` command.

### Refactoring namespaces

Note that when refactoring namespaces, [requiredNamespacesForNames.rsp](generation/emitter/requiredNamespacesForNames.rsp) will take precedence over any namespaces declared in the partitions, so make sure it doesn't contain remappings that will conflict with the expected factoring from the partitions. For example, if you create a new Registry partition to assign everything in winreg.h to Windows.Win32.System.Registry, but [requiredNamespacesForNames.rsp](generation/emitter/requiredNamespacesForNames.rsp) was previously updated to map Reg* APIs to a different namespace, you won't achieve the desired result unless you remove the Reg* entries from [requiredNamespacesForNames.rsp](generation/emitter/requiredNamespacesForNames.rsp).
Expand Down Expand Up @@ -129,7 +131,7 @@ The simplest but slowest way to validate changes is to perform a full build with

### Incremental builds

If you have already performed a full build and are making incremental changes, you can effectively perform incremental builds by running `./scripts/GenerateMetadataSourceForPartition.ps1 -PartitionName <PARTITION>` for each impacted `<PARTITION>`, and then build and test the winmd by running `./scripts/BuildMetadataBin.ps1 && ./scripts/TestWinmdBinary.ps1`. If you are only making changes to the [emitter](./generation/emitter), then you don't need to regenerate the partitions and can just rebuild the winmd.
If you have already performed a full build and are making incremental changes, you can effectively perform incremental builds by running `./scripts/GenerateMetadataSourceForPartition.ps1 <PARTITION>` for each impacted `<PARTITION>`, and then build and test the winmd by running `./scripts/BuildMetadataBin.ps1 && ./scripts/TestWinmdBinary.ps1`. If you are only making changes to the [emitter](./generation/emitter), then you don't need to regenerate the partitions and can just rebuild the winmd.

Note that stale artifacts on your system may sometimes result in cryptic errors when attempting incremental builds. If you do encounter cryptic errors during incremental builds that you suspect are the result of previously built changes, reset your system state by running a clean build with `./DoAll.ps1 -Clean`.

Expand Down
5 changes: 4 additions & 1 deletion generation/emitter/manual/Security.manual.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,13 @@ public enum TOKEN_ACCESS_MASK : uint
TOKEN_ADJUST_SESSIONID = (0x0100),
TOKEN_ALL_ACCESS = (Windows.Win32.Storage.FileSystem.FILE_ACCESS_FLAGS.STANDARD_RIGHTS_REQUIRED | TOKEN_ASSIGN_PRIMARY | TOKEN_DUPLICATE | TOKEN_IMPERSONATE | TOKEN_QUERY | TOKEN_QUERY_SOURCE | TOKEN_ADJUST_PRIVILEGES | TOKEN_ADJUST_GROUPS |TOKEN_ADJUST_DEFAULT)
}
}

namespace Windows.Win32.Security.Cryptography.Core
{
public static unsafe partial class Apis
{
// Has to be int so it can be used in a shift
public const int CERT_COMPARE_SHIFT = 16;
}
}
}
Loading