Beispiel #1
0
        public void GlobalAtomTest()
        {
            const string name = "Test";
            var          atom = GlobalAddAtom(name);

            Assert.That(atom, Is.Not.Zero);
            Assert.That(GlobalFindAtom(name), Is.EqualTo(atom));
            Assert.That(GlobalGetAtomName(atom), Is.EqualTo(name));
            Assert.That(GlobalDeleteAtom(atom), ResultIs.Value(ATOM.INVALID_ATOM));
        }
Beispiel #2
0
        public void AtomTest()
        {
            const string name = "Test";

            Assert.That(InitAtomTable(7), ResultIs.Successful);
            var atom = AddAtom(name);

            Assert.That(atom, Is.Not.Zero);
            Assert.That(FindAtom(name), Is.EqualTo(atom));
            Assert.That(GetAtomName(atom), Is.EqualTo(name));
            Assert.That(DeleteAtom(atom), ResultIs.Value(ATOM.INVALID_ATOM));
        }
        public void HLocalTest()
        {
            HLOCAL hMem;

            Assert.That(hMem = LocalAlloc(LMEM.LHND, 256), ResultIs.ValidHandle);
            try
            {
                Assert.That(LocalFlags(hMem), ResultIs.Value(LMEM.LMEM_FIXED));
                Assert.That(LocalSize(hMem), ResultIs.Value(new SizeT(256)));
                IntPtr ptr;
                Assert.That(ptr = LocalLock(hMem), ResultIs.ValidHandle);
                Assert.That(LocalHandle(ptr), ResultIs.Value(hMem));
                Assert.That(LocalUnlock(hMem), ResultIs.Successful);
                Assert.That(hMem = LocalReAlloc(hMem, 128, 0), ResultIs.ValidHandle);
            }
            finally
            {
                Assert.That(LocalFree(hMem), ResultIs.Value(HLOCAL.NULL));
            }
        }
Beispiel #4
0
 public void GetSidSubAuthorityCountTest()
 {
     Assert.That(GetSidSubAuthorityCount(SafePSID.Everyone), ResultIs.Value(1));
 }
Beispiel #5
0
 public void GetSidSubAuthorityTest()
 {
     Assert.That(GetSidSubAuthority(SafePSID.Everyone, 0), ResultIs.Value(0));
 }