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

shellext: add class Thgstatus

Changeset b3d75d68149f

Parent 8d68246470a3

by Adrian Buehlmann

Changes to 3 files · Browse files at b3d75d68149f Showing diff from parent 8d68246470a3 Diff from another changeset...

 
14
15
16
 
17
18
19
 
14
15
16
17
18
19
20
@@ -14,6 +14,7 @@
  Winstat64.o \   Dirstatecache.o \   DirectoryStatus.o \ + Thgstatus.o \   QueryDirstate.o    BASE_LDFLAGS=-lole32 -lkernel32 -luser32 -lgdi32 -lshlwapi -lwininet \
Change 1 of 1 Show Entire File win32/​shellext/​Thgstatus.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
@@ -0,0 +1,43 @@
+ +// Copyright (C) 2009 Adrian Buehlmann +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see <http://www.gnu.org/licenses/>. + +#include "stdafx.h" + +#include "Thgstatus.h" + +#define THG_PIPENAME "\\\\.\\pipe\\PyPipeService" + +int Thgstatus::update(const std::string& path) +{ + BOOL fSuccess; + DWORD cbRead; + + TDEBUG_TRACE("Thgstatus::update(" << path << ")"); + + fSuccess = ::CallNamedPipeA( + THG_PIPENAME, (void*)path.c_str(), path.size(), 0, 0, &cbRead, + NMPWAIT_NOWAIT + ); + + if (fSuccess || ::GetLastError() == ERROR_MORE_DATA) + { + return 0; + } + else + { + return -1; + } +}
Change 1 of 1 Show Entire File win32/​shellext/​Thgstatus.h 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
@@ -0,0 +1,28 @@
+ +// Copyright (C) 2009 Adrian Buehlmann +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see <http://www.gnu.org/licenses/>. + +#ifndef _THGSTATUS_H +#define _THGSTATUS_H + +#include <string> + +class Thgstatus +{ +public: + static int update(const std::string& path); +}; + +#endif