~~Title: Namespace Creation~~ Once Directory Opus has determined that your plugin can handle a file or path, it will //instantiate// your plugin - that is, Opus will ask your plugin to create a unique instance that can be used separately and asynchronously from any other instance of your plugin. Don't forget that Opus is highly multi-threaded. The user may be using your plugin to access multiple archives or virtual namespaces simultaneously - operations such as file copying may be proceeding in the background while the user is browsing a folder in another Lister. **//Above all else, your plugin must be thread-safe!//** The function responsible for plugin namespace instantiation is [[.exported_functions_reference:vfs_create|VFS_Create]]. HANDLE VFS_Create(LPGUID pGUID, HWND hwndMsgWindow) Opus calls this function to create an instance of your plugin. The **pGUID** parameter will point to the GUID representing the format Opus is instantiating your plugin for. If you have not used the **VFSF_MULTIPLEFORMATS** flag then this will always be the GUID you provided to the [[.exported_functions_reference:vfs_identify|VFS_Identify]] function. If, however, you are using the multiple formats interface, this will be the GUID that your [[.exported_functions_reference:vfs_querypath|VFS_QueryPath]] function returned when it indicated that it could handle a file or path. You should check the GUID provided to determine which plugin interface you need to instantiate. The **hwndMsgWindow** parameter provides a window handle that you can save and use for communication with Directory Opus. Currently this parameter is unused. When your [[.exported_functions_reference:vfs_create|VFS_Create]] function is called, you should allocate and initialize whatever private data structure or class you need to identify an instance of the indicated format. This structure should be cast to a **HANDLE** and returned to Opus. Directory Opus will pass this value in every call to practically every other function in your plugin. Another function exists that Opus sometimes uses to instantiate your plugin - [[.exported_functions_reference:vfs_clone|VFS_Clone]]. This is fundamentally identical to [[.exported_functions_reference:vfs_create|VFS_Create]] and in fact you do not need to provide a [[.exported_functions_reference:vfs_clone|VFS_Clone]] function at all. However, Opus often needs to make "clones" of existing namespaces - for example, when you select a file in a Lister and click Copy, Opus launches a new thread which makes a clone of the primary namespace that is used by the Lister to display the folder. The [[.exported_functions_reference:vfs_clone|VFS_Clone]] function is passed the **HANDLE** value representing the existing namespace instance, and you should implement the [[.exported_functions_reference:vfs_clone|VFS_Clone]] function if you feel you can make a new namespace instance more efficiently if you are given a pointer to an existing one. If [[.exported_functions_reference:vfs_clone|VFS_Clone]] is not implemented by a plugin Opus simply creates a brand new instance using [[.exported_functions_reference:vfs_create|VFS_Create]]. Directory Opus calls the [[.exported_functions_reference:vfs_destroy|VFS_Destroy]] function to allow you to free your data once it is finished with an instance of your plugin.