Click here to Skip to main content
15,886,085 members
Articles / Desktop Programming / ATL

Shell Extensions for .NET Assemblies

Rate me:
Please Sign up or sign in to vote.
4.98/5 (29 votes)
17 Nov 2005Ms-PL3 min read 184.1K   2.6K   81  
Shell extensions to distinguish between .NET assemblies and Win32 applications and libraries.
// AsmShell.idl : IDL source for AsmShell
//

// This file will be processed by the MIDL tool to
// produce the type library (AsmShell.tlb) and marshalling code.

import "oaidl.idl";
import "ocidl.idl";

[
	uuid(D57A5491-DE35-4566-936C-7EE0B4B4CEFB),
	helpstring("The file types supported by this library.")
]
typedef enum FileType
{
	[helpstring("Win32 Executable (x86)")] Win32Executable,
	[helpstring("Win32 Library (x86)")] Win32Library,
	[helpstring(".NET Executable (x86)")] DotNETExecutable,
	[helpstring(".NET Library (x86)")] DotNETLibrary,
	[helpstring(".NET Module (x86)")] DotNETModule,
	[helpstring("Win64 Executable (ia64)")] Win64ExecutableIA64,
	[helpstring("Win64 Library (ia64)")] Win64LibraryIA64,
	[helpstring(".NET Executable (ia64)")] DotNETExecutableIA64,
	[helpstring(".NET Library (ia64)")] DotNETLibraryIA64,
	[helpstring(".NET Module (ia64)")] DotNETModuleIA64,
	[helpstring("Win64 Executable (x64)")] Win64ExecutableX64,
	[helpstring("Win64 Library (x64)")] Win64LibraryX64,
	[helpstring(".NET Executable (x64)")] DotNETExecutableX64,
	[helpstring(".NET Library (x64)")] DotNETLibraryX64,
	[helpstring(".NET Module (x64)")] DotNETModuleX64,
	[helpstring("Other")] Other = -1
} FileType;
[
	uuid(B0C8ED7E-AAE0-4CE5-863D-E7D0D936E2D7),
	dual,
	object,
	nonextensible,
	oleautomation,
	pointer_default(unique),
	helpstring("IAssemblyInfo Interface")
]
interface IAssemblyInfo : IDispatch{
	[id(1), helpstring("Determines whether a given file is a .NET assembly.")]
	HRESULT IsAssembly([in] BSTR path, [out, retval] VARIANT_BOOL* retVal);
	[id(2), helpstring("Gets the file type for the file.")]
	HRESULT GetFileType([in] BSTR path, [out,retval] FileType* retVal);
	[id(3), helpstring("Gets the public key token for the assembly.")]
	HRESULT GetPublicKeyToken([in] BSTR path, [out,retval] BSTR* retVal);
	[id(4), helpstring("Gets the public key for the assembly.")]
	HRESULT GetPublicKey([in] BSTR path, [out,retval] SAFEARRAY(BYTE)* retVal);
};
[
	uuid(77BAD216-EFD7-43f9-922B-B4C802976858),
	lcid(0x0), // Neutral
	version(1.4),
	helpstring("Assembly Information Type Library")
]
library AsmShellLib
{
	importlib("stdole2.tlb");
	[
		uuid(0B95CAF4-642E-4D55-A265-432D64C4F62A),
		helpstring("AssemblyInfo Class")
	]
	coclass AssemblyInfo
	{
		[default] interface IAssemblyInfo;
	};
};

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)


Written By
Software Developer Microsoft
United States United States
Principal Software Engineer currently working on Azure SDKs at Microsoft. My opinions are my own. I work on a number of OSS projects for work and personally in numerous languages including C++, C#, JavaScript, Go, Rust, et. al. See a problem, fix a problem (or at least create an issue)!

Avid outdoor adventurer 🏔️❄️👞🚴‍♂️, husband, father.

Comments and Discussions