~ubuntu-branches/ubuntu/saucy/filezilla/saucy-proposed

« back to all changes in this revision

Viewing changes to src/fzshellext/shellext.cpp

  • Committer: Package Import Robot
  • Author(s): Adrien Cunin
  • Date: 2012-12-07 17:17:17 UTC
  • mfrom: (1.1.31)
  • Revision ID: package-import@ubuntu.com-20121207171717-nt6as62u4pa1uv11
Tags: 3.6.0.2-1ubuntu1
* Merge from Debian experimental. Remaining Ubuntu change:
   - Added debian/patches/11_use-decimal-si-by-default.patch in order to
     comply with UnitsPolicy

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
#define _UNICODE
6
6
#endif
7
7
 
 
8
 
8
9
//---------------------------------------------------------------------------
9
10
#ifdef _MSC_VER
10
11
        #include <objbase.h>
11
12
        #define snprintf _snprintf
12
 
        
13
 
        // The decision what will get exported is done using fzshellext.def 
 
13
 
 
14
        // The decision what will get exported is done using fzshellext.def
14
15
        #define STDEXPORTAPI STDAPI
15
16
#else
16
17
        #define STDEXPORTAPI extern "C" __declspec(dllexport) HRESULT STDAPICALLTYPE
17
18
 
18
 
        // Currently, the MinGW w32api has no unicode version of ICopyHook. As such,
 
19
        #include <config.h>
 
20
#if !HAVE_ICOPYHOOKW
 
21
        // Some versions of the MinGW w32api have no unicode version of ICopyHook. As such,
19
22
        // declare ICopyHookW manually.
20
23
 
21
24
        // Use some #define magic to prevent LPCOPYHOOK being declared
33
36
        };
34
37
        #undef INTERFACE
35
38
        typedef ICopyHookW *LPCOPYHOOK;
 
39
#endif // !HAVE_ICOPYHOOKW
36
40
 
37
41
#endif
38
42
 
58
62
        { \
59
63
                DebugW(MSG); \
60
64
        }
61
 
        
 
65
 
62
66
//---------------------------------------------------------------------------
63
67
#define DRAG_EXT_REG_KEY _T("Software\\FileZilla 3\\fzshellext")
64
68
#define DRAG_EXT_REG_KEY_PARENT _T("Software\\FileZilla 3")
65
 
#define DRAG_EXT_NAME _T("FileZilla 3 Shell Extension")
 
69
#define DRAG_EXT_NAME   _T("FileZilla 3 Shell Extension")
66
70
#define THREADING_MODEL _T("Apartment")
67
71
#define CLSID_SIZE 39
68
72
 
183
187
                Debug("WideCharToMultiByte failed");
184
188
        else
185
189
        {
186
 
        buffer[written] = 0;
 
190
                buffer[written] = 0;
187
191
                Debug(buffer);
188
192
        }
189
193
        delete [] buffer;
226
230
                Debug("LogVersion return: no fixed version info");
227
231
                return;
228
232
        }
229
 
        
 
233
 
230
234
        char VersionStr[100];
231
235
        snprintf(VersionStr, sizeof(VersionStr), "LogVersion %d.%d.%d.%d",
232
236
                HIWORD(VersionInfo->dwFileVersionMS),
434
438
static bool RegDeleteEmptyKey(HKEY root, LPCTSTR name)
435
439
{
436
440
        HKEY key;
437
 
        
 
441
 
438
442
        // Can't use SHDeleteEmptyKey, it gives a linking error
439
443
        if (RegOpenKeyEx(root, name, 0, KEY_READ, &key) != ERROR_SUCCESS)
440
444
                return false;
441
445
 
442
446
        DWORD subKeys, values;
443
447
        int ret = RegQueryInfoKey(key, 0, 0, 0, &subKeys, 0, 0, &values, 0, 0, 0,0);
444
 
        
 
448
 
445
449
        RegCloseKey(key);
446
 
        
 
450
 
447
451
        if (ret != ERROR_SUCCESS)
448
452
                return false;
449
 
        
 
453
 
450
454
        if (subKeys || values)
451
455
                return false;
452
456
 
453
457
        RegDeleteKey(root, name);
454
 
        
 
458
 
455
459
        return true;
456
460
}
457
461
 
884
888
                DEBUG_MSG("CShellExt::CopyCallback mapview NOT created");
885
889
        }
886
890
 
887
 
        CloseHandle(MapFile);   
888
 
        
 
891
        CloseHandle(MapFile);
 
892
 
889
893
        return Result;
890
894
}