Ejemplo n.º 1
0
    def testReadUInt(self):
        data = Marshal.AllocHGlobal(CPyMarshal.IntSize)

        Marshal.WriteInt32(data, 0)
        self.assertEquals(CPyMarshal.ReadUInt(data), 0, "wrong")

        Marshal.WriteInt32(data, -1)
        self.assertEquals(CPyMarshal.ReadUInt(data), 0xFFFFFFFF, "wrong")

        Marshal.FreeHGlobal(data)
Ejemplo n.º 2
0
 def WriteBytes(address):
     for a in range(intCount):
         ptr = OffsetPtr(address, a * CPyMarshal.IntSize)
         Marshal.WriteInt32(ptr, TEST_NUMBER)