Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in tip

fogcreek shellext: edited Win32 API calls for consistency

Changeset efb98170ad2d

Parent e3e4cac77219

by David Golub

Changes to 10 files · Browse files at efb98170ad2d Showing diff from parent e3e4cac77219 Diff from another changeset...

 
143
144
145
146
 
147
148
149
 
156
157
158
159
 
160
161
162
 
231
232
233
234
 
235
236
237
 
280
281
282
283
 
284
285
286
 
375
376
377
378
 
379
380
381
 
472
473
474
475
 
476
477
478
 
487
488
489
490
 
491
492
493
 
500
501
502
503
504
505
506
 
 
507
508
509
 
518
519
520
521
 
522
523
524
 
528
529
530
531
 
532
533
534
 
627
628
629
630
 
631
632
633
 
722
723
724
725
726
727
728
729
730
731
732
 
 
 
733
734
735
 
753
754
755
756
 
757
758
759
760
 
761
762
763
764
 
765
766
767
 
768
769
770
 
804
805
806
807
 
808
809
810
 
818
819
820
821
822
 
 
823
824
 
825
826
827
 
840
841
842
843
 
844
845
846
 
881
882
883
884
 
885
886
887
888
 
889
890
891
 
892
893
894
 
900
901
902
903
 
904
905
906
 
916
917
918
919
 
920
921
922
 
143
144
145
 
146
147
148
149
 
156
157
158
 
159
160
161
162
 
231
232
233
 
234
235
236
237
 
280
281
282
 
283
284
285
286
 
375
376
377
 
378
379
380
381
 
472
473
474
 
475
476
477
478
 
487
488
489
 
490
491
492
493
 
500
501
502
 
 
 
 
503
504
505
506
507
 
516
517
518
 
519
520
521
522
 
526
527
528
 
529
530
531
532
 
625
626
627
 
628
629
630
631
 
720
721
722
 
 
 
 
 
 
 
 
723
724
725
726
727
728
 
746
747
748
 
749
750
751
752
 
753
754
755
756
 
757
758
759
 
760
761
762
763
 
797
798
799
 
800
801
802
803
 
811
812
813
 
 
814
815
816
 
817
818
819
820
 
833
834
835
 
836
837
838
839
 
874
875
876
 
877
878
879
880
 
881
882
883
 
884
885
886
887
 
893
894
895
 
896
897
898
899
 
909
910
911
 
912
913
914
915
@@ -143,7 +143,7 @@
  ATLTRACE(L"GetCMenuTranslation: '%s'\n", (LPCWSTR)strSubKey);     HKEY hKey = 0; - LONG lRes = RegOpenKeyExW(HKEY_CURRENT_USER, strSubKey, 0, KEY_READ, &hKey); + LONG lRes = ::RegOpenKeyExW(HKEY_CURRENT_USER, strSubKey, 0, KEY_READ, &hKey);     if (lRes == ERROR_SUCCESS && hKey)   { @@ -156,7 +156,7 @@
  }     if (hKey) - RegCloseKey(hKey); + ::RegCloseKey(hKey);  }    void CTortoiseHgCmenuBase::InitMenuMaps(const CMenuDescription *pMenuDescs, int nCount) @@ -231,7 +231,7 @@
  ATLTRACE(" ***** InsertMenuItemWithIcon1: can't find '%s'\n", strIconName);   }   } - InsertMenuItemW(hMenu, indexMenu, TRUE, &mii); + ::InsertMenuItemW(hMenu, indexMenu, TRUE, &mii);     ATLTRACE(L"InsertMenuItemWithIcon1('%s') finished\n", strMenuText);  } @@ -280,7 +280,7 @@
  }   }   - InsertMenuItemW(hMenu, indexMenu, TRUE, &mii); + ::InsertMenuItemW(hMenu, indexMenu, TRUE, &mii);     ATLTRACE(L"InsertMenuItemWithIcon2('%s') finished\n", (LPCWSTR)strMenuText);  } @@ -375,7 +375,7 @@
  mi.fMask = MIM_STYLE | MIM_APPLYTOSUBMENUS;   mi.dwStyle = MNS_CHECKORBMP;   - SetMenuInfo(hMenu, &mi); + ::SetMenuInfo(hMenu, &mi);  }    #define ResultFromShort(i) ResultFromScode(MAKE_SCODE(SEVERITY_SUCCESS, 0, (USHORT)(i))) @@ -472,7 +472,7 @@
  lpszEntries = NoRepoMenu;     // start building TortoiseHg menus and submenus - InsertMenu(hMenu, indexMenu++, MF_SEPARATOR | MF_BYPOSITION, 0, NULL); + ::InsertMenu(hMenu, indexMenu++, MF_SEPARATOR | MF_BYPOSITION, 0, NULL);     CAtlList<CString> listEntries;   Tokenize(lpszEntries, listEntries, " "); @@ -487,7 +487,7 @@
  }   }   - const HMENU hSubMenu = CreatePopupMenu(); + const HMENU hSubMenu = ::CreatePopupMenu();   if (hSubMenu)   {   UINT indexSubMenu = 0; @@ -500,10 +500,8 @@
  {   if (!bIsSeparator)   { - InsertMenu( - hSubMenu, indexSubMenu++, - MF_SEPARATOR | MF_BYPOSITION, 0, NULL - ); + ::InsertMenu(hSubMenu, indexSubMenu++, + MF_SEPARATOR | MF_BYPOSITION, 0, NULL);   bIsSeparator = true;   }   } @@ -518,7 +516,7 @@
  }   }   if (bIsSeparator && indexSubMenu > 0) - RemoveMenu(hSubMenu, indexSubMenu - 1, MF_BYPOSITION); + ::RemoveMenu(hSubMenu, indexSubMenu - 1, MF_BYPOSITION);     TweakMenuForVista(hSubMenu);   @@ -528,7 +526,7 @@
  InsertSubMenuItemWithIcon2(hMenu, hSubMenu, indexMenu++, idCmd++,   TortoiseHgMenuEntryString, "hg.ico");   - InsertMenu(hMenu, indexMenu++, MF_SEPARATOR | MF_BYPOSITION, 0, NULL); + ::InsertMenu(hMenu, indexMenu++, MF_SEPARATOR | MF_BYPOSITION, 0, NULL);     CInitStatus::Check();   @@ -627,7 +625,7 @@
  else if (uFlags == GCS_VERBW || uFlags == GCS_VERBA)   {  #if 0 - psz = iter->second.name; + psz = p->m_value.name;  #else   // bugfix: don't provide verbs ("rename" conflicted with rename of explorer)   psz = ""; @@ -722,14 +720,9 @@
  DRAWITEMSTRUCT* lpdis = (DRAWITEMSTRUCT*)lParam;   if (!lpdis || (lpdis->CtlType != ODT_MENU) || !lpdis->itemData)   break; //not for a menu - DrawIconEx( - lpdis->hDC, - lpdis->rcItem.left - 16, - lpdis->rcItem.top - + (lpdis->rcItem.bottom - lpdis->rcItem.top - 16) / 2, - (HICON) lpdis->itemData, 16, 16, - 0, 0, DI_NORMAL - ); + ::DrawIconEx(lpdis->hDC, lpdis->rcItem.left - 16, + lpdis->rcItem.top + (lpdis->rcItem.bottom - lpdis->rcItem.top - 16) / 2, + (HICON) lpdis->itemData, 16, 16, 0, 0, DI_NORMAL);   *pResult = TRUE;   }   break; @@ -753,18 +746,18 @@
  CString strHgCmd = strDir + "\\thgw.exe";     WIN32_FIND_DATAA data; - HANDLE hFind = FindFirstFileA(strHgCmd, &data); + HANDLE hFind = ::FindFirstFile(strHgCmd, &data);   if (hFind == INVALID_HANDLE_VALUE)   {   strHgCmd = strDir + "\\hgtk.exe"; - hFind = FindFirstFileA(strHgCmd, &data); + hFind = ::FindFirstFile(strHgCmd, &data);   if (hFind == INVALID_HANDLE_VALUE)   strHgCmd = strDir + "\\thg.cmd";   else - FindClose(hFind); + ::FindClose(hFind);   }   else - FindClose(hFind); + ::FindClose(hFind);     strHgCmd = Quote(strHgCmd) + " --nofork " + strCmd;   @@ -804,7 +797,7 @@
  }     ATLTRACE("RunDialog: temp file = %s\n", (LPCTSTR)strTempFile); - HANDLE hTempFile = CreateFileA(strTempFile, GENERIC_WRITE, FILE_SHARE_READ, 0, + HANDLE hTempFile = ::CreateFile(strTempFile, GENERIC_WRITE, FILE_SHARE_READ, 0,   CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);     if (hTempFile == INVALID_HANDLE_VALUE) @@ -818,10 +811,10 @@
  {   DWORD dwWritten;   ATLTRACE("RunDialog: temp file adding '%s'\n", (LPCTSTR)m_arrFiles[i]); - WriteFile(hTempFile, (LPCTSTR)m_arrFiles[i], m_arrFiles[i].GetLength(), &dwWritten, 0); - WriteFile(hTempFile, "\n", 1, &dwWritten, 0); + ::WriteFile(hTempFile, (LPCTSTR)m_arrFiles[i], m_arrFiles[i].GetLength(), &dwWritten, 0); + ::WriteFile(hTempFile, "\n", 1, &dwWritten, 0);   } - CloseHandle(hTempFile); + ::CloseHandle(hTempFile);   strHgCmd += " --listfile " + Quote(strTempFile);   }   @@ -840,7 +833,7 @@
  LPCTSTR lpszShellExId = "{728E8840-5878-4EA7-918F-281C2697ABB1}";  #endif   char szProductId[50]; - UINT msires = ::MsiGetProductCodeA(lpszShellExId, szProductId); + UINT msires = ::MsiGetProductCode(lpszShellExId, szProductId);   ATLTRACE("MSI shellexid: %s\n", lpszShellExId);   ATLTRACE("MSI msires: %d", msires);   ATLTRACE("MSI installed product id: %s\n", szProductId); @@ -881,14 +874,14 @@
  STGMEDIUM stg = { TYMED_HGLOBAL };   if (SUCCEEDED(pDataObj->GetData(&fmt, &stg)) && stg.hGlobal)   { - HDROP hDrop = (HDROP) GlobalLock(stg.hGlobal); + HDROP hDrop = (HDROP)::GlobalLock(stg.hGlobal);     if (hDrop)   { - UINT uNumFiles = DragQueryFile(hDrop, 0xFFFFFFFF, NULL, 0); + UINT uNumFiles = ::DragQueryFile(hDrop, 0xFFFFFFFF, NULL, 0);   ATLTRACE(" hDrop uNumFiles = %d\n", uNumFiles);   for (UINT i = 0; i < uNumFiles; ++i) { - if (DragQueryFile(hDrop, i, szName, MAX_PATH) > 0) + if (::DragQueryFile(hDrop, i, szName, MAX_PATH) > 0)   {   ATLTRACE(" DragQueryFile [%d] = '%s'\n", i, szName);   m_arrFiles.Add(szName); @@ -900,7 +893,7 @@
  ATLTRACE(" hDrop is NULL\n");   }   - GlobalUnlock(stg.hGlobal); + ::GlobalUnlock(stg.hGlobal);   if (stg.pUnkForRelease)   {   IUnknown* relInterface = (IUnknown*) stg.pUnkForRelease; @@ -916,7 +909,7 @@
  // if a directory background   if (pIDFolder)   { - SHGetPathFromIDList(pIDFolder, szName); + ::SHGetPathFromIDList(pIDFolder, szName);   ATLTRACE(" Folder '%s'\n", szName);   m_strFolder = szName;   }
 
61
62
63
64
 
65
66
67
 
92
93
94
95
 
96
97
98
 
112
113
114
115
 
116
117
118
119
 
120
121
122
 
123
124
125
 
137
138
139
140
 
141
142
143
 
61
62
63
 
64
65
66
67
 
92
93
94
 
95
96
97
98
 
112
113
114
 
115
116
117
118
 
119
120
121
 
122
123
124
125
 
137
138
139
 
140
141
142
143
@@ -61,7 +61,7 @@
    // separator   if (idCmd != idCmdFirst) - InsertMenu(hMenu, indexMenu++, MF_SEPARATOR|MF_BYPOSITION, 0, NULL); + ::InsertMenu(hMenu, indexMenu++, MF_SEPARATOR|MF_BYPOSITION, 0, NULL);     TweakMenuForVista(hMenu);   @@ -92,7 +92,7 @@
  // if a directory background   if (pIDFolder)   { - SHGetPathFromIDList(pIDFolder, szName); + ::SHGetPathFromIDList(pIDFolder, szName);   ATLTRACE(" Folder '%s'\n", szName);   m_strFolder = szName;   } @@ -112,14 +112,14 @@
  STGMEDIUM stg = { TYMED_HGLOBAL };   if (SUCCEEDED(pDataObj->GetData(&fmt, &stg)) && stg.hGlobal)   { - HDROP hDrop = (HDROP) GlobalLock(stg.hGlobal); + HDROP hDrop = (HDROP)::GlobalLock(stg.hGlobal);     if (hDrop)   { - UINT uNumFiles = DragQueryFile(hDrop, 0xFFFFFFFF, NULL, 0); + UINT uNumFiles = ::DragQueryFile(hDrop, 0xFFFFFFFF, NULL, 0);   ATLTRACE(" hDrop uNumFiles = %d\n", uNumFiles);   for (UINT i = 0; i < uNumFiles; ++i) { - if (DragQueryFile(hDrop, i, szName, MAX_PATH) > 0) + if (::DragQueryFile(hDrop, i, szName, MAX_PATH) > 0)   {   ATLTRACE(" DragQueryFile [%d] = '%s'\n", i, szName);   if (GetHgRepoRoot(szName) != strRoot) @@ -137,7 +137,7 @@
  ATLTRACE(" hDrop is NULL\n");   }   - GlobalUnlock(stg.hGlobal); + ::GlobalUnlock(stg.hGlobal);   if (stg.pUnkForRelease)   {   IUnknown* relInterface = (IUnknown*) stg.pUnkForRelease;
 
143
144
145
146
 
147
148
149
150
151
152
153
 
154
155
156
 
143
144
145
 
146
147
148
149
150
151
152
 
153
154
155
156
@@ -143,14 +143,14 @@
 {   static CCacheEntry ce;   - unsigned tc = GetTickCount(); + unsigned tc = ::GetTickCount();     if (ce.strHgRoot != strHgRoot || (tc - ce.uTickCount) > 2000)   {   ce.strHgRoot.Empty();   ce.bReadFailed = (ce.ds.Read(strHgRoot, strCwd) == 0);   ce.strHgRoot = strHgRoot; - ce.uTickCount = GetTickCount(); + ce.uTickCount = ::GetTickCount();   }     return (ce.bReadFailed ? 0 : &ce.ds);
 
47
48
49
50
 
51
52
53
 
112
113
114
115
 
116
117
 
118
119
120
 
47
48
49
 
50
51
52
53
 
112
113
114
 
115
116
 
117
118
119
120
@@ -47,7 +47,7 @@
  CString strPath = strHgRoot + (bUseKbfiles ? "\\.hg\\kilnbfiles\\dirstate"   : "\\.hg\\dirstate");   - unsigned tc = GetTickCount(); + unsigned tc = ::GetTickCount();   bool bNewStat = false;     if (position == NULL) @@ -112,9 +112,9 @@
  }     bUnset = false; - unsigned tc0 = GetTickCount(); + unsigned tc0 = ::GetTickCount();   CAutoPtr<CDirstate> ds = CDirstate::Read(strPath, bUnset); - unsigned tc1 = GetTickCount(); + unsigned tc1 = ::GetTickCount();     bool bRequestTHgStatusUpdate = true;  
 
27
28
29
30
 
31
32
33
 
41
42
43
44
 
45
46
47
 
114
115
116
117
118
 
 
119
120
121
 
122
123
124
 
125
126
127
128
129
 
130
131
132
 
139
140
141
142
143
 
 
144
145
146
 
149
150
151
152
 
153
154
155
156
 
157
158
159
 
164
165
166
167
 
168
169
170
 
173
174
175
176
 
177
178
179
 
180
181
182
 
183
184
185
 
196
197
198
199
 
200
201
202
203
204
205
206
207
 
 
208
209
210
 
234
235
236
237
 
238
239
240
 
244
245
246
247
248
 
 
249
250
251
252
 
 
253
254
255
 
276
277
278
279
 
280
281
282
 
27
28
29
 
30
31
32
33
 
41
42
43
 
44
45
46
47
 
114
115
116
 
 
117
118
119
120
 
121
122
123
 
124
125
126
127
128
 
129
130
131
132
 
139
140
141
 
 
142
143
144
145
146
 
149
150
151
 
152
153
154
155
 
156
157
158
159
 
164
165
166
 
167
168
169
170
 
173
174
175
 
176
177
178
 
179
180
181
 
182
183
184
185
 
196
197
198
 
199
200
201
202
203
204
205
 
 
206
207
208
209
210
 
234
235
236
 
237
238
239
240
 
244
245
246
 
 
247
248
249
250
251
 
252
253
254
255
256
 
277
278
279
 
280
281
282
283
@@ -27,7 +27,7 @@
 {   if (CSysInfo::Instance().IsVistaOrLater())   { - m_hUxTheme = LoadLibrary(_T("UXTHEME.DLL")); + m_hUxTheme = ::LoadLibrary(_T("UXTHEME.DLL"));     if (m_hUxTheme)   { @@ -41,7 +41,7 @@
 CIconBitmapUtils::~CIconBitmapUtils()  {   if (m_hUxTheme) - FreeLibrary(m_hUxTheme); + ::FreeLibrary(m_hUxTheme);  }    HBITMAP CIconBitmapUtils::IconToBitmap(HICON hIcon) @@ -114,19 +114,19 @@
  }     SIZE sizeIcon; - sizeIcon.cx = GetSystemMetrics(SM_CXSMICON); - sizeIcon.cy = GetSystemMetrics(SM_CYSMICON); + sizeIcon.cx = ::GetSystemMetrics(SM_CXSMICON); + sizeIcon.cy = ::GetSystemMetrics(SM_CYSMICON);     RECT rcIcon; - SetRect(&rcIcon, 0, 0, sizeIcon.cx, sizeIcon.cy); + ::SetRect(&rcIcon, 0, 0, sizeIcon.cx, sizeIcon.cy);   HBITMAP hBitmap = NULL;   - HDC hDestDC = CreateCompatibleDC(NULL); + HDC hDestDC = ::CreateCompatibleDC(NULL);   if (hDestDC)   {   if (SUCCEEDED(Create32BitHBITMAP(hDestDC, &sizeIcon, NULL, &hBitmap)))   { - HBITMAP hOldBitmap = (HBITMAP)SelectObject(hDestDC, hBitmap); + HBITMAP hOldBitmap = (HBITMAP)::SelectObject(hDestDC, hBitmap);   if (hOldBitmap)   {   BLENDFUNCTION bfAlpha = { AC_SRC_OVER, 0, 255, AC_SRC_ALPHA }; @@ -139,8 +139,8 @@
  HPAINTBUFFER hPaintBuffer = m_pfnBeginBufferedPaint(hDestDC, &rcIcon, BPBF_DIB, &paintParams, &hBufferDC);   if (hPaintBuffer)   { - if (DrawIconEx(hBufferDC, 0, 0, hIcon, sizeIcon.cx, sizeIcon.cy, 0, NULL, DI_NORMAL)) - //if (FillRect(hBufferDC, &rcIcon, (HBRUSH) (0x000000FF)) != 0) + if (::DrawIconEx(hBufferDC, 0, 0, hIcon, sizeIcon.cx, sizeIcon.cy, 0, NULL, DI_NORMAL)) + //if (::FillRect(hBufferDC, &rcIcon, (HBRUSH) (0x000000FF)) != 0)   {   // If icon did not have an alpha channel we need to convert buffer to PARGB   ConvertBufferToPARGB32(hPaintBuffer, hDestDC, hIcon, sizeIcon); @@ -149,11 +149,11 @@
  m_pfnEndBufferedPaint(hPaintBuffer, TRUE);   }   - SelectObject(hDestDC, hOldBitmap); + ::SelectObject(hDestDC, hOldBitmap);   }   }   - DeleteDC(hDestDC); + ::DeleteDC(hDestDC);   }     return hBitmap; @@ -164,7 +164,7 @@
  *phBitmap = NULL;     BITMAPINFO bmi; - SecureZeroMemory(&bmi, sizeof(BITMAPINFO)); + ::SecureZeroMemory(&bmi, sizeof(BITMAPINFO));   bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);   bmi.bmiHeader.biPlanes = 1;   bmi.bmiHeader.biCompression = BI_RGB; @@ -173,13 +173,13 @@
  bmi.bmiHeader.biHeight = pSize->cy;   bmi.bmiHeader.biBitCount = 32;   - HDC hUsedDC = hDC ? hDC : GetDC(NULL); + HDC hUsedDC = hDC ? hDC : ::GetDC(NULL);   if (hUsedDC)   { - *phBitmap = CreateDIBSection(hUsedDC, &bmi, DIB_RGB_COLORS, ppvBits, NULL, 0); + *phBitmap = ::CreateDIBSection(hUsedDC, &bmi, DIB_RGB_COLORS, ppvBits, NULL, 0);   if (hDC != hUsedDC)   { - ReleaseDC(NULL, hUsedDC); + ::ReleaseDC(NULL, hUsedDC);   }   }   return (NULL == *phBitmap) ? E_OUTOFMEMORY : S_OK; @@ -196,15 +196,15 @@
  if (!HasAlpha(pargb, sizeIcon, cxRow))   {   ICONINFO info; - if (GetIconInfo(hIcon, &info)) + if (::GetIconInfo(hIcon, &info))   {   if (info.hbmMask)   {   hr = ConvertToPARGB32(hDC, pargb, info.hbmMask, sizeIcon, cxRow);   }   - DeleteObject(info.hbmColor); - DeleteObject(info.hbmMask); + ::DeleteObject(info.hbmColor); + ::DeleteObject(info.hbmMask);   }   }   } @@ -234,7 +234,7 @@
 HRESULT CIconBitmapUtils::ConvertToPARGB32(HDC hDC, Gdiplus::ARGB *pargb, HBITMAP hBitmap, SIZE& sizeImage, int cxRow)  {   BITMAPINFO bmi; - SecureZeroMemory(&bmi, sizeof(BITMAPINFO)); + ::SecureZeroMemory(&bmi, sizeof(BITMAPINFO));   bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);   bmi.bmiHeader.biPlanes = 1;   bmi.bmiHeader.biCompression = BI_RGB; @@ -244,12 +244,13 @@
  bmi.bmiHeader.biBitCount = 32;     HRESULT hr = E_OUTOFMEMORY; - HANDLE hHeap = GetProcessHeap(); - void *pvBits = HeapAlloc(hHeap, 0, bmi.bmiHeader.biWidth * 4 * bmi.bmiHeader.biHeight); + HANDLE hHeap = ::GetProcessHeap(); + void *pvBits = ::HeapAlloc(hHeap, 0, bmi.bmiHeader.biWidth * 4 * bmi.bmiHeader.biHeight);   if (pvBits)   {   hr = E_UNEXPECTED; - if (GetDIBits(hDC, hBitmap, 0, bmi.bmiHeader.biHeight, pvBits, &bmi, DIB_RGB_COLORS) == bmi.bmiHeader.biHeight) + if (::GetDIBits(hDC, hBitmap, 0, bmi.bmiHeader.biHeight, pvBits, &bmi, + DIB_RGB_COLORS) == bmi.bmiHeader.biHeight)   {   ULONG cxDelta = cxRow - bmi.bmiHeader.biWidth;   Gdiplus::ARGB *pargbMask = static_cast<Gdiplus::ARGB *>(pvBits); @@ -276,7 +277,7 @@
  hr = S_OK;   }   - HeapFree(hHeap, 0, pvBits); + ::HeapFree(hHeap, 0, pvBits);   }     return hr;
 
6
7
8
9
 
10
11
12
13
14
15
16
 
17
18
19
 
20
21
 
6
7
8
 
9
10
11
12
13
14
15
 
16
17
18
 
19
20
21
@@ -6,16 +6,16 @@
  LPCTSTR lpszSubKey = "Software\\TortoiseHg";     HKEY hKey = 0; - LONG lRes = RegOpenKeyExA(HKEY_CURRENT_USER, lpszSubKey, 0, KEY_READ, &hKey); + LONG lRes = ::RegOpenKeyEx(HKEY_CURRENT_USER, lpszSubKey, 0, KEY_READ, &hKey);     if (lRes != ERROR_SUCCESS || hKey == 0)   return 0;     DWORD cbData = MAX_PATH;   LPTSTR lpszData = strRes.GetBuffer(cbData); - lRes = RegQueryValueExA(hKey, strName, 0, 0, (LPBYTE)lpszData, &cbData); + lRes = ::RegQueryValueEx(hKey, strName, 0, 0, (LPBYTE)lpszData, &cbData);   strRes.ReleaseBuffer(cbData);   - RegCloseKey(hKey); + ::RegCloseKey(hKey);   return lRes == ERROR_SUCCESS;  }
 
21
22
23
24
 
25
26
 
27
28
29
 
21
22
23
 
24
25
 
26
27
28
29
@@ -21,9 +21,9 @@
   CSysInfo::CSysInfo(void)  { - SecureZeroMemory(&inf, sizeof(OSVERSIONINFOEX)); + ::SecureZeroMemory(&inf, sizeof(OSVERSIONINFOEX));   inf.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); - GetVersionEx((OSVERSIONINFO *)&inf); + ::GetVersionEx((OSVERSIONINFO *)&inf);  }    const CSysInfo& CSysInfo::Instance()
 
22
23
24
25
 
26
27
28
 
43
44
45
46
 
47
48
49
 
50
51
52
 
22
23
24
 
25
26
27
28
 
43
44
45
 
46
47
48
 
49
50
51
52
@@ -22,7 +22,7 @@
 {   DWORD dwSize = 260;   char szBuf[260]; - if (!::GetUserNameA(szBuf, &dwSize)) + if (!::GetUserName(szBuf, &dwSize))   return "";   CString strRes = "\\\\.\\pipe\\TortoiseHgRpcServer-bc0c27107423-";   strRes += szBuf; @@ -43,10 +43,10 @@
  ATLTRACE("CTHgStatus:SendRequest: sending '%s' to %s\n",   (LPCTSTR)strRequest, (LPCTSTR)strPipeName);   - fSuccess = ::CallNamedPipeA(strPipeName, (void*)(LPCTSTR)strRequest, + fSuccess = ::CallNamedPipe(strPipeName, (void*)(LPCTSTR)strRequest,   strRequest.GetLength(), 0, 0, &cbRead, NMPWAIT_NOWAIT);   - DWORD dwErr = GetLastError(); + DWORD dwErr = ::GetLastError();   if (fSuccess || dwErr == ERROR_MORE_DATA || dwErr == ERROR_PIPE_NOT_CONNECTED)   {   return 0;
 
15
16
17
18
 
19
20
21
 
36
37
38
39
 
40
41
42
 
54
55
56
57
58
 
 
59
60
61
 
64
65
66
67
 
68
69
70
71
 
72
73
74
 
187
188
189
190
191
 
192
193
194
 
195
196
197
198
199
200
 
201
202
203
 
206
207
208
209
 
210
211
212
213
 
214
215
216
 
15
16
17
 
18
19
20
21
 
36
37
38
 
39
40
41
42
 
54
55
56
 
 
57
58
59
60
61
 
64
65
66
 
67
68
69
70
 
71
72
73
74
 
187
188
189
 
 
190
191
 
 
192
193
194
195
196
197
 
198
199
200
201
 
204
205
206
 
207
208
209
210
 
211
212
213
214
@@ -15,7 +15,7 @@
  TCHAR lpszValue[MAX_PATH] = "";   LONG lpcbLonger = MAX_PATH * sizeof(TCHAR);   - if (RegQueryValue(hKey, lpszKeyName, lpszValue, &lpcbLonger) != ERROR_SUCCESS) + if (::RegQueryValue(hKey, lpszKeyName, lpszValue, &lpcbLonger) != ERROR_SUCCESS)   return "";     return lpszValue; @@ -36,7 +36,7 @@
  STARTUPINFOA si;   memset(&si, 0, sizeof(STARTUPINFO));   - BOOL bRes = CreateProcessA( + BOOL bRes = ::CreateProcess(   NULL, // No module name, use command line   (LPTSTR)(LPCTSTR)strCommand,   NULL, // Process handle not inherited @@ -54,8 +54,8 @@
  return false;   }   - CloseHandle(pi.hProcess); - CloseHandle(pi.hThread); + ::CloseHandle(pi.hProcess); + ::CloseHandle(pi.hThread);   return true;  }   @@ -64,11 +64,11 @@
  char szTempDir[MAX_PATH + 1];   char szTempFile[MAX_PATH + 1];   - if (GetTempPath(MAX_PATH, szTempDir) == 0) + if (::GetTempPath(MAX_PATH, szTempDir) == 0)   {   ATLTRACE("GetTemporaryFile: Failed to find temporary path\n");   } - else if (GetTempFileName(szTempDir, strPrefix, 0, szTempFile) != 0) + else if (::GetTempFileName(szTempDir, strPrefix, 0, szTempFile) != 0)   {   return szTempFile;   } @@ -187,17 +187,15 @@
 // processes while we have it open  FILE* fopenReadRenameAllowed(LPCTSTR lpszPath)  { - HANDLE fh = ::CreateFileA( - lpszPath, GENERIC_READ, + HANDLE fh = ::CreateFile(lpszPath, GENERIC_READ,   FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, - 0, OPEN_EXISTING, 0, 0 - ); + 0, OPEN_EXISTING, 0, 0);     if (fh == INVALID_HANDLE_VALUE)   return 0;     // get C runtime file descriptor from file handle - int fd = ::_open_osfhandle((intptr_t)fh, _O_RDONLY); + int fd = _open_osfhandle((intptr_t)fh, _O_RDONLY);   if (fd == -1)   {   ATLTRACE("fopenReadRenameAllowed: _open_osfhandle failed\n"); @@ -206,11 +204,11 @@
  }     // get C runtime FILE from file descriptor - FILE* f = ::_fdopen(fd, "r"); + FILE* f = _fdopen(fd, "r");   if (f == 0)   {   ATLTRACE("fopenReadRenameAllowed: _fdopen failed\n"); - ::_close(fd); + _close(fd);   return 0;   }  
 
24
25
26
27
 
28
29
30
 
31
32
33
 
34
35
36
 
24
25
26
 
27
28
29
 
30
31
32
 
33
34
35
36
@@ -24,13 +24,13 @@
  const LONGLONG llSecsBetweenEpochs = llDaysBetweenEpochs * 86400L;   const LONGLONG llDivisor = 10000000L;   - WIN32_FIND_DATAA data; + WIN32_FIND_DATA data;   HANDLE hFind;   - hFind = FindFirstFileA(lpszFile, &data); + hFind = ::FindFirstFile(lpszFile, &data);   if (hFind == INVALID_HANDLE_VALUE)   return -1; - FindClose(hFind); + ::FindClose(hFind);     ullMTime = (((LONGLONG)data.ftLastWriteTime.dwHighDateTime << 32) +   data.ftLastWriteTime.dwLowDateTime);