Skip to content

Commit

Permalink
Make sure we pass parameters as binary on windows.
Browse files Browse the repository at this point in the history
This fixes paramiko#320 (thanks @adamkerz).
  • Loading branch information
lndbrg authored and bitprophet committed Oct 1, 2014
1 parent 83f54e4 commit a381b08
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions paramiko/win_pageant.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import platform
import struct
from paramiko.util import *
from paramiko.py3compat import b

try:
import _thread as thread # Python 3.x
Expand All @@ -43,7 +44,7 @@


def _get_pageant_window_object():
return ctypes.windll.user32.FindWindowA('Pageant', 'Pageant')
return ctypes.windll.user32.FindWindowA(b('Pageant'), b('Pageant'))


def can_talk_to_agent():
Expand Down Expand Up @@ -90,7 +91,7 @@ def _query_pageant(msg):
with pymap:
pymap.write(msg)
# Create an array buffer containing the mapped filename
char_buffer = array.array("c", b(map_name) + zero_byte)
char_buffer = array.array("b", b(map_name) + zero_byte)
char_buffer_address, char_buffer_size = char_buffer.buffer_info()
# Create a string to use for the SendMessage function call
cds = COPYDATASTRUCT(_AGENT_COPYDATA_ID, char_buffer_size,
Expand Down

0 comments on commit a381b08

Please sign in to comment.