Extended maintenance of Ruby 1.9.3 ended on February 23, 2015. Read more

In Files

  • dl/win32/lib/win32/sspi.rb

Win32::SSPI::SecurityBuffer

Creates binary representaiton of a SecBufferDesc structure, including the SecBuffer contained inside.

Public Class Methods

new(buffer = nil) click to toggle source
 
               # File dl/win32/lib/win32/sspi.rb, line 84
def initialize(buffer = nil)
        @buffer = buffer || "\0" * TOKENBUFSIZE
        @bufferSize = @buffer.length
        @type = SECBUFFER_TOKEN
end
            

Public Instance Methods

bufferSize() click to toggle source
 
               # File dl/win32/lib/win32/sspi.rb, line 90
def bufferSize
        unpack
        @bufferSize
end
            
bufferType() click to toggle source
 
               # File dl/win32/lib/win32/sspi.rb, line 95
def bufferType
        unpack
        @type
end
            
to_p() click to toggle source
 
               # File dl/win32/lib/win32/sspi.rb, line 105
def to_p
        # Assumption is that when to_p is called we are going to get a packed structure. Therefore,
        # set @unpacked back to nil so we know to unpack when accessors are next accessed.
        @unpacked = nil
        # Assignment of inner structure to variable is very important here. Without it,
        # will not be able to unpack changes to the structure. Alternative, nested unpacks,
        # does not work (i.e. @struct.unpack("LLP12")[2].unpack("LLP12") results in "no associated pointer")
        @sec_buffer ||= [@bufferSize, @type, @buffer].pack("LLP")
        @struct ||= [SECBUFFER_VERSION, 1, @sec_buffer].pack("LLP")
end
            
token() click to toggle source
 
               # File dl/win32/lib/win32/sspi.rb, line 100
def token
        unpack
        @buffer
end
            

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.