Wierd problems with Win32API and dlls

i am currently developing a more advanced audio and input system for the
ruby / gosu package and ive come across a strange problem with the audio
dll im using.
(The dll was created by a friend for his game but given to me to allow
me to further my system so i dont have the source code)
I have created the audio system before on rpgmaker xp (dont laugh... its
what got me into ruby back in the day) and was transfering it across on
my friends windows vista... everything was good there (except it needed
to loop the context creation process about 40 times to create it
properly - but thats understandable and worth it as it only needs to be
done on first startup) but when i moved the code back to my xp the
system doesnt work anymore. I have no idea why this is happening but the
context creation returns 0 which is a return error (it should return the
handle to a created audio stream). If possible would someone be able to
look at the dll (attached) and tell me what is wrong with this code:

require 'Win32API'
alias oldprint print
def print(*args)
alias p print
  loop do
    print 'attempting to create context'
    @context =
    if @context != 0
  print 'context created successfully - WIN!'
rescue Exception => error
  print "an error occured but shouldn't have - the error is: #{error}"

all that happens is the context will not be created correctly and will
try to be made again... i added my edited messaging system incase of an
error... its much easier to read it if it doesnt close down instantly.

i hope someone can find out whats wrong as this is REALLY important...



Posted via http://www.ruby-forum.com/.