From: Daniel Berger Date: 2006-03-19T03:08:48+09:00 Subject: Re: Win32API struct member help Park Heesob wrote: > Hi, > memcpy is required for pointer reference,try this: > > memcpy = Win32API.new('msvcrt','memcpy','PLL','P') > acl_buf = "\0" * 8 > memcpy.call(acl_buf,acl_ptr.unpack('L')[0],8) > p acl_buf.unpack('CCSSS') Ok, along the same lines, I'm having some trouble with GetAce(). Using 'acl_buf' from above: GetAce = Win32API.new('advapi32', 'GetAce', 'PLP', 'I') ace_count = acl_buf.unpack('CCSSS')[3] # 4 ace_ptr = [0].pack('L') 0.upto(ace_count - 1){ |i| if GetAce.call(acl_buf, i, ace_ptr) == 0 next end ace_buf = 0.chr * 4 # 2 BYTE, 1 WORD memcpy.call(ace_buf, ace_ptr.unpack('L').first, 4) # This doesn't return the values I would have expected p ace_buf.unpack('CCS') } I would have expected somewhere between 20 and 40 for the third element of the array returned by ace_buf.unpack('CCS'), but instead I'm getting 0. What am I doing wrong this time? Thanks, Dan