网站首页  词典首页

请输入您要查询的函数:

 

术语 shevaluatesystemcommandtemplate
释义 SHEvaluateSystemCommandTemplate
语法:
HRESULT SHEvaluateSystemCommandTemplate( PCWSTR pszCmdTemplate,
PWSTR *ppszApplication,
PWSTR *ppszCommandLine,
PWSTR *ppszParameters
);
SHEvaluateSystemCommandTemplate功能
强制在一个调用中使用给CreateProcess或ShellExecute参数的严格验证。
参数
pszCmdTemplate
[in]命令行,这可能或可能不包括参数。如果参数替代参数,然后SHEvaluateSystemCommandTemplate应称为参数之前已被替换。
ppszApplication
[内]对核实路径应用的指针。此值应通过作为参数调用lpApplication给CreateProcess或作为一到ShellExecute调用lpFile参数。这种资源分配使用CoTaskMemAlloc,它是调用者的责任,免费资源时,不再需要通过调用CoTaskMemFree。
ppszCommandLine
[内]阿指针的命令行字符串模板,在一个给CreateProcess的调用中使用。命令行参数应该指定基于此模板,然后作为lpCommandLine参数传递给CreateProcess。这是保证的形式是,PathGetArgs总是可以正确读取。这种资源分配使用CoTaskMemAlloc,它是调用者的责任,免费资源时,不再需要通过调用CoTaskMemFree。
此参数可以为NULL,如果此功能不被使用的关联,以调用CreateProcess。
ppszParameters
[内]阿指针的命令行字符串模板将在1到ShellExecute调用中使用。命令行参数应该指定基于此模板,然后作为lpParameters参数到ShellExecute通过。此参数是相同的呼吁PathGetArgs。这种资源分配使用CoTaskMemAlloc,它是调用者的责任,免费资源时,不再需要通过调用CoTaskMemFree。
此参数可以为NULL,如果此功能不被使用的关联,以调用CreateProcess。
返回值
返回S_OK如果成功,或其他错误值。
备注
此函数调用时使用过程中需要从命令确定性的行为模板,不管执行上下文。它无视诸如%路径%,GetCurrentDirectory当前进程的状态,和父进程的目录。
此功能时使用的命令是硬编码。
该函数使用ShellExecute从HKEY_CLASSES_ROOT在处理文件关联。这个函数的目的是为了减少CreateProcess的命令行攻击。它不是设计用于处理用户输入,如果用于这一目的可以产生意想不到的失败。
功能信息
最低DLL版本 Shell32.dll
自定义ImplementationNo
Headershellapi.h
import libraryNone
最低支持操作系统 Vista
==英文原文==SHEvaluateSystemCommandTemplate Function
Enforces strict validation of parameters used in a call to CreateProcess or ShellExecute .
Syntax
HRESULT SHEvaluateSystemCommandTemplate( PCWSTR pszCmdTemplate,
PWSTR *ppszApplication,
PWSTR *ppszCommandLine,
PWSTR *ppszParameters
);
Parameters
pszCmdTemplate
[in] A command line, which may or may not include parameters. If the parameters are substitution parameters, then SHEvaluateSystemCommandTemplate should be called before parameters have been replaced.
ppszApplication
[out] A pointer to the verified path to the application. This value should be passed as the lpApplication parameter in a call to CreateProcess or as the lpFile parameter in a call to ShellExecute. This resource is allocated using CoTaskMemAlloc , and it is the responsibility of the caller to free the resource when it is no longer needed by calling CoTaskMemFree .
ppszCommandLine
[out] A pointer to a command-line string template to be used in a call to CreateProcess. Command-line parameters should be specified based on this template, and then passed as the lpCommandLine parameter to CreateProcess. It is guaranteed to be of a form that PathGetArgs can always read correctly. This resource is allocated using CoTaskMemAlloc, and it is the responsibility of the caller to free the resource when it is no longer needed by calling CoTaskMemFree.
This parameter can be NULL if this function is not being used in association with a call to CreateProcess.
ppszParameters
[out] A pointer to a command-line string template to be used in a call to ShellExecute. Command-line parameters should be specified based on this template, and then passed as the lpParameters parameter to ShellExecute. This parameter is identical to calling PathGetArgs. This resource is allocated using CoTaskMemAlloc, and it is the responsibility of the caller to free the resource when it is no longer needed by calling CoTaskMemFree.
This parameter can be NULL if this function is not being used in association with a call to CreateProcess.
Return Value
Returns S_OK if successful, or an error value otherwise.
Remarks
This function is used when a calling process needs the deterministic behavior from a command template, regardless of execution context. It ignores the current process state, such as the %PATH%, GetCurrentDirectory , and parent process directory.
This function is used when the command is hard-coded.
This function is used by ShellExecute when handling file associations from HKEY_CLASSES_ROOT. The purpose of this function is to reduce CreateProcess command-line exploits. It is not designed for processing user input and if used for that purpose can generate unexpected failures.
Function Information
Minimum DLL VersionShell32.dll
Custom ImplementationNo
Headershellapi.h
Import libraryNone
Minimum operating systemsWindows Vista
==原始网址==http://msdn.microsoft.com/en-us/library/bb762162(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:22:43