Skip to content

Commit

Permalink
- fix for Cygwin 64-bit.
Browse files Browse the repository at this point in the history
- 1.08
  • Loading branch information
ganaware committed Aug 8, 2013
1 parent 88be42c commit 0a8cc8f
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 21 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ askpass.o: askpass.cpp askpassrc.h misc.h
misc.o: misc.cpp misc.h

win-ssh-agent: agent.o agent.res misc.o
$(LINK.cpp) -mwindows -e _mainCRTStartup -o $@ $^
$(LINK.cpp) -mwindows -o $@ $^

win-ssh-askpass: askpass.o askpass.res misc.o
$(LINK.cpp) -mconsole -e _mainCRTStartup -o $@ $^
$(LINK.cpp) -mconsole -o $@ $^

agent.res: agent.rc agentrc.h agent.ico agent.manifest
askpass.res: askpass.rc askpassrc.h askpass.ico askpass.manifest
Expand Down
18 changes: 13 additions & 5 deletions README-ja.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,18 @@
win-ssh-agent.exe と win-ssh-askpass.exe を同じディレクトリに置
いてください。(例: /usr/local/bin/ など)

cygwin の openssh が必要です。動作確認は openssh 5.9p1-1 で行い
32bit 版の Cygwin の場合は付属の win-ssh-agent.exe と
win-ssh-askpass.exe を使用することができます。

64bit 版の Cygwin の場合は、ソースをコンパイルしなおす
必要があります。「6. コンパイル」の手順を行ってから、上
記手順を行ってください。

cygwin の openssh が必要です。動作確認は openssh 6.2p2-1 で行い
ました。

Windows の環境変数 PATH に cygwin の /bin を追加してください。
(例: PATH=C:\cygwin\bin;...)
(例: PATH=C:\cygwin\bin;... や PATH=C:\cygwin64\bin;...)


3. 実行・終了
Expand Down Expand Up @@ -120,7 +127,7 @@

6. コンパイル

$ make && make install
$ make clean && make && make install

NOTE:
もし XP 環境で win-ssh-askpass.exe がうまく動作しないよ
Expand All @@ -136,7 +143,7 @@

8. Copyright

Copyright (c) 2001-2006, 2011 TAGA Nayuta <nayuta@ganaware.jp>
Copyright (c) 2001-2006, 2011, 2013 TAGA Nayuta <nayuta@ganaware.jp>
All rights reserved.

Redistribution and use in source and binary forms, with or
Expand Down Expand Up @@ -174,12 +181,13 @@

9. 履歴

2011/??/?? 1.08
2013/08/08 1.08
* make install-xp で Visual スタイルダイアログボックス
を使用しない exe を作成するようにしました。Windows
XP 環境で win-ssh-askpass.exe の起動に失敗するケース
があるケースに対応するためです。
(Thanks to Patrick Mézard)
* Cygwin 64-bit 用修正

2011/11/02 1.07
* プロジェクト名を win-ssh-askpass から win-ssh-agent へ変更。
Expand Down
19 changes: 14 additions & 5 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,19 @@
The win-ssh-agent.exe and the win-ssh-askpass.exe should be in
the same directory (e.g. /usr/local/bin/) .

For 32-bit Cygwin, you can use the attached
win-ssh-agent.exe and the attached
win-ssh-askpass.exe.

For 64-bit Cygwin, you need to compile sources.
Follow the section "6. Compile", then do the above
instruction.

Install the cygwin openssh by the cygwin setup.exe.
I confirmed that the openssh-5.9p1-1 worked properly.
I confirmed that the openssh-6.2p2-1 worked properly.

The system wide PATH environment variable must have /bin of the
cygwin (e.g. PATH=C:\cygwin\bin;...)
cygwin (e.g. PATH=C:\cygwin\bin;... or PATH=C:\cygwin64\bin;...)


3. Run and Terminate
Expand Down Expand Up @@ -134,7 +142,7 @@

If you want to re-compile, please do make.

$ make && make install
$ make clean && make && make install

NOTE:
If win-ssh-askpass.exe cannot run under Windows XP,
Expand All @@ -150,7 +158,7 @@

8. Copyright

Copyright (c) 2001-2006, 2011, TAGA Nayuta <nayuta@ganaware.jp>
Copyright (c) 2001-2006, 2011, 2013, TAGA Nayuta <nayuta@ganaware.jp>
All rights reserved.

Redistribution and use in source and binary forms, with or
Expand Down Expand Up @@ -188,10 +196,11 @@

9. History

2011/??/?? 1.08
2013/08/08 1.08
* "make install-xp" is added to build a
win-ssh-askpass.exe without visual-style dialogbox.
(Thanks to Patrick Mézard)
* Fixed for Cygwin 64-bit.

2011/11/02 1.07
* This project is renamed to win-ssh-agent from win-ssh-askpass.
Expand Down
6 changes: 3 additions & 3 deletions agent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ void run_program(char **i_argv)
ShellExecuteW(NULL, L"open", win32_pathname.c_str(), NULL,
NULL, SW_SHOWDEFAULT);
}
ULONG r = reinterpret_cast<ULONG>(result);
intptr_t r = reinterpret_cast<intptr_t>(result);
if (r < 32) {
std::wstring message;
message += L"Failed to run: ";
Expand All @@ -226,7 +226,7 @@ void run_program(char **i_argv)
wchar_t buf[BUFSIZE];
swprintf(buf, BUFSIZE, L"%d", r);
message += buf;
switch (reinterpret_cast<ULONG>(result)) {
switch (reinterpret_cast<intptr_t>(result)) {
#define SHELL_EXECUTE_ERROR(name) case name: message += L" (" L## #name L")"; break
SHELL_EXECUTE_ERROR(ERROR_FILE_NOT_FOUND);
SHELL_EXECUTE_ERROR(ERROR_PATH_NOT_FOUND);
Expand Down Expand Up @@ -606,7 +606,7 @@ class CRegistoryEnvironment : private noncopyable {
}

void broadcast() {
DWORD returnValue;
DWORD_PTR returnValue;
SendMessageTimeoutW(HWND_BROADCAST, WM_SETTINGCHANGE, 0,
reinterpret_cast<LPARAM>(L"Environment"),
SMTO_ABORTIFHUNG,
Expand Down
2 changes: 1 addition & 1 deletion agent.manifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.7.0.0"
version="1.8.0.0"
processorArchitecture="*"
name="ganaware.win-ssh-askpass.win-ssh-agent"
type="win32"
Expand Down
8 changes: 4 additions & 4 deletions askpass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ class DialogPassphrase : private noncopyable
std::wstring m_passPhrase; // result

private:
static BOOL CALLBACK dlgProc(HWND i_hwnd, UINT i_message,
WPARAM i_wParam, LPARAM i_lParam)
static INT_PTR CALLBACK dlgProc(HWND i_hwnd, UINT i_message,
WPARAM i_wParam, LPARAM i_lParam)
{
DialogPassphrase *This =
reinterpret_cast<DialogPassphrase *>(
GetWindowLongW(i_hwnd, GWL_USERDATA));
GetWindowLongPtrW(i_hwnd, GWLP_USERDATA));
if (!This)
switch (i_message)
{
case WM_INITDIALOG:
This = reinterpret_cast<DialogPassphrase *>(i_lParam);
SetWindowLongW(i_hwnd, GWL_USERDATA, i_lParam);
SetWindowLongPtrW(i_hwnd, GWLP_USERDATA, i_lParam);
This->initialize(i_hwnd);
return This->wmInitDialog(reinterpret_cast<HWND>(i_wParam));
}
Expand Down
2 changes: 1 addition & 1 deletion askpass.manifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.7.0.0"
version="1.8.0.0"
processorArchitecture="*"
name="ganaware.win-ssh-askpass.win-ssh-askpass"
type="win32"
Expand Down

0 comments on commit 0a8cc8f

Please sign in to comment.