[ANN] sys-win32etc 0.0.4

Thanks! That worked, though the wszTemp declaration didn’t need to be
moved. I don’t really understand what was invalid about my struct
allocation before.

With both the memory leaks solved and the TestUnit issues worked out, I will
now release this as 0.1.0 (stable). I’m also going to propose its
integration into the current Etc module for 1.8.1.

Thanks much.

Regards,

Dan

···

-----Original Message-----
From: Park Heesob [mailto:phasis@bcline.com]
Sent: Thursday, September 04, 2003 9:56 PM
To: ruby-talk@ruby-lang.org
Subject: Re: [ANN] sys-win32etc 0.0.4

Hi,
----- Original Message -----
From: “Berger, Daniel” djberge@qwest.com
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Friday, September 05, 2003 6:19 AM
Subject: [ANN] sys-win32etc 0.0.4

HELP WANTED

Testing is much appreciated, especially for the optional
server name.

Contrary to what I said in the docs, there is still one remaining
issue. For reasons I cannot determine, the current code
results in a
segfault
when
run in conjunction with TestUnit (at least, it does on my WinXP Pro
box). However, the vanilla test script (test.rb) works
fine. Help on
this peculiarity is definitely wanted.

I think It’s due to invalid struct allocation method.
Try following patch.

===============================================================
@@ -103,8 +103,10 @@
// This portion of code taken partially from a post by
Shashank Date.
// Also, the server name is automatically prepended to
the server name
// strictly for convenience.

  • wchar_t wszTemp[MAX_PATH];
  • gstruct = rb_struct_new(GroupStruct);
    if(tserver != Qnil){
  •  wchar_t wszTemp[MAX_PATH];
    
  •  VALUE server = rb_str_new2("\\\\");
     rb_str_concat(server,tserver);
     mbstowcs(wszTemp, STR2CSTR(server), MAX_PATH);
    

@@ -309,9 +311,11 @@

VALUE r_auth_flags = rb_ary_new();
VALUE uid = Qnil;
  • wchar_t wszTemp[MAX_PATH];

  • pstruct = rb_struct_new(PasswdStruct);
    if(tserver != Qnil){

  •  wchar_t wszTemp[MAX_PATH];
    
  •  VALUE server = rb_str_new2("\\\\");
     rb_str_concat(server,tserver); 
    

================================================================

Regards,

Park Heesob