Discuss this help topic in CBFS Forum

CbFsHandleInfo.GetCreatorToken method

Filter:

Pascal    C++ (Lib)    C++ (VCL)    C++ (.NET)    C#    VB.NET    Java 

CbFsHandleInfo     See also    

Overview

Returns the security token of the process that opened the file handle

Declaration

[Pascal]
    function GetCreatorToken : THandle;

[C++ (Lib)]
    HANDLE GetCreatorToken();

[C++ (VCL)]
    HANDLE __fastcall GetCreatorToken();

[C++ (.NET)]
    IntPtr GetCreatorToken();

[C#]
    IntPtr GetCreatorToken();

[VB.NET]
    Function GetCreatorToken() As IntPtr

[Java]
    long getCreatorToken();

Return values

Handle to the token if the function succeeded or INVALID_HANDLE_VALUE if the function failed.

Description

Use GetCreatorToken to get the security token of the process that opened the file handle. You can use the security token to retrieve various security-related information using GetTokenInformation() function of Windows API.

NOTE: you must call CloseHandle() function of Windows API to close the obtained token handle.

Network access
If you share the created virtual disk, you might want to get security information (account name etc.) of the network user, who accesses the virtual disk. Disks can be shared in several modes in Windows:

  • First is authenticated mode. In this case the network redirector (the process that receives remote disk requests and directs them to the disk driver) is impersonated to the account of the caller user and GetCreatorToken method will return account information of that caller.
  • Next is guest mode. In this mode GetCreatorToken returns information of GUEST account.
  • Third mode is administrative shares (those that exist by default and are named C$, D$ etc.). For such shares GetCreatorToken returns information of LOCAL_SYSTEM account.

Call from...

This method may be called only from callback / event handlers.

See also

GetCreatorProcessId method     GetCreatorProcessName method     GetOriginatorToken method    

Discuss this help topic in CBFS Forum