def testDsCrackNames(self): h = win32security.DsBind() fmt_offered = ntsecuritycon.DS_FQDN_1779_NAME name = win32api.GetUserNameEx(fmt_offered) result = win32security.DsCrackNames(h, 0, fmt_offered, fmt_offered, (name, )) self.failUnlessEqual(name, result[0][2])
def testDsCrackNamesSyntax(self): # Do a syntax check only - that allows us to avoid binding. # But must use DS_CANONICAL_NAME (or _EX) expected = win32api.GetUserNameEx(win32api.NameCanonical) fmt_offered = ntsecuritycon.DS_FQDN_1779_NAME name = win32api.GetUserNameEx(fmt_offered) result = win32security.DsCrackNames( None, ntsecuritycon.DS_NAME_FLAG_SYNTACTICAL_ONLY, fmt_offered, ntsecuritycon.DS_CANONICAL_NAME, (name, )) self.failUnlessEqual(expected, result[0][2])