EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Solving the problem of Explorer at CBFS5.1.150

Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.
#30126
Posted: 07/23/2014 00:25:15
by Naoki Takami (Standard support level)
Joined: 11/09/2009
Posts: 23

Please let me know the concrete procedure of "adds workaround" for solving the problem of Explorer.
#30127
Posted: 07/23/2014 01:17:48
by Eugene Mayevski (EldoS Corp.)

There's no procedure involved. The broadcast is sent as in previous builds and it's confirmed to work. If this doesn't work for you for whatever reason, the best option is to use BroadcastSystemMessage yourself as in the following code snippet:

Code
#if(_WIN32_WINNT < 0x0501)
typedef struct {
    UINT  cbSize;
    HDESK hdesk;
    HWND  hwnd;
    LUID  luid;
} BSMINFO, *PBSMINFO;
#endif
typedef long (WINAPI *BroadcastSystemMessageExW_Type)( DWORD, LPDWORD, UINT, WPARAM, LPARAM, PBSMINFO );

VOID
STORLIBAPI
StorLibSendSymLinkBroadcastNotification(
    WCHAR DriveLetter,
    BOOL SymLinkCreated
    )
{
    BOOL DosDriveLetter = TRUE;

    if (DriveLetter >= 'A' && DriveLetter <= 'Z')
        DriveLetter -= 'A';
    else if (DriveLetter >= 'a' && DriveLetter <= 'z')
        DriveLetter -= 'a';
    else
        DosDriveLetter = FALSE;

    if (DosDriveLetter) {

        HMODULE hUser32Dll = LoadLibrary(_T("USER32.DLL"));
        if (hUser32Dll) {
        
            BroadcastSystemMessageExW_Type fp = (BroadcastSystemMessageExW_Type)
                GetProcAddress(hUser32Dll, "BroadcastSystemMessageExW");

            ASSERT(fp);
            if (fp) {

                DWORD dwRecipients;
                DEV_BROADCAST_VOLUME dbv;
                BSMINFO bsmi;

                dbv.dbcv_size      = sizeof(dbv);
                dbv.dbcv_devicetype = DBT_DEVTYP_VOLUME;
                dbv.dbcv_reserved   = 0;
                dbv.dbcv_unitmask   = (1 << DriveLetter);
                dbv.dbcv_flags      = DBTF_NET;

                dwRecipients = BSM_APPLICATIONS;

                ZeroMemory(&bsmi, sizeof(bsmi));
                bsmi.cbSize = sizeof(bsmi);

                fp( BSF_FORCEIFHUNG ,
                    &dwRecipients,
                    WM_DEVICECHANGE,
                    (WPARAM)(SymLinkCreated?DBT_DEVICEARRIVAL:DBT_DEVICEREMOVECOMPLETE),
                    (LPARAM)(DEV_BROADCAST_HDR*)&dbv,
                    &bsmi );
            }

            FreeLibrary(hUser32Dll);
        }
    }
}


Sincerely yours
Eugene Mayevski
#30129
Posted: 07/23/2014 02:30:15
by Naoki Takami (Standard support level)
Joined: 11/09/2009
Posts: 23

It is satisfactory if management by CBFS is unnecessary.
Thank you.

Reply

Statistics

Topic viewed 1389 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!