D
Daniel Berger
Hi all,
Ruby 1.8.2
Windows XP
The following script dies a horrible death. I've tried different ways
of padding the url and buffer, but nothing has worked. Do I have the
method signature wrong?
# test.rb
require "Win32API"
MAX_PATH = 255
PathCreateFromUrl =
Win32API.new("shlwapi", "PathCreateFromUrl", "PPLL", "L")
buf = 0.chr * MAX_PATH
url = "file:///C:/foo" + 0.chr # I tried other ways of padding this
len = buf.length
p PathCreateFromUrl.call(url, buf, len, 0) # kaboom!
p buf
Regards,
Dan
Ruby 1.8.2
Windows XP
The following script dies a horrible death. I've tried different ways
of padding the url and buffer, but nothing has worked. Do I have the
method signature wrong?
# test.rb
require "Win32API"
MAX_PATH = 255
PathCreateFromUrl =
Win32API.new("shlwapi", "PathCreateFromUrl", "PPLL", "L")
buf = 0.chr * MAX_PATH
url = "file:///C:/foo" + 0.chr # I tried other ways of padding this
len = buf.length
p PathCreateFromUrl.call(url, buf, len, 0) # kaboom!
p buf
Regards,
Dan