Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

shellext: remove unused PipeUtils

Changeset 1f359bf7e3d9

Parent d293d7db789e

by Adrian Buehlmann

Changes to 4 files · Browse files at 1f359bf7e3d9 Showing diff from parent d293d7db789e Diff from another changeset...

 
2
3
4
5
6
7
8
 
2
3
4
 
5
6
7
@@ -2,7 +2,6 @@
 #include "ShellExt.h"  #include "TortoiseUtils.h"  #include "StringUtils.h" -#include "PipeUtils.h"  #include "QueryDirstate.h"    #include <shlwapi.h>
 
8
9
10
11
12
13
14
 
34
35
36
37
 
38
39
40
41
42
43
44
45
46
47
 
8
9
10
 
11
12
13
 
33
34
35
 
36
37
38
39
40
 
 
 
41
42
43
@@ -8,7 +8,6 @@
  ContextMenu.o \   IconOverlay.o \   ShellExt.o \ - PipeUtils.o \   ShellUtils2.o \   StringUtils.o \   dirstate.o \ @@ -34,14 +33,11 @@
 CXXFLAGS+=-D_DEBUG  endif   -all: THgShell.dll dirstate.exe PipeUtils.exe +all: THgShell.dll dirstate.exe    THgShell.dll: $(OBJECTS_THGSGELL)   g++ -o $@ $(OBJECTS_THGSGELL) $(LDFLAGS_THGSGELL)   -PipeUtils.exe: PipeUtils.cpp PipeUtils.h StringUtils.o TortoiseUtils.o - g++ -o $@ $(CXXFLAGS) -DAPPMAIN $< StringUtils.o TortoiseUtils.o -  dirstate.exe: dirstate.cpp dirstate.h $(OBJECTS_DIRSTATE)   g++ -o $@ $(CXXFLAGS) -DAPPMAIN $< $(OBJECTS_DIRSTATE) $(LDFLAGS_DIRSTATE)  
Change 1 of 1 Show Entire File win32/​shellext/​PipeUtils.cpp Stacked
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
@@ -1,95 +0,0 @@
-#include "stdafx.h" -#include "PipeUtils.h" -#include "StringUtils.h" -#include "TortoiseUtils.h" -#include <stdio.h> -#include <conio.h> -#include <tchar.h> -#include <wchar.h> - -LPTSTR lpszPipename = TEXT("\\\\.\\pipe\\PyPipeService"); - -#define BUFSIZE 512 - -int query_pipe(LPCSTR cstr, TCHAR *chReadBuf, int bufsize) -{ - BOOL fSuccess; - DWORD cbRead; - - int outlen = (lstrlen((TCHAR*)cstr))*sizeof(TCHAR); - TDEBUG_TRACE("sending " << outlen << " bytes to pipe: " << cstr); - - fSuccess = CallNamedPipe( - lpszPipename, // pipe name - (void *)cstr, // message to server - outlen, // message length - chReadBuf, // buffer to receive reply - bufsize, // size of read buffer - &cbRead, // number of bytes read - NMPWAIT_NOWAIT); // waits for 0 seconds - - if (fSuccess || GetLastError() == ERROR_MORE_DATA) - { - TDEBUG_TRACE("receive " << cbRead << " bytes from pipe: " << chReadBuf); - return cbRead; - } - else - { - return -1; - } -} - -int _test_pipe(LPCSTR lpszWrite) -{ - TCHAR readBuf[BUFSIZE] = TEXT(""); - int bufsize = BUFSIZE*sizeof(TCHAR); - int cbRead = query_pipe(lpszWrite, readBuf, bufsize); - - if (cbRead >= 0) - { - _tprintf( TEXT("read: %s\n"), readBuf ); - } - else - { - _tprintf( TEXT("error calling pipe\n") ); - } -} - -#ifdef APPMAIN -int _tmain(int argc, TCHAR *argv[]) -{ - LPTSTR lpszWrite = TEXT(""); - - if (argc < 2) - { - _tprintf(TEXT("usage: %s file1 file2 ...\n"), argv[0]); - return 1; - } - - for (int i=1; i<argc; i++) - { - lpszWrite = argv[i]; - _test_pipe(lpszWrite); - } - WCHAR file[] = L"C:\\hg\\hg-tortoise\\hgproc.py"; - std::string mbstr = WideToMultibyte(file); - const char *cstr = mbstr.c_str(); - _test_pipe(cstr); - - std::string root = GetTHgProgRoot(); - if (root != "") - { - _tprintf(TEXT("THG root = %s\n"), root.c_str() ); - } - else - { - _tprintf(TEXT("THG root not found in registry\n")); - } - - //LaunchCommand("notepad"); - //LaunchCommand("D:\\Profiles\\r28629\\My Documents\\Mercurial\\repos\\hg-tortoise-dev\\dist\\hgproc.exe") - //LaunchCommand("\"D:\\Profiles\\r28629\\My Documents\\Mercurial\\repos\\hg-tortoise-namedpipe\\hgproc.bat\""); - - return 0; -} -#endif
Change 1 of 1 Show Entire File win32/​shellext/​PipeUtils.h Stacked
 
1
2
3
4
5
6
 
 
 
 
 
 
 
@@ -1,6 +0,0 @@
-#ifndef __NTServiceManager_PipeUtils_Defined__ -#define __NTServiceManager_PipeUtils_Defined__ - -int query_pipe(LPCSTR lpszWrite, TCHAR *chReadBuf, int bufsize); - -#endif