FsRtlDissectDbcs 函数 (ntifs.h)

给定 ANSI 或双字节字符集 (DBCS) pathname 字符串, FsRtlDissectDbcs 例程返回两个字符串:一个包含字符串中找到的第一个文件名,另一个包含路径名字符串的剩余未分析部分。

语法

void FsRtlDissectDbcs(
  [in]  ANSI_STRING  Path,
  [out] PANSI_STRING FirstName,
  [out] PANSI_STRING RemainingName
);

参数

[in] Path

要分析的路径名字符串。

[out] FirstName

指向 pathname 字符串中第一个文件名的指针。

[out] RemainingName

指向 pathname 字符串的剩余未分析部分的指针。

返回值

备注

在输入字符串中,反斜杠作为名称分隔符读取。 假定字符串中的名字由字符串开头到第一个反斜杠前的字符(包括)的所有字符组成。 此规则只有一个例外:如果输入字符串中的第一个字符是反斜杠,则会忽略此字符,并且不会显示在输出字符串中。 字符串的剩余部分由反斜杠后面的所有字符组成,该反斜杠紧跟在字符串中找到的第一个名称之后。

FsRtlDissectDbcs 不检查输入字符串中是否存在非法字符。

下表显示了 FsRtlDissectDbcs 的示例输入和输出值:

路径 FirstName RemainingName
empty empty empty
A A empty
A\B\C\D\E A B\C\D\E
*A? *A? empty
\A A empty
A[,] A[,] empty
A\\B+;\C A \B+;\C
 

请注意,返回时,输出参数的 Buffer 成员将指向 PathBuffer 成员。 因此,调用方不应为两个输出参数的 Buffer 成员分配存储,如以下示例所示:

.
.
.
/*
The FsRtlDissectDbcs routine will set the members
of the following two structures appropriately:
*/
UNICODE_STRING CurrentComponent;
UNICODE_STRING RemainingComponent;

/*
Do not allocate storage for the Buffer members of CurrentComponent
and RemainingComponent in that they will point into the previously
allocated storage of FullPathName's Buffer member:
*/
FsRtlDissectDbcs (FullPathName, &CurrentComponent, &RemainingComponent);
.
.
.

有关其他字符串处理例程的信息,请参阅 运行时库 (RTL) 例程

要求

要求
最低受支持的客户端 Windows 2000
目标平台 通用
标头 ntifs.h (包括 FltKernel.h、Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL <= APC_LEVEL

另请参阅

ANSI_STRING