예제 #1
0
 internal static extern int NetUserAdd([MarshalAs(UnmanagedType.LPWStr)]string servername, UInt32 level, ref SafeNativeMethods.USER_INFO_1 buf, out Int32 parm_err);
예제 #2
0
 internal static extern bool CreateProcessWithLogonW(
     string userName,
     string domain,
     IntPtr password,
     LogonFlags logonFlags,
     [MarshalAs(UnmanagedType.LPTStr)]            
     string appName,
     StringBuilder cmdLine,
     int creationFlags,
     IntPtr environmentBlock,
     [MarshalAs(UnmanagedType.LPTStr)]           
     string lpCurrentDirectory,                  // LPCTSTR            
     STARTUPINFO lpStartupInfo,
     SafeNativeMethods.PROCESS_INFORMATION lpProcessInformation);        
예제 #3
0
 public static extern bool CreateProcess(
     [MarshalAs(UnmanagedType.LPTStr)]
     string lpApplicationName,                   // LPCTSTR
     StringBuilder lpCommandLine,                // LPTSTR - note: CreateProcess might insert a null somewhere in this string
     SECURITY_ATTRIBUTES lpProcessAttributes,    // LPSECURITY_ATTRIBUTES
     SECURITY_ATTRIBUTES lpThreadAttributes,     // LPSECURITY_ATTRIBUTES
     bool bInheritHandles,                        // BOOL
     int dwCreationFlags,                        // DWORD
     IntPtr lpEnvironment,                       // LPVOID
     [MarshalAs(UnmanagedType.LPTStr)]           
     string lpCurrentDirectory,                  // LPCTSTR
     STARTUPINFO lpStartupInfo,                  // LPSTARTUPINFO
     SafeNativeMethods.PROCESS_INFORMATION lpProcessInformation    // LPPROCESS_INFORMATION
 );
예제 #4
0
 public extern static bool CreateProcessAsUser(SafeHandle hToken,
     string lpApplicationName,
     string lpCommandLine,
     SECURITY_ATTRIBUTES lpProcessAttributes,
     SECURITY_ATTRIBUTES lpThreadAttributes,
     bool bInheritHandles,
     int dwCreationFlags,
     HandleRef lpEnvironment,
     string lpCurrentDirectory,
     STARTUPINFO lpStartupInfo,
     SafeNativeMethods.PROCESS_INFORMATION lpProcessInformation
 );
예제 #5
0
파일: WinInet.cs 프로젝트: lexxwork/xNet
        private static bool EqualConnectedState(SafeNativeMethods.InternetConnectionState expected)
        {
            SafeNativeMethods.InternetConnectionState state = 0;
            SafeNativeMethods.InternetGetConnectedState(ref state, 0);

            return (state & expected) != 0;
        }