# Newbie Question: Ruby/DL Parameters

**URL:** <https://www.ruby-forum.com/t/newbie-question-ruby-dl-parameters/88430>\
**Category:** Ruby\
**Created:** [March 11, 2007, 12:06am UTC](https://www.ruby-forum.com/t/newbie-question-ruby-dl-parameters/88430 "2007-03-11T00:06:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![supasta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ebca7d/32.png) [@supasta](https://www.ruby-forum.com/u/supasta)\
**Post date:** [March 11, 2007, 12:06am UTC](https://www.ruby-forum.com/t/newbie-question-ruby-dl-parameters/88430/1 "2007-03-11T00:06:29Z")

</div>

Hello,

I am trying to call a function within a WIN32 DLL.

The Function Prototype is published as:  
short pm3s(char\* name, unsigned short addr, unsigned short\* units);

I coded this:

module Discover  
extend DL::Importable  
dlload “RPPM3DDI.DLL”  
extern “short pm3s(char\*, unsigned short, unsigned short\*)”  
end

s = “Monitor 3”  
unit = 0  
count = 0

res = Discover.pm3s(s, unit, count)

When executed, I get:

(eval):5: [BUG] Segmentation fault  
ruby 1.8.5 (2006-12-25) [i386-mswin32]

I assume that I am not specifying the parameters correctly. Any ideas  
or comments will be appreciated.

Thanks.
