Discuss this help topic in CBFS Forum

CallbackFileSystem.GetOriginatorProcessName method


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

CallbackFileSystem     See also    


Returns the name of the process, that initiated the operation


    function GetOriginatorProcessName( var ProcessName : TCBString) : boolean;
    type TCBString = {$ifdef UNICODE}UnicodeString{$else}WideString{$endif};

[C++ (Lib)]
    bool GetOriginatorProcessName( wchar_t * ProcessName, unsigned long * ProcessNameLength);

[C++ (VCL)]
    bool __fastcall GetOriginatorProcessName( TCBString & ProcessName);

[C++ (.NET)]
    bool GetOriginatorProcessName( String& ProcessName);

    bool GetOriginatorProcessName( ref String ProcessName);

    Function GetOriginatorProcessName( ByRef ProcessName As String) As Boolean

    boolean getOriginatorProcessName( stringRef processName);


  • ProcessName - On return this parameter contains the name of the process.
  • [C++ (Lib)]ProcessNameLength - The length of the buffer to store the name of the process.

Return values

TRUE / true if the function succeeded or FALSE / false if the function failed.


Use GetOriginatorProcessName to get the name of the process that originated the operation.

Call this method only from the callback / event handlers.

Do not call this method from handlers for OnReadFile, OnWriteFile and other callbacks that work with opened files, as that callbacks can be initiated by the system components (cache manager, memory manager etc.). Instead do the following:

  1. Call GetOriginatorProcessName from OnCreateFile or OnOpenFile event handlers / callbacks;
  2. Store obtained information somewhere and store the reference to this information in the UserContext;
  3. When you need to check the originator information in some file-related callback, access the stored information via UserContext

[C++ (Lib)] Allocate the buffer for ProcessName in your code and pass the reference to the buffer via ProcessName parameter.

Network access
If you share the created virtual disk, you might want to get the name of the remote process, which accesses the virtual disk. Unfortunately Windows does not provide such information.

Call from...

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

See also

GetOriginatorProcessId     GetOriginatorToken    

Discuss this help topic in CBFS Forum