Introduction

edit

The Meziantou.Framework.Win32.* packages give .NET applications access to Windows features that the base class library does not cover. Each package wraps one Windows API behind a small, typed .NET API: you never declare a P/Invoke or a COM interface yourself.

The packages are Windows-only. They compile in any .NET project, but their methods only work when the application runs on Windows. See Getting started for how to call them from a cross-platform application.

What you can do with them

  • Inspect and adjust the security context of a process: elevation, groups, integrity level and privileges. See Access tokens.
  • Scan content for malware with the antimalware product installed on the machine before using it. See Antimalware scanning.
  • Find the files that changed on a volume without scanning it, from the NTFS change journal. See Change journal.
  • Store passwords and tokens in the Windows Credential Manager, and ask the user for credentials. See Credential Manager.
  • Let the user pick a folder with the modern Windows folder dialog. See Folder dialog.
  • Manage a group of processes as a unit: terminate the child processes when the application exits, and limit their memory, CPU and IO. See Job objects.
  • Store machine secrets in the Local Security Authority. See LSA private data.
  • Tell whether a file was downloaded from the Internet, and mark the files you download. See Mark of the Web.
  • Classify files as text, image, audio, video and so on, from their extension. See Perceived types.
  • Show virtual files and folders whose content your application provides on demand. See Projected file system.
  • Add documents to Recent Items and Jump Lists. See Recent documents.
  • Find which processes lock a file, and close and restart them. See Restart Manager.

Packages

PackageMain typesPage
Meziantou.Framework.Win32.AccessTokenAccessToken, SecurityIdentifier, PrivilegesAccess tokens
Meziantou.Framework.Win32.AmsiAmsiContext, AmsiSession, AmsiResultAntimalware scanning
Meziantou.Framework.Win32.ChangeJournalChangeJournal, ChangeJournalEntry, UsnChange journal
Meziantou.Framework.Win32.CredentialManagerCredentialManager, CredentialCredential Manager
Meziantou.Framework.Win32.DialogsOpenFolderDialogFolder dialog
Meziantou.Framework.Win32.JobsJobObject, JobObjectLimitsJob objects
Meziantou.Framework.Win32.LsaLsaPrivateDataLSA private data
Meziantou.Framework.Win32.MarkOfTheWebMarkOfTheWeb, ZoneIdentifier, UrlZoneMark of the Web
Meziantou.Framework.Win32.PerceivedTypePerceived, PerceivedTypePerceived types
Meziantou.Framework.Win32.ProjectedFileSystemProjectedFileSystemBase, ProjectedFileSystemEntryProjected file system
Meziantou.Framework.Win32.RecentDocumentsRecentDocumentsRecent documents
Meziantou.Framework.Win32.RestartManagerRestartManager, RestartManagerProcessInfoRestart Manager

Each package is independent: install only the ones you need. WPF applications can also use the WPF package, which provides commands, markup extensions and converters.

Next steps

  • Getting started: install a package and call it safely from an application that also runs on Linux or macOS.