Shell namespace extension registry on windows 10 IOT enterprise

680 views Asked by At

I am creating a virtual folder with shell namespace extension on windows 10 IOT enterprise. The code I am using come from windows 7 SDK samplesm which is provided by microsoft. Here is the whole project: https://github.com/pauldotknopf/WindowsSDK7-Samples/tree/master/winui/shell/shellextensibility/explorerdataprovider

This project runs perfectly on windows 7 and windows 10, but after run "regsvr32 explorerdataprovider.dll" on windows 10 iot enterprise, the virtual folder icon does show up under "my computer", but after I double click the icon, nothing happens. enter image description here

so I debug into that and found out the function DllGetClassObject is never being called. My guess is that the windows 10 iot enterprise registry for shell namespace extension is different with windows 10, so I searched online to try to add enough registry key, so far the registry I am using is:

 REGSTRUCT rgRegEntries[] =
{
    HKEY_CURRENT_USER,   L"Software\\Classes\\CLSID\\%s",                  szFolderViewImplClassID, NULL,                   (LPBYTE)g_szExtTitle,       REG_SZ,
    HKEY_CURRENT_USER,   L"Software\\Classes\\CLSID\\%s\\InprocServer32",  szFolderViewImplClassID, NULL,                   (LPBYTE)L"%s",              REG_SZ,
    HKEY_CURRENT_USER,   L"Software\\Classes\\CLSID\\%s\\InprocServer32",  szFolderViewImplClassID, L"ThreadingModel",      (LPBYTE)L"Apartment",       REG_SZ,
    HKEY_CURRENT_USER,   L"Software\\Classes\\CLSID\\%s\\DefaultIcon",     szFolderViewImplClassID, NULL,                   (LPBYTE)L"shell32.dll,-42", REG_SZ,
    HKEY_CURRENT_USER,   L"Software\\Classes\\CLSID\\%s\\ShellFolder",     szFolderViewImplClassID, L"Attributes",          (LPBYTE)&dwData,            REG_DWORD,
    HKEY_CURRENT_USER,   L"Software\\Classes\\CLSID\\%s",                  szContextMenuClassID,    NULL,                   (LPBYTE)g_szExtTitle,       REG_SZ,
    HKEY_CURRENT_USER,   L"Software\\Classes\\CLSID\\%s\\InprocServer32",  szContextMenuClassID,    NULL,                   (LPBYTE)L"%s",              REG_SZ,
    HKEY_CURRENT_USER,   L"Software\\Classes\\CLSID\\%s\\InprocServer32",  szContextMenuClassID,    L"ThreadingModel",      (LPBYTE)L"Apartment",       REG_SZ,

    HKEY_CLASSES_ROOT, L"CLSID\\%s", szFolderViewImplClassID, NULL, (LPBYTE)g_szExtTitle, REG_SZ,
    HKEY_CLASSES_ROOT, L"CLSID\\%s\\InprocServer32", szFolderViewImplClassID, NULL, (LPBYTE)L"%s", REG_SZ,
    HKEY_CLASSES_ROOT, L"CLSID\\%s\\InprocServer32", szFolderViewImplClassID, L"ThreadingModel", (LPBYTE)L"Apartment", REG_SZ,
    HKEY_CLASSES_ROOT, L"CLSID\\%s\\DefaultIcon", szFolderViewImplClassID, NULL, (LPBYTE)L"%s,0", REG_SZ,
    HKEY_CLASSES_ROOT, L"CLSID\\%s\\ShellFolder", szFolderViewImplClassID, L"Attributes", (LPBYTE)&dwData, REG_DWORD,

    ////----------------------------------------------------------------------------------------
    HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\%s",szFolderViewImplClassID, NULL,                   (LPBYTE)g_szExtTitle,       REG_SZ,
    HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\DelegateFolders\\%s",szFolderViewImplClassID, NULL,                   (LPBYTE)g_szExtTitle,       REG_SZ,

    HKEY_CURRENT_USER, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\%s",szFolderViewImplClassID, NULL,                   (LPBYTE)g_szExtTitle,       REG_SZ,

    //HKEY_LOCAL_MACHINE, L"\\%s",szFolderViewImplClassID, NULL,                   (LPBYTE)g_szExtTitle,       REG_SZ,

    HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved",szFolderViewImplClassID, NULL,                   (LPBYTE)g_szExtTitle,       REG_SZ,

    ////----------------------------------------------------------------------------------------
    // For performance, only context menu verbs that register this are considered when the user double-clicks.
    HKEY_CURRENT_USER,   L"Software\\Classes\\CLSID\\%s\\ShellEx\\MayChangeDefaultMenu",                szContextMenuClassID, NULL,  (LPBYTE)L"",                  REG_SZ,
    // register the context menu handler under the FolderViewSampleType type.
    HKEY_CURRENT_USER,   L"Software\\Classes\\FolderViewSampleType\\shellex\\ContextMenuHandlers\\%s",  szContextMenuClassID, NULL,  (LPBYTE)szContextMenuClassID, REG_SZ,
};

But it still doesn't work.

Is there any registry key for shell namespace extension for virtul folder is missing ?

1

There are 1 answers

0
Eric On

Not sure if this will help, but there are 2 locations in the registry for virtual folders (they have very similar paths, so it's easy to miss):

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace

Also, on Win10 x64, don't forget to add your virtual folder to the WOW6432Node equivalent:

HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace
HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace