manifest是什么文件

manifest是什么文件,第1张

manifest为一种软件,属于毕告AndroidManifest.xml文件,在简单的Android系统的应用中提出了重要的信息,它可以运行任何应用程序的代码。

MANIFEST.MF:这个manifest文件定义了与扩展和包相关的数据。单词“manifest”的意思是“显示”。

打开Java的JAR文件经常可以看到文件中包含着一个META-INF目录,这个目录下会有一些文件,其中必有一个MANIFEST.MF,这个文件描述了该Jar文件的很多信息。

扩颤岩展资料

每个安卓应用程序必须有一个AndroidManifest.xml文件,在app/manifests目录中。它在简单的Android系统的应用中提出了重要的信息,信息系统必须具备之前,它可以运行任何应用程序的代码。

除其他事项外,清单中执行下列 *** 作:

它给应用程序的Java包命名,包的名称作为应用程序的唯一标识符。

它描述了应用程序的组件的活动、服务,广播接收机,内容提供商,应用程序组成。它命名的类,实现每个组件,并出版自己的能力(例如,可以处理哪些意图的消息)。这些声明让Android系统知道这些组件是什么和在什么条件下,他们可以推出。

它决定哪些进程将运行应用程序组件。它决定了应用程序必须有权限才能访问受保护茄数御的API部分,并与其他应用程序进行交互。它还决定了其他人与应用程序的组件交互所需要的权限。它宣布了Android API的应用程序需要的最低水平。

参考资料来源:百度百科-manifest

参考资料来源:百度百科-MANIFEST.MF

manifest 指程序清单激穗,包含了程序所需要的资源.你所说的文件,是指微软的visual c++ 运行库,.dll结尾明伏卜的程厅并序,.manifest结尾的是程序的清单,例如Microsoft.VC80.CRT.dll对应清单是Microsoft.VC80.CRT.manifest.类似如此的

英文的,很详细,来自MSDN

RCDATA resource

Defines a raw data resource for an application. Raw data resources permit the inclusion of binary data directly in the executable file.

nameID RCDATA [optional-statements] {raw-data ...}

Parameters

nameID

Unique name or a 16-bit unsigned integer value that identifies the resource.

optional-statements

This parameter can be zero or more of the following statements.

Statement Description

CHARACTERISTICS dword User-defined information about a resource that can be used by tools that read and write resource files. For more information, see CHARACTERISTICS.

LANGUAGE language, sublanguage Language for the resource. For more information, see LANGUAGE.

VERSION dword User-defined version number for the resource that can be used by tools that read and write resource files. For more information, see VERSION.

raw-data

Raw data consisting of one or more integers or strings of characters. Integers can be specified in decimal, octal, or hexadecimal format. To be compatible with 16-bit Windows, integers are stored as WORD values. You can store an integer as a DWORD value by qualifying the integer with the "L" suffix.

Strings are enclosed in quotation marks. RC does not automatically append a terminating null character to a string. Each string is a sequence of the specified ANSI characters, unless you qualify it as a wide-character string with the L prefix.

The block of data begins on a DWORD boundary and RC performs no padding or alignment of data within the raw-data block. It is your responsibility to ensure the proper alignment of data within the block.

Certain attributes are also supported for backward compatibility. For more information, see Common Resource Attributes.

Examples

The following example demonstrates the use of the RCDATA statement:

resname RCDATA

{

"Here is an ANSI string\0",// explicitly null-terminated

L"Here is a Unicode string\0", // explicitly null-terminated

1024, // integer, stored as WORD

7L,// integer, stored as DWORD

0x029a,// hex integer

0o733, // octal integer

}

=====================================

RT_MANIFEST

Since Windows XP, Windows reserves a new type of resource RT_MANIFEST for SxS manifests.

Within the RT_MANIFEST resource, Windows reserves ID 1-16. A binary cannot have two IDs of resource type RT_MANIFEST within 1-16. Windows will refuse to load such binary in Windows XP/Windows Server 2003.

Only three IDs are used today in Windows.

excerpt from Winuser.h

#define RT_MANIFESTMAKEINTRESOURCE(24)

#define CREATEPROCESS_MANIFEST_RESOURCE_ID MAKEINTRESOURCE( 1)

#define ISOLATIONAWARE_MANIFEST_RESOURCE_ID MAKEINTRESOURCE(2)

#define ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID MAKEINTRESOURCE(3)

#define MINIMUM_RESERVED_MANIFEST_RESOURCE_ID MAKEINTRESOURCE( 1 /*inclusive*/)

#define MAXIMUM_RESERVED_MANIFEST_RESOURCE_ID MAKEINTRESOURCE(16 /*inclusive*/)

CREATEPROCESS_MANIFEST_RESOURCE_ID

CREATEPROCESS_MANIFEST_RESOURCE_ID is used primarily for EXEs. If an executable has a resource of type RT_MANIFEST, ID CREATEPROCESS_MANIFEST_RESOURCE_ID, Windows will create a process default activation context for the process. The process default activation context will be used by all components running in the process.

CREATEPROCESS_MANIFEST_RESOURCE_ID can also used by DLLs. When Windows probe for dependencies, if the dll has a resource of type RT_MANIFEST, ID CREATEPROCESS_MANIFEST_RESOURCE_ID, Windows will use that manifest as the dependency.

ISOLATIONAWARE_MANIFEST_RESOURCE_ID

ISOLATIONAWARE_MANIFEST_RESOURCE_ID is used primarily for DLLs. It should be used if the dll wants private dependencies other than the process default. For example, if an dll depends on comctl32.dll version 6.0.0.0. It should have a resource of type RT_MANIFEST, ID ISOLATIONAWARE_MANIFEST_RESOURCE_ID to depend on comctl32.dll version 6.0.0.0, so that even if the process executable wants comctl32.dll version 5.1, the dll itself will still use the right version of comctl32.dll.

When LoadLibrary is called, before loading the dependencies of the dll, the NT library loader checks to see if the dll has a resource of type RT_MANIFEST, ID ISOLATIONAWARE_MANIFEST_RESOURCE_ID. If it does, the loader calls CreateActCtx with the resource, and use the generated activation context to probe the dll's static dependencies. This is reason why the dll can have private dependencies with the ISOLATIONAWARE_MANIFEST_RESOURCE_ID resource.

The activation context created during LoadLibrary is stored in the loader data structure tracking the dll.

Normally this activation context is used only during LoadLibrary, for the dll's static dependencies.

Sometimes, you want to use the activation context outside of probing the dll's static dependencies. You can define macro ISOLATION_AWARE_ENABLED when you compile the module.

ISOLATION_AWARE_ENABLED

When ISOLATION_AWARE_ENABLED is defined, Windows re-defines certain APIs. For example LoadLibraryExW is redefined to IsolationAwareLoadLibraryExW.

When IsolationAwareLoadLibraryExW is first called, it tries to retrieve the activation context stored in the loader data structure when the calling library is loaded. If the library does not have such activation context (for example, the library does not have a manifest of id ISOLATIONAWARE_MANIFEST_RESOURCE_ID), IsolationAwareLoadLibraryExW tries to create a new activation context with the calling library with id ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID MAKEINTRESOURCE. If the creation fails, IsolationAwareLoadLibraryExW will use the process default activation context.

Once the activation context is determined, IsolationAwareLoadLibraryExW will call ActivateActCtx on the activation context, call the real API (LoadLibraryExW), and on return, it calls DeactivationActCtx. This way, the correct activation context is automatically used.

Not all APIs affected by activation context are wrapped. For example, GetModuleHandleEx is not wrapped, and neither is any of the COM APIs. For a complete list of APIs wrapped by ISOLATION_AWARE_ENABLED, check your copy of Windows SDK.

C:\Program Files\Microsoft SDKs\Windows\v6.0\Include>dir *.inl

Volume in drive C has no label.

Volume Serial Number is ECD1-6DB0

Directory of C:\Program Files\Microsoft SDKs\Windows\v6.0\Include

10/30/2006 01:44 AM 159,222 commctrl.inl

10/30/2006 01:44 AM32,836 commdlg.inl

10/30/2006 01:44 AM12,065 prsht.inl

10/30/2006 01:44 AM23,430 WinBase.Inl

10/30/2006 01:44 AM36,308 WinUser.Inl

If the APIs you use are not wrapped by ISOLATION_AWARE_ENABLED, you have to do the activation/deactivation yourself properly. You can use the C++ helper class described in MSDN http://msdn2.microsoft.com/en-us/library/aa375197.aspx.

For more information, please see MSDN section about Sxs Isolated Applications and Side-by-side Assemblies.


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/tougao/8227575.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-14
下一篇 2023-04-14

发表评论

登录后才能评论

评论列表(0条)

保存