Thread: [pywin32-checkins] pywin32/win32/src win32security.i,1.35,1.36
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Roger U. <ru...@us...> - 2007-01-07 03:52:20
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30752/win32/src Modified Files: win32security.i Log Message: In LsaDeregisterLogonProcess, call PyLsaLogon_HANDLE's Close() method Check handle type in LsaDeregisterLogonProcess and LsaClose Remove places where HANDLEs parsed as longs Add method names to PyArg_ParseTuple formats Index: win32security.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32security.i,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** win32security.i 2 Dec 2006 15:24:11 -0000 1.35 --- win32security.i 7 Jan 2007 03:52:18 -0000 1.36 *************** *** 209,229 **** BOOL PyWinObject_CloseLSA_HANDLE(PyObject *obHandle) { ! BOOL ok; ! if (PyHANDLE_Check(obHandle)) ! // Python error already set. ! ok = ((PyLSA_HANDLE *)obHandle)->Close(); ! else if PyInt_Check(obHandle) { ! NTSTATUS err; ! err=LsaClose((HKEY)PyInt_AsLong(obHandle)); ! ok = err == STATUS_SUCCESS; ! if (!ok) ! PyWin_SetAPIError("LsaClose",LsaNtStatusToWinError(err)); ! } else { ! PyErr_SetString(PyExc_TypeError, "A handle must be a LSA_HANDLE object or an integer"); ! ok = FALSE; ! } ! return ok; } // And re-define, so PyHANDLE in function sigs gets the PyHANDLE treatment. #define PyHANDLE HANDLE --- 209,255 ---- BOOL PyWinObject_CloseLSA_HANDLE(PyObject *obHandle) { ! if (PyHANDLE_Check(obHandle)){ ! // If it's a PyHANDLE, make sure it's the right type, since any other handle's Close method could be called successfully ! if (strcmp(((PyHANDLE *)obHandle)->GetTypeName(),"PyLSA_HANDLE")!=0){ ! PyErr_SetString(PyExc_TypeError,"PyHANDLE passed to LsaClose must be a PyLSA_HANDLE"); ! return FALSE; ! } ! return ((PyHANDLE *)obHandle)->Close(); ! } ! ! HANDLE lsahandle; ! NTSTATUS err; ! if (!PyWinObject_AsHANDLE(obHandle, &lsahandle, FALSE)) ! return FALSE; ! err=LsaClose(lsahandle); ! if (err==STATUS_SUCCESS) ! return TRUE; ! PyWin_SetAPIError("LsaClose",LsaNtStatusToWinError(err)); ! return FALSE; } + BOOL PyWinObject_CloseLsaLogon_HANDLE(PyObject *obHandle) + { + if (PyHANDLE_Check(obHandle)){ + // If it's a PyHANDLE, make sure it's the right type, since any other handle's Close method could be called successfully + if (strcmp(((PyHANDLE *)obHandle)->GetTypeName(),"PyLsaLogon_HANDLE")!=0){ + PyErr_SetString(PyExc_TypeError,"PyHANDLE passed to LsaDeregisterLogonProcess must be a PyLsaLogon_HANDLE"); + return FALSE; + } + return ((PyHANDLE *)obHandle)->Close(); + } + + HANDLE lsahandle; + NTSTATUS err; + if (!PyWinObject_AsHANDLE(obHandle, &lsahandle, FALSE)) + return FALSE; + // function pointer checked in PyLsaDeregisterLogonProcess + err=(*pfnLsaDeregisterLogonProcess)(lsahandle); + if (err==STATUS_SUCCESS) + return TRUE; + PyWin_SetAPIError("LsaDeregisterLogonProcess",LsaNtStatusToWinError(err)); + return FALSE; + } + // And re-define, so PyHANDLE in function sigs gets the PyHANDLE treatment. #define PyHANDLE HANDLE *************** *** 1467,1471 **** DWORD reqdbufsize=0, origgroupcnt=1, origbufsize, err; ! if (!PyArg_ParseTuple(args, "OiO", &obHandle, // @pyparm <o PyHANDLE>|obHandle||The handle to access token to be modified &reset, // @pyparm boolean|ResetToDefault||Sets groups to default enabled/disabled states, --- 1493,1497 ---- DWORD reqdbufsize=0, origgroupcnt=1, origbufsize, err; ! if (!PyArg_ParseTuple(args, "OiO:AdjustTokenGroups", &obHandle, // @pyparm <o PyHANDLE>|obHandle||The handle to access token to be modified &reset, // @pyparm boolean|ResetToDefault||Sets groups to default enabled/disabled states, *************** *** 1526,1530 **** void *buf = NULL; TOKEN_INFORMATION_CLASS typ; ! if (!PyArg_ParseTuple(args, "Ol", &obHandle, // @pyparm <o PyHANDLE>|handle||The handle to query the information for. (long *)&typ)) // @pyparm int|TokenInformationClass||Specifies a value from the TOKEN_INFORMATION_CLASS enumerated type identifying the type of information the function retrieves. --- 1552,1556 ---- void *buf = NULL; TOKEN_INFORMATION_CLASS typ; ! if (!PyArg_ParseTuple(args, "Ol:GetTokenInformation", &obHandle, // @pyparm <o PyHANDLE>|handle||The handle to query the information for. (long *)&typ)) // @pyparm int|TokenInformationClass||Specifies a value from the TOKEN_INFORMATION_CLASS enumerated type identifying the type of information the function retrieves. *************** *** 1689,1693 **** { PyObject *obThread, *obToken; ! if (!PyArg_ParseTuple(args, "OO", &obThread, // @pyparm <o PyHANDLE>|Thread||Handle to a thread. Use None to indicate calling thread. &obToken)) // @pyparm <o PyHANDLE>|Token||Handle to an impersonation token. Use None to end impersonation. --- 1715,1719 ---- { PyObject *obThread, *obToken; ! if (!PyArg_ParseTuple(args, "OO:SetThreadToken", &obThread, // @pyparm <o PyHANDLE>|Thread||Handle to a thread. Use None to indicate calling thread. &obToken)) // @pyparm <o PyHANDLE>|Token||Handle to an impersonation token. Use None to end impersonation. *************** *** 1728,1732 **** // @pyparm string|filename||The name of the file // @pyparm int|info|OWNER_SECURITY_INFORMATION \| GROUP_SECURITY_INFORMATION \| DACL_SECURITY_INFORMATION \| SACL_SECURITY_INFORMATION|Flags that specify the information requested. ! if (!PyArg_ParseTuple(args, "O|l", &obFname, &info)) return NULL; --- 1754,1758 ---- // @pyparm string|filename||The name of the file // @pyparm int|info|OWNER_SECURITY_INFORMATION \| GROUP_SECURITY_INFORMATION \| DACL_SECURITY_INFORMATION \| SACL_SECURITY_INFORMATION|Flags that specify the information requested. ! if (!PyArg_ParseTuple(args, "O|l:GetFileSecurity", &obFname, &info)) return NULL; *************** *** 1772,1776 **** // @pyparm int|info||The type of information to set. // @pyparm <o PySECURITY_DESCRIPTOR>|security||The security information ! if (!PyArg_ParseTuple(args, "OlO", &obFname, &info, &obsd)) return NULL; --- 1798,1802 ---- // @pyparm int|info||The type of information to set. // @pyparm <o PySECURITY_DESCRIPTOR>|security||The security information ! if (!PyArg_ParseTuple(args, "OlO:SetFileSecurity", &obFname, &info, &obsd)) return NULL; *************** *** 1805,1809 **** // @pyparm <o PyHANDLE>|handle||The handle to the object // @pyparm int|info|OWNER_SECURITY_INFORMATION \| GROUP_SECURITY_INFORMATION \| DACL_SECURITY_INFORMATION \| SACL_SECURITY_INFORMATION|Flags that specify the information requested. ! if (!PyArg_ParseTuple(args, "O|l", &obHandle, &info)) return NULL; --- 1831,1835 ---- // @pyparm <o PyHANDLE>|handle||The handle to the object // @pyparm int|info|OWNER_SECURITY_INFORMATION \| GROUP_SECURITY_INFORMATION \| DACL_SECURITY_INFORMATION \| SACL_SECURITY_INFORMATION|Flags that specify the information requested. ! if (!PyArg_ParseTuple(args, "O|l:GetUserObjectSecurity", &obHandle, &info)) return NULL; *************** *** 1848,1852 **** // @pyparm int|info||The type of information to set - combination of SECURITY_INFORMATION values // @pyparm <o PySECURITY_DESCRIPTOR>|security||The security information ! if (!PyArg_ParseTuple(args, "OlO", &obHandle, &info, &obsd)) return NULL; --- 1874,1878 ---- // @pyparm int|info||The type of information to set - combination of SECURITY_INFORMATION values // @pyparm <o PySECURITY_DESCRIPTOR>|security||The security information ! if (!PyArg_ParseTuple(args, "OlO:SetUserObjectSecurity", &obHandle, &info, &obsd)) return NULL; *************** *** 1880,1884 **** // @pyparm <o PyHANDLE>|handle||The handle to the object // @pyparm int|info|OWNER_SECURITY_INFORMATION \| GROUP_SECURITY_INFORMATION \| DACL_SECURITY_INFORMATION \| SACL_SECURITY_INFORMATION|Flags that specify the information requested. ! if (!PyArg_ParseTuple(args, "O|l", &obHandle, &info)) return NULL; --- 1906,1910 ---- // @pyparm <o PyHANDLE>|handle||The handle to the object // @pyparm int|info|OWNER_SECURITY_INFORMATION \| GROUP_SECURITY_INFORMATION \| DACL_SECURITY_INFORMATION \| SACL_SECURITY_INFORMATION|Flags that specify the information requested. ! if (!PyArg_ParseTuple(args, "O|l:GetKernelObjectSecurity", &obHandle, &info)) return NULL; *************** *** 1923,1927 **** // @pyparm int|info||The type of information to set - combination of SECURITY_INFORMATION values // @pyparm <o PySECURITY_DESCRIPTOR>|security||The security information ! if (!PyArg_ParseTuple(args, "OlO", &obHandle, &info, &obsd)) return NULL; --- 1949,1953 ---- // @pyparm int|info||The type of information to set - combination of SECURITY_INFORMATION values // @pyparm <o PySECURITY_DESCRIPTOR>|security||The security information ! if (!PyArg_ParseTuple(args, "OlO:SetKernelObjectSecurity", &obHandle, &info, &obsd)) return NULL; *************** *** 1960,1964 **** TOKEN_INFORMATION_CLASS typ; ! if (!PyArg_ParseTuple(args, "OiO", &obth, // @pyparm <o PyHANDLE>|handle||Handle to an access token to be modified (long *)&typ, // @pyparm int|TokenInformationClass||Specifies a value from the TOKEN_INFORMATION_CLASS enumerated type identifying the type of information the function retrieves. --- 1986,1990 ---- TOKEN_INFORMATION_CLASS typ; ! if (!PyArg_ParseTuple(args, "OiO:SetTokenInformation", &obth, // @pyparm <o PyHANDLE>|handle||Handle to an access token to be modified (long *)&typ, // @pyparm int|TokenInformationClass||Specifies a value from the TOKEN_INFORMATION_CLASS enumerated type identifying the type of information the function retrieves. *************** *** 2050,2054 **** %} ! // @pyswig |LsaClose|Closes a policy handle created by GetPolicyHandle %native(LsaClose) PyLsaClose; %{ --- 2076,2080 ---- %} ! // @pyswig |LsaClose|Closes a policy handle created by <om win32security.LsaOpenPolicy> %native(LsaClose) PyLsaClose; %{ *************** *** 2078,2082 **** void* buf = NULL; POLICY_INFORMATION_CLASS info_class; ! // @pyparm <o PyHANDLE>|PolicyHandle||An LSA policy handle as returned by <om win32security.LsaOpenPolicy> // @pyparm int|InformationClass||POLICY_INFORMATION_CLASS value if (!PyArg_ParseTuple(args, "Oi:LsaQueryInformationPolicy", &obhandle, (long *)&info_class)) --- 2104,2108 ---- void* buf = NULL; POLICY_INFORMATION_CLASS info_class; ! // @pyparm <o PyLSA_HANDLE>|PolicyHandle||An LSA policy handle as returned by <om win32security.LsaOpenPolicy> // @pyparm int|InformationClass||POLICY_INFORMATION_CLASS value if (!PyArg_ParseTuple(args, "Oi:LsaQueryInformationPolicy", &obhandle, (long *)&info_class)) *************** *** 2194,2198 **** void* buf = NULL; POLICY_INFORMATION_CLASS info_class; ! // @pyparm <o PyHANDLE>|PolicyHandle||An LSA policy handle as returned by <om win32security.LsaOpenPolicy> // @pyparm int|InformationClass||POLICY_INFORMATION_CLASS value // @pyparm object|Information||Type is dependent on InformationClass --- 2220,2224 ---- void* buf = NULL; POLICY_INFORMATION_CLASS info_class; ! // @pyparm <o PyLSA_HANDLE>|PolicyHandle||An LSA policy handle as returned by <om win32security.LsaOpenPolicy> // @pyparm int|InformationClass||POLICY_INFORMATION_CLASS value // @pyparm object|Information||Type is dependent on InformationClass *************** *** 2260,2264 **** %} ! // @pyswig |LsaAddAccountRights|Adds a list of privliges to an account - account is created if it doesn't already exist %native(LsaAddAccountRights) PyLsaAddAccountRights; %{ --- 2286,2290 ---- %} ! // @pyswig |LsaAddAccountRights|Adds a list of privileges to an account - account is created if it doesn't already exist %native(LsaAddAccountRights) PyLsaAddAccountRights; %{ *************** *** 2272,2276 **** HANDLE hpolicy; NTSTATUS err; ! // @pyparm <o PyHANDLE>|PolicyHandle||An LSA policy handle as returned by <om win32security.LsaOpenPolicy> // @pyparm <o PySID>|AccountSid||Account to which privs will be added // @pyparm (str/unicode,...)|UserRights||List of privilege names (SE_*_NAME unicode constants) --- 2298,2302 ---- HANDLE hpolicy; NTSTATUS err; ! // @pyparm <o PyLSA_HANDLE>|PolicyHandle||An LSA policy handle as returned by <om win32security.LsaOpenPolicy> // @pyparm <o PySID>|AccountSid||Account to which privs will be added // @pyparm (str/unicode,...)|UserRights||List of privilege names (SE_*_NAME unicode constants) *************** *** 2337,2341 **** HANDLE hpolicy; NTSTATUS err; ! // @pyparm <o PyHANDLE>|PolicyHandle||An LSA policy handle as returned by <om win32security.LsaOpenPolicy> // @pyparm <o PySID>|AccountSid||Account whose privileges will be removed // @pyparm int|AllRights||Boolean value indicating if all privs should be removed from account --- 2363,2367 ---- HANDLE hpolicy; NTSTATUS err; ! // @pyparm <o PyLSA_HANDLE>|PolicyHandle||An LSA policy handle as returned by <om win32security.LsaOpenPolicy> // @pyparm <o PySID>|AccountSid||Account whose privileges will be removed // @pyparm int|AllRights||Boolean value indicating if all privs should be removed from account *************** *** 2402,2406 **** HANDLE hpolicy; NTSTATUS err; ! // @pyparm <o PyHANDLE>|PolicyHandle||An LSA policy handle as returned by <om win32security.LsaOpenPolicy> // @pyparm <o PySID>|AccountSid||Security identifier of account for which to list privs if (!PyArg_ParseTuple(args, "OO:LsaEnumerateAccountRights", &policy_handle, &obsid)) --- 2428,2432 ---- HANDLE hpolicy; NTSTATUS err; ! // @pyparm <o PyLSA_HANDLE>|PolicyHandle||An LSA policy handle as returned by <om win32security.LsaOpenPolicy> // @pyparm <o PySID>|AccountSid||Security identifier of account for which to list privs if (!PyArg_ParseTuple(args, "OO:LsaEnumerateAccountRights", &policy_handle, &obsid)) *************** *** 2444,2448 **** NTSTATUS err; DWORD win32err; ! // @pyparm <o PyHANDLE>|PolicyHandle||An LSA policy handle as returned by <om win32security.LsaOpenPolicy> // @pyparm str/unicode|UserRight||Name of privilege (SE_*_NAME unicode constant) if (!PyArg_ParseTuple(args, "OO:LsaEnumerateAccountsWithUserRight", &policy_handle, &obpriv)) --- 2470,2474 ---- NTSTATUS err; DWORD win32err; ! // @pyparm <o PyLSA_HANDLE>|PolicyHandle||An LSA policy handle as returned by <om win32security.LsaOpenPolicy> // @pyparm str/unicode|UserRight||Name of privilege (SE_*_NAME unicode constant) if (!PyArg_ParseTuple(args, "OO:LsaEnumerateAccountsWithUserRight", &policy_handle, &obpriv)) *************** *** 2591,2595 **** static PyObject *PyLsaStorePrivateData(PyObject *self, PyObject *args) { ! // @pyparm <o PyHANDLE>|PolicyHandle||An LSA policy handle as returned by <om win32security.LsaOpenPolicy> // @pyparm string|KeyName||Registry key in which to store data // @pyparm <o PyUNICODE>|PrivateData||Unicode string to be encrypted and stored --- 2617,2621 ---- static PyObject *PyLsaStorePrivateData(PyObject *self, PyObject *args) { ! // @pyparm <o PyLSA_HANDLE>|PolicyHandle||An LSA policy handle as returned by <om win32security.LsaOpenPolicy> // @pyparm string|KeyName||Registry key in which to store data // @pyparm <o PyUNICODE>|PrivateData||Unicode string to be encrypted and stored *************** *** 2636,2640 **** static PyObject *PyLsaRetrievePrivateData(PyObject *self, PyObject *args) { ! // @pyparm <o PyHANDLE>|PolicyHandle||An LSA policy handle as returned by <om win32security.LsaOpenPolicy> // @pyparm string|KeyName||Registry key to read PyObject *obpolicyhandle=NULL, *obkeyname=NULL, *obprivatedata=NULL; --- 2662,2666 ---- static PyObject *PyLsaRetrievePrivateData(PyObject *self, PyObject *args) { ! // @pyparm <o PyLSA_HANDLE>|PolicyHandle||An LSA policy handle as returned by <om win32security.LsaOpenPolicy> // @pyparm string|KeyName||Registry key to read PyObject *obpolicyhandle=NULL, *obkeyname=NULL, *obprivatedata=NULL; *************** *** 2906,2910 **** CHECK_PFN(CreateRestrictedToken); ! if (!PyArg_ParseTuple(args,"OlOOO", &obExistingTokenHandle, // @pyparm <o PyHANDLE>|ExistingTokenHandle||Handle to an access token (see <om win32security.LogonUser>,<om win32security.OpenProcessToken> &Flags, // @pyparm int|Flags||Valid values are zero or a combination of DISABLE_MAX_PRIVILEGE and SANDBOX_INERT --- 2932,2936 ---- CHECK_PFN(CreateRestrictedToken); ! if (!PyArg_ParseTuple(args,"OlOOO:CreateRestrictedToken", &obExistingTokenHandle, // @pyparm <o PyHANDLE>|ExistingTokenHandle||Handle to an access token (see <om win32security.LogonUser>,<om win32security.OpenProcessToken> &Flags, // @pyparm int|Flags||Valid values are zero or a combination of DISABLE_MAX_PRIVILEGE and SANDBOX_INERT *************** *** 2982,2997 **** { CHECK_PFN(LsaDeregisterLogonProcess); ! HANDLE lsahandle; ! NTSTATUS err; ! // @pyparm int|LsaHandle||An Lsa handle as returned by LsaConnectUntrusted or LsaRegisterLogonProcess ! if (!PyArg_ParseTuple(args, "l:LsaDeregisterLogonProcess",&lsahandle)) return NULL; ! err=(*pfnLsaDeregisterLogonProcess)(lsahandle); ! if (err==STATUS_SUCCESS){ ! Py_INCREF(Py_None); ! return Py_None; ! } ! PyWin_SetAPIError("LsaDeregisterLogonProcess",LsaNtStatusToWinError(err)); ! return NULL; } %} --- 3008,3019 ---- { CHECK_PFN(LsaDeregisterLogonProcess); ! PyObject *obhandle; ! // @pyparm <o PyLsaLogon_HANDLE>|LsaHandle||An Lsa handle as returned by <om win32security.LsaConnectUntrusted> or <om win32security.LsaRegisterLogonProcess> ! if (!PyArg_ParseTuple(args, "O:LsaDeregisterLogonProcess",&obhandle)) return NULL; ! if (!PyWinObject_CloseLsaLogon_HANDLE(obhandle)) ! return NULL; ! Py_INCREF(Py_None); ! return Py_None; } %} *************** *** 3006,3016 **** NTSTATUS err; HANDLE lsahandle; LSA_STRING packagename; ULONG packageid; ! // @pyparm int|<o PyLsaLogon_HANDLE>||An Lsa handle as returned by <om win32security.LsaConnectUntrusted> or <om win32security.LsaRegisterLogonProcess> // @pyparm string|PackageName||Name of security package to be identified ! ! if (!PyArg_ParseTuple(args,"ls#:LsaLookupAuthenticationPackage", &lsahandle, &packagename.Buffer, &packagename.Length)) return NULL; packagename.MaximumLength=packagename.Length+1; err=(*pfnLsaLookupAuthenticationPackage)(lsahandle, &packagename, &packageid); --- 3028,3041 ---- NTSTATUS err; HANDLE lsahandle; + PyObject *obhandle; LSA_STRING packagename; ULONG packageid; ! // @pyparm <o PyLsaLogon_HANDLE>|LsaHandle||An Lsa handle as returned by <om win32security.LsaConnectUntrusted> or <om win32security.LsaRegisterLogonProcess> // @pyparm string|PackageName||Name of security package to be identified ! if (!PyArg_ParseTuple(args,"Os#:LsaLookupAuthenticationPackage", &obhandle, &packagename.Buffer, &packagename.Length)) return NULL; + if (!PyWinObject_AsHANDLE(obhandle, &lsahandle, FALSE)) + return NULL; + packagename.MaximumLength=packagename.Length+1; err=(*pfnLsaLookupAuthenticationPackage)(lsahandle, &packagename, &packageid); *************** *** 3186,3190 **** SECURITY_STATUS err; ! if (!PyArg_ParseTuple(args,"OOlOO|OO", &obPrincipal, // @pyparm str/unicode|Principal||Use None for current security context &obPackage, // @pyparm str/unicode|Package||Name of security package that credentials will be used with --- 3211,3215 ---- SECURITY_STATUS err; ! if (!PyArg_ParseTuple(args,"OOlOO|OO:AcquireCredentialsHandle", &obPrincipal, // @pyparm str/unicode|Principal||Use None for current security context &obPackage, // @pyparm str/unicode|Package||Name of security package that credentials will be used with *************** *** 3245,3249 **** SECURITY_STATUS err; PyObject *ret=NULL; ! if (!PyArg_ParseTuple(args,"OOOllOOO", &obcredhandle, // @pyparm <o PyCredHandle>|Credential||A credentials handle as returned by <om win32security.AcquireCredentialsHandle> &obctxt, // @pyparm <o PyCtxtHandle>|Context||Use None on initial call, then handle returned in NewContext thereafter --- 3270,3274 ---- SECURITY_STATUS err; PyObject *ret=NULL; ! if (!PyArg_ParseTuple(args,"OOOllOOO:InitializeSecurityContext", &obcredhandle, // @pyparm <o PyCredHandle>|Credential||A credentials handle as returned by <om win32security.AcquireCredentialsHandle> &obctxt, // @pyparm <o PyCtxtHandle>|Context||Use None on initial call, then handle returned in NewContext thereafter *************** *** 3297,3301 **** PyObject *ret=NULL; ! if (!PyArg_ParseTuple(args,"OOOllOO", &obcredhandle, // @pyparm <o PyCredHandle>|Credential||Handle to server's credentials (see AcquireCredentialsHandle) &obctxt, // @pyparm <o PyCtxtHandle>|Context||Use None on initial call, then handle returned in NewContext thereafter --- 3322,3326 ---- PyObject *ret=NULL; ! if (!PyArg_ParseTuple(args,"OOOllOO:AcceptSecurityContext", &obcredhandle, // @pyparm <o PyCredHandle>|Credential||Handle to server's credentials (see AcquireCredentialsHandle) &obctxt, // @pyparm <o PyCtxtHandle>|Context||Use None on initial call, then handle returned in NewContext thereafter *************** *** 3374,3384 **** CHECK_PFN(LsaFreeReturnBuffer); HANDLE lsahandle; NTSTATUS err, protocol_status; ULONG pkgid, inputbuflen, outputbuflen, msgtype; PVOID inputbuf=NULL, outputbuf=NULL; PyObject *ret=NULL, *obinputbuf; ! if (!PyArg_ParseTuple(args, "lllO:LsaCallAuthenticationPackage", &lsahandle, &pkgid, &msgtype, &obinputbuf)) return NULL; ! // Message-specific input // @flagh MessageType|Input type --- 3399,3412 ---- CHECK_PFN(LsaFreeReturnBuffer); HANDLE lsahandle; + PyObject *obhandle; NTSTATUS err, protocol_status; ULONG pkgid, inputbuflen, outputbuflen, msgtype; PVOID inputbuf=NULL, outputbuf=NULL; PyObject *ret=NULL, *obinputbuf; ! if (!PyArg_ParseTuple(args, "OllO:LsaCallAuthenticationPackage", &obhandle, &pkgid, &msgtype, &obinputbuf)) return NULL; ! if (!PyWinObject_AsHANDLE(obhandle, &lsahandle, FALSE)) ! return NULL; ! // Message-specific input // @flagh MessageType|Input type *************** *** 3514,3518 **** WCHAR *buf = NULL; BOOL ok; ! if (!PyArg_ParseTuple(args, "Oii|l", &obAcctName, // @pyparm <o PyUnicode>|accountName||object name &format, // @pyparm int|accountNameFormat||A value from the EXTENDED_NAME_FORMAT enumeration type indicating the format of the accountName name. --- 3542,3546 ---- WCHAR *buf = NULL; BOOL ok; ! if (!PyArg_ParseTuple(args, "Oii|l:TranslateName", &obAcctName, // @pyparm <o PyUnicode>|accountName||object name &format, // @pyparm int|accountNameFormat||A value from the EXTENDED_NAME_FORMAT enumeration type indicating the format of the accountName name. *************** *** 3557,3561 **** return PyErr_Format(PyExc_MemoryError, "CreateWellKnownSid: Unable to allocate %d bytes", bufsize); ! if (!PyArg_ParseTuple(args, "k|O", &sidtype, // @pyparm int|WellKnownSidType||One of the Win*Sid constants &obDomainSid)) // @pyparm <o PySID>|DomainSid|None|Domain for the new SID, or None for local machine --- 3585,3589 ---- return PyErr_Format(PyExc_MemoryError, "CreateWellKnownSid: Unable to allocate %d bytes", bufsize); ! if (!PyArg_ParseTuple(args, "k|O:CreateWellKnownSid", &sidtype, // @pyparm int|WellKnownSidType||One of the Win*Sid constants &obDomainSid)) // @pyparm <o PySID>|DomainSid|None|Domain for the new SID, or None for local machine *************** *** 3583,3587 **** // @pyparm (int,int,int,int)|GenericMapping||A tuple of 4 bitmasks (GenericRead, GenericWrite, GenericExecute, GenericAll) // containing the standard and specific rights that correspond to the generic rights. ! if (!PyArg_ParseTuple(args,"k(kkkk)", &mask, &mapping.GenericRead, &mapping.GenericWrite, &mapping.GenericExecute, &mapping.GenericAll)) return NULL; --- 3611,3615 ---- // @pyparm (int,int,int,int)|GenericMapping||A tuple of 4 bitmasks (GenericRead, GenericWrite, GenericExecute, GenericAll) // containing the standard and specific rights that correspond to the generic rights. ! if (!PyArg_ParseTuple(args,"k(kkkk):MapGenericMask", &mask, &mapping.GenericRead, &mapping.GenericWrite, &mapping.GenericExecute, &mapping.GenericAll)) return NULL; |