FsRtlDissectDbcs 函式 (ntifs.h)

假設有 ANSI 或雙位元組字元集 (DBCS) pathname 字串, FsRtlDissectDbcs 例程會傳回兩個字符串:一個包含字元串中找到的第一個檔名,另一個包含 pathname 字串的其餘未剖析部分。

語法

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

參數

[in] Path

要剖析的路徑名稱字串。

[out] FirstName

pathname 字串中第一個檔名的指標。

[out] RemainingName

路徑名稱字串剩餘未剖析部分的指標。

傳回值

備註

在輸入字串中,反斜杠會讀取為名稱分隔符。 假設字串中的名字包含字串開頭到第一個反斜杠前面的字元的所有字元。 此規則只有一個例外:如果輸入字串中的第一個字元是反斜杠,則會忽略此字元,而且不會出現在輸出字串中。 字串的其餘部分是由緊接在字串中找到之名字后的所有字元所組成。

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);
.
.
.

如需其他字串處理程式的資訊,請參閱 Run-Time Library (RTL) 例程

規格需求

需求
最低支援的用戶端 Windows 2000
目標平台 Universal
標頭 ntifs.h (包含 FltKernel.h、Ntifs.h)
程式庫 NtosKrnl.lib
Dll NtosKrnl.exe
IRQL <= APC_LEVEL

另請參閱

ANSI_STRING