Quantcast
Channel: General Windows Desktop Development Issues forum
Viewing all 6180 articles
Browse latest View live

ODBC Error Not enough space for parser stacks while trying to insert/Update/Delete data to informix

$
0
0

could not execute update query[SQL: delete from table_Name where ColumnName in (? , ?)] could not execute update query[SQL: delete from Table_Name where Column_Namein (? , ?)] ERROR [HY000] [Informix][Informix ODBC Driver]General error.Not enough space for parser stacks.

The above error is getting in all crud operations apart from select statement. Can anyone tell me why this error is occuring. What is the root cause and what is the solution for this?

This error is occuring intermittent but not frequently

thanks in advance.



DNS Resolution Failure only on Windows Server 2012 R2

$
0
0
I've encountered a very bizarre bug that I've narrowed down to a specific scenario but due to potential impact I need to try and find out why. 

Application A v 1.0 built for `.NET 4.7.2` runs fine on `Windows Server 2012 R2`
Application A v 2.0 also built for `.NET 4.7.2` but now using a `.Net Standard 2.0` shared library suddenly causes the tcp stack to fail (specifically all DNS resolution fails, even internal destinations) 

This bug only occurs on `2012 R2`. `2016` works just fine. 
This bug occurs even if only the assembly for the shared library is included, no actual instances declared or references made, not even a using statement, just having the shared library in the dependencies causes this. 

Outside of the application DNS resolution works fine. 
FusionLogs are functionally identical between what gets loaded on my `Windows 10 machine` and what gets loaded on `2012 R2`. Only difference being the encoded folder names for the native images loaded.

Here's a list of all relevant dependencies from the shared library

BouncyCastle.Crypto v 1.8.5:    Org.BouncyCastle.Crypto.Parameters;    
    Org.BouncyCastle.OpenSsl;    
    Org.BouncyCastle.Security;
Common.Logging v 3.4.1:
DnsClient v 1.2.0:
Microsoft.CSharp v 4.7.0:
Mimekit v 2.4.1:
NewtonSoft.Json v 12.0.1:
System v 4.0.0.0:    
    System.Collections.Generic;    
    System.Collections.Concurrent;    
    System.IO;    
    System.IO.Compression.FileSystem;    
    System.Drawing;    System.Numerics;    System.Runtime.Serialization;    System.Net;    System.Net.Http;    System.Net.Http.Headers;
    System.Security.Cryptography;    System.Text;    System.Threading;    System.Threading.Tasks;    System.Xml;

Exception:
17:16:21 [1] [Info] - DNS Query against 'google.com'
Unhandled Exception: System.Net.Sockets.SocketException: No such host is known   
   at System.Net.Dns.GetAddrInfo(String name)   
   at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)   
   at System.Net.Dns.GetHostEntry(String hostNameOrAddress)   at DNSAPITestApp.Tester..ctor() in ...   at DNSAPITestApp.Program.Main(String[] args) in ...

I've searched extensively online however there's just too much white noise of similar DNS issues that still having nothing to do with this specific scenario or why this could be happening (and just as importantly how to confirm any theories).

Any help would be greatly appreciated. I can't post much of the code but if there are any specific areas where a particular dependency is used that anyone would like to see I can add snippets. 

32-bit depth icons become visible/invisible while switching "extended"/”non-extended” multiple displays mode in windows7

$
0
0

32-bit depth Icons become invisible while connecting second display and choosing "Control Panel\Display\Change Display Settings\Multiple displays: extend these displays" setting.

I draw icons in my MFC\C++ Windows7 application using
::DrawIconEx( hDC, x, y, hIcon,W,H,NULL,NULL, DI_NORMAL) API function.
Handle of ICON in memory is passed from outside. The icon is drawn alright while it has less than 32-bit color depth.

Any ideas? Thanks in advance!

VisualStudio -- Designer cannot process unknown 'components'

$
0
0

This seems to be a recurring problem. 

I made the mistake of exiting VisualStudio and shut my machine down. My application was working flawlessly over the last few days. No idea what is going on or how to fix it without completely removing the Form where the problem "occurs" to recreate it from scratch, which I did a few times already, in the past week. Any suggestions is appreciated.

How to register a dll in UWP app

$
0
0

Hi,

    I have a dll file in my UWP project, it's a MediaFoundation Decoder, I need to register it(such as regsvr32 xxx.dll) when my UWP app install or in the first launch. So how to do?

    Thanks!

Window not receiving WM_MOUSEWHEEL or it is not sent to window at all and I don't understand why

Running a background java job in Windows server even when the user is logged off

$
0
0

Hello,

I have an java application which is running in a Windows but as soon as user logs off, the application also is down.

How to run the jar file as a background application and keep it running even after the user is logged out?

Thanks,

Siddarth


SignTool Error: An unexpected internal error has occurred.

$
0
0

Hi .

I am facing issue with signtool . i try to search in this issue releated  but no result . can you help me to resolve . 

Thanks for the support 

SignTool Error: An unexpected internal error has occurred.

Error information: "Error: Store IsDiskFile() failed." (-2147024893/0x80070003)


How can I prioritise IO for my application at the expense of rest of system?

$
0
0

I work on a video streaming application that needs to read media files from disk at a high bitrate.

The trouble is, if Windows (7) is copying a large file or doing anything else that's IO intensive, the video application can sometimes stall while trying to buffer data from the (local) disk.

I have tried setting the IO priority to be "high" by changing process and thread priority and also by seting IO priority on a per file basis but nothing helps (it seems Windows only supports setting IO priority to be "Normal" or "Low"\"Idle").

I've also tried using SetFileBandwidthReservation, but that returns false and GetLastError returns 1, which seems to suggest the feature is not supported by drivers/hardware on my system.

My questions are:

1. On Windows 7, is there any way to give my app IO priority over all other apps in the system?

2. If answer to 1 above is no, does anyone know if Microsoft plan to provide such support in future?

Thanks in advance,

John.

DNS Resolution Failure only on Windows Server 2012 R2

$
0
0
I've encountered a very bizarre bug that I've narrowed down to a specific scenario but due to potential impact I need to try and find out why. 

Application A v 1.0 built for `.NET 4.7.2` runs fine on `Windows Server 2012 R2`
Application A v 2.0 also built for `.NET 4.7.2` but now using a `.Net Standard 2.0` shared library suddenly causes the tcp stack to fail (specifically all DNS resolution fails, even internal destinations) 

This bug only occurs on `2012 R2`. `2016` works just fine. 
This bug occurs even if only the assembly for the shared library is included, no actual instances declared or references made, not even a using statement, just having the shared library in the dependencies causes this. 

Outside of the application DNS resolution works fine. 
FusionLogs are functionally identical between what gets loaded on my `Windows 10 machine` and what gets loaded on `2012 R2`. Only difference being the encoded folder names for the native images loaded.

Here's a list of all relevant dependencies from the shared library
BouncyCastle.Crypto v 1.8.5:    Org.BouncyCastle.Crypto.Parameters;    
    Org.BouncyCastle.OpenSsl;    
    Org.BouncyCastle.Security;
Common.Logging v 3.4.1:
DnsClient v 1.2.0:
Microsoft.CSharp v 4.7.0:
Mimekit v 2.4.1:
NewtonSoft.Json v 12.0.1:
System v 4.0.0.0:    
    System.Collections.Generic;    
    System.Collections.Concurrent;    
    System.IO;    
    System.IO.Compression.FileSystem;    
    System.Drawing;    System.Numerics;    System.Runtime.Serialization;    System.Net;    System.Net.Http;    System.Net.Http.Headers;
    System.Security.Cryptography;    System.Text;    System.Threading;    System.Threading.Tasks;    System.Xml;

Exception:
17:16:21 [1] [Info] - DNS Query against 'google.com'
Unhandled Exception: System.Net.Sockets.SocketException: No such host is known   
   at System.Net.Dns.GetAddrInfo(String name)   
   at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)   
   at System.Net.Dns.GetHostEntry(String hostNameOrAddress)   at DNSAPITestApp.Tester..ctor() in ...   at DNSAPITestApp.Program.Main(String[] args) in ...

I've searched extensively online however there's just too much white noise of similar DNS issues that still having nothing to do with this specific scenario or why this could be happening (and just as importantly how to confirm any theories).

Any help would be greatly appreciated. I can't post much of the code but if there are any specific areas where a particular dependency is used that anyone would like to see I can add snippets. 

Can I have more than 2 monitors attached to my PC ?

$
0
0

I have a scenario, i need the output of 4 different programs to different monitors attached to same system. I know I can attach 2 monitors easily, but not sure how can I attach 4 monitors. I understand i need some HDMI device to increase monitors but can windows 10 support multiple monitors. 

Is Windows Home version can take this, or I need to upgrade to Pro or some other licensing ?


MouseWheel not working after MIgration to Windows 10 64bit from Win732 bit

$
0
0
​The application registers for the WH_MOUSE messages using SetWindowshookEX() API and triggers appropriate action for MouseWheel message .IT was on originally developed on 32 bit Windows7 OS.Currently i have migrated the ATL/MFC Application to Windows 10 and suddenly the MOusewheel action is not working. When i debugged and analyzed i could see that the mousehookproc() is not getting Mousewheel event (WM_MOUSEWHEEL ,value is 522) where as it receives other mouse messages,

​Please help me.There is absolutely no change in the Application code.

Madhusudan

Transfer Windows Passwords ?

$
0
0

Hi Folks,

I am trying to port/transfer all the user account information (including passwords) from one instance of Windows to another.

Is this possible?

If yes, what tools/process we can use to achieve this?

NOTE: There is no credential manager involved anywhere and we are not using it so please refrain answers making use of it.

unableto compile vertex shader using fxc vs2017

$
0
0

this is my vertex shader,

structWorldViewProjection
{
	matrix WVP;
};

ConstantBuffer<WorldViewProjection> WorldViewProjectionCB : register(b0);structPSInput
{
   float4 
   float3 uvw : TEXCOORD;
};PSInput main(float4 {
   PSInput result;
   result.position = position;
   result.uvw = uvw;return result;
}

when i try to compile it with in visual studiuo 2017 i get this error…

Severity Code Description Project File Line Suppression State

Error X3000 unrecognized identifier 'ConstantBuffer'  ********vertexshader_volume.hlsl 6  

i am correctly setting

shader type to /vs

shader model 5_0

but when i try to compile it with D3DcompileFromFile it works...

why i m not able to get a precompiled cso object....


UWP - Add file "" to your source content group map

$
0
0

This is a rather annoying issue that shouldn't be given thought here where I set required and automatic sourcing in a content map because my app relies on html5 content that has to be loaded (which is being imported from another development tool). The problem is that I'm getting a message in the failure output that says "Add file "" to your source content group map either explicitly or through a wildcard," and if I do that I obviously get the "directory not empty" instead. Either way, the assets I require (which are in a subfolder named www) are not being packaged regardless of the method that I'm trying to use (and I've tried several of 'em already).

Any ideas? I have both the required and the automatic sets defined so I don't know what's up. (Heck, I even followed along with the how-to in the docs and molded it around my Visual Studio project with absolutely nothing to show for it.)


unable to launch Windows 10 Settings when not in the Windows Desktop Environment

$
0
0

Hello,

To give some background into my problem, I have a computer which launches an application at startup instead of the Windows Desktop environment. This is done by altering the value of the registry location at: Software\Microsoft\Windows NT\CurrentVersion\winlogon from explorer.exe to the name of my application. This is done to lock the user out of the desktop environment.

When I enter the command, "start ms-settings:" to bring up the settings application, I instead receive the error: "ms-settings: File system error (-2147219200)". If I revert my registry key to explorer.exe and restart back into the desktop environment the command works as expected. My only thought is that a service isn't be correctly started when I bypass the Windows Desktop environment. I've searched online and haven't found anything similar to my situation.

Does anyone know what requirements the setting app has in order to launch?

The end goal of what I'm trying to accomplish is to bring up the Windows Update dialog (which appears to be part of the settings app) for users that want to update Windows over the internet. If there are other options to perform a feature update over the internet without opening the settings app that would be fine too. Sorry if this sort of turns my 1 question into 2. 

vbscript.dll class_terminate bug since KB4524570 (November 12, 2019) Windows 10 1903

$
0
0

Hi,


there seems to be a bug in vbscript.dll since cumulative update KB4524570. When I create a instance of a class inside a class member function and assign it to a local variable the instance is not directly destroyed when this member function is left as it was before this update. See the following example code:


Option Explicit

Class CTest

    Sub Class_Initialize

        WScript.Echo Timer & ": CTest::Class_Initialize()"

    End Sub


    Sub Class_Terminate

        WScript.Echo Timer & ": CTest::Class_Terminate()"

    End Sub

End Class


Class CFoo

    Sub Work

        WScript.Echo Timer & ": CFoo::Work() started"

        DoWork

        WSCript.Sleep 3000

        WScript.Echo Timer & ": CFoo::Work() done"

    End Sub


    Sub DoWork

        WScript.Echo Timer & ": CFoo::DoWork() started"

        Dim obj

        Set obj= New CTest

        WScript.Echo Timer & ": CFoo::DoWork() done, CTest::Class_Terminate() should be called now without delay"

    End Sub

End Class


Dim objFoo

Set objFoo= New CFoo

objFoo.Work

WScript.Echo Timer & ": objFoo.Work() done"


When executing using cscript.exe the following output is generated:


80547,52: CFoo::Work() started

80547,52: CFoo::DoWork() started

80547,52: CTest::Class_Initialize()

80547,52: CFoo::DoWork() done, CTest::Class_Terminate() should be called now without delay

80550,52: CFoo::Work() done

80550,52: CTest::Class_Terminate()

80550,53: objFoo.Work() done

When executing with a prior version of vbscript.dll the output looks correct like this:


79971,76: CFoo::Work() started
79971,76: CFoo::DoWork() started
79971,76: CTest::Class_Initialize()
79971,76: CFoo::DoWork() done, CTest::Class_Terminate() should be called now without delay
79971,76: CTest::Class_Terminate()
79974,76: CFoo::Work() done
79974,76: objFoo.Work() done

I think this will lead to problems in any kind of code that count on the fact that objects referenced by local variables are destroyed when the scope is left.


The same bug is there on Windows 7 since KB4524535 (November 12, 2019 (Monthly Rollup)).


Is there any reason for this change in this behavior? I hope there will be a bugfix for this soon...


Regards,

Steffen.


Set mouse pointer problem with multipe screens

$
0
0

We use Window Server 2012 R2 Version 6.3 (Build 9600). Application is running on this server. To access our application we use Web Access for remote desktop from a normal window PC.

In our application we set the mouse pointer over a command via "Cursor.Position". It works well when the local pc have only one screen. It works also well when the local pc have two screens in the configuration [1|2]. If the configuration of the screens on the local pc is [2|1] it set the mouse pointer to the right border of the screen.

It works also well in each screen configuration when we run our applicationc direct in Win7, Win8 or Win10.

We have not found any way to detect the error case and no way to solve it.

I have prepared a small test program. With this program I can reproduce the problem.

Any idea how we can solve this problem?

Best regards.

From service that run in session 0, create active session as different user and run application

$
0
0

Hello All,

I want that my windows service from session 0 will create active session and run python application as different user. 

At first I started to developed part related with creating process.

I use modules win32*, python 3.

Possible solutions:

A) Use LogonUser() + CreateProcessAsUser();

B) Use CreateProcessWithLogonW();

Solution A (LogonUser() + CreateProcessAsUser()):

import os
import msvcrt
import win32security
import win32con
import win32pipe
import win32process
import win32api
import win32net
import win32file
import win32event
import win32profile
import win32service


GENERIC_ACCESS = win32con.GENERIC_READ | win32con.GENERIC_WRITE | win32con.GENERIC_EXECUTE | win32con.GENERIC_ALL

WINSTA_ALL = (win32con.WINSTA_ACCESSCLIPBOARD  | win32con.WINSTA_ACCESSGLOBALATOMS | \
win32con.WINSTA_CREATEDESKTOP    | win32con.WINSTA_ENUMDESKTOPS      | \
win32con.WINSTA_ENUMERATE        | win32con.WINSTA_EXITWINDOWS       | \
win32con.WINSTA_READATTRIBUTES   | win32con.WINSTA_READSCREEN        | \
win32con.WINSTA_WRITEATTRIBUTES  | win32con.DELETE                   | \
win32con.READ_CONTROL            | win32con.WRITE_DAC                | \
win32con.WRITE_OWNER)

DESKTOP_ALL = (win32con.DESKTOP_CREATEMENU      | win32con.DESKTOP_CREATEWINDOW  | \
win32con.DESKTOP_ENUMERATE       | win32con.DESKTOP_HOOKCONTROL   | \
win32con.DESKTOP_JOURNALPLAYBACK | win32con.DESKTOP_JOURNALRECORD | \
win32con.DESKTOP_READOBJECTS     | win32con.DESKTOP_SWITCHDESKTOP | \
win32con.DESKTOP_WRITEOBJECTS    | win32con.DELETE                | \
win32con.READ_CONTROL            | win32con.WRITE_DAC             | \
win32con.WRITE_OWNER)


def runAsDomainUser(domainName, userName, password, cmdLine, maxWait):
    # maxWait = Maximum execution time in ms
    policy_handle = win32security.LsaOpenPolicy(None, win32security.POLICY_ALL_ACCESS)
    userGroupSid = win32security.LookupAccountName(domainName, userName)[0]

    # Login as domain user and create new session
    userToken = win32security.LogonUser(userName, domainName, password,
                                        win32con.LOGON32_LOGON_INTERACTIVE,
                                        win32con.LOGON32_PROVIDER_DEFAULT)
    rc = win32api.GetLastError()
    if userToken is None or (rc != 0):
        return -1, "", "LogonUser failed with RC=%d!" % rc
    profileDir = win32profile.GetUserProfileDirectory(userToken)
    tokenUser = win32security.GetTokenInformation(userToken, win32security.TokenUser)

    # Set access rights to window station
    hWinSta = win32service.OpenWindowStation("winsta0", False, win32con.READ_CONTROL | win32con.WRITE_DAC )
    # Get security descriptor by winsta0-handle
    secDescWinSta = win32security.GetUserObjectSecurity(hWinSta, win32security.OWNER_SECURITY_INFORMATION
                                                                 | win32security.DACL_SECURITY_INFORMATION
                                                                 | win32con.GROUP_SECURITY_INFORMATION)
    # Get DACL from security descriptor
    daclWinSta = secDescWinSta.GetSecurityDescriptorDacl()
    if daclWinSta is None:
        # Create DACL if not exisiting
        daclWinSta = win32security.ACL()
    # Add ACEs to DACL for specific user group
    daclWinSta.AddAccessAllowedAce(win32security.ACL_REVISION_DS, GENERIC_ACCESS, userGroupSid)
    daclWinSta.AddAccessAllowedAce(win32security.ACL_REVISION_DS, WINSTA_ALL, userGroupSid)
    # Set modified DACL for winsta0
    win32security.SetSecurityInfo(hWinSta, win32security.SE_WINDOW_OBJECT, win32security.DACL_SECURITY_INFORMATION,
                                  None, None, daclWinSta, None)

    # Set access rights to desktop
    hDesktop = win32service.OpenDesktop("default", 0, False, win32con.READ_CONTROL
                                                             | win32con.WRITE_DAC
                                                             | win32con.DESKTOP_WRITEOBJECTS
                                                             | win32con.DESKTOP_READOBJECTS)
    # Get security descriptor by desktop-handle
    secDescDesktop = win32security.GetUserObjectSecurity(hDesktop, win32security.OWNER_SECURITY_INFORMATION
                                                                   | win32security.DACL_SECURITY_INFORMATION
                                                                   | win32con.GROUP_SECURITY_INFORMATION )
    # Get DACL from security descriptor
    daclDesktop = secDescDesktop.GetSecurityDescriptorDacl()
    if daclDesktop is None:
        #create DACL if not exisiting
        daclDesktop = win32security.ACL()
    # Add ACEs to DACL for specific user group
    daclDesktop.AddAccessAllowedAce(win32security.ACL_REVISION_DS, GENERIC_ACCESS, userGroupSid)
    daclDesktop.AddAccessAllowedAce(win32security.ACL_REVISION_DS, DESKTOP_ALL, userGroupSid)
    # Set modified DACL for desktop
    win32security.SetSecurityInfo(hDesktop, win32security.SE_WINDOW_OBJECT, win32security.DACL_SECURITY_INFORMATION,
                                  None, None, daclDesktop, None)

    # Setup stdin, stdOut and stderr
    secAttrs = win32security.SECURITY_ATTRIBUTES()
    secAttrs.bInheritHandle = 1
    stdOutRd, stdOutWr = win32pipe.CreatePipe(secAttrs, 0)
    stdErrRd, stdErrWr = win32pipe.CreatePipe(secAttrs, 0)

    ppid = win32api.GetCurrentProcess()
    tmp = win32api.DuplicateHandle(ppid, stdOutRd, ppid, 0, 0, win32con.DUPLICATE_SAME_ACCESS)
    win32file.CloseHandle(stdOutRd)
    stdOutRd = tmp

    environment = win32profile.CreateEnvironmentBlock(userToken, False)

    startupInfo = win32process.STARTUPINFO()
    startupInfo.dwFlags = win32con.STARTF_USESTDHANDLES
    startupInfo.hStdOutput = stdOutWr
    startupInfo.hStdError = stdErrWr

    hPrc = win32process.CreateProcessAsUser(
                            userToken,
                            None,               # appName
                            cmdLine,            # commandLine
                            None,               # processAttributes
                            None,               # threadAttributes
                            1,                  # bInheritHandles
                            win32process.CREATE_NEW_CONSOLE, # dwCreationFlags
                            environment,        # newEnvironment
                            profileDir,         # currentDirectory
                            startupInfo)[0]

    win32file.CloseHandle(stdErrWr)
    win32file.CloseHandle(stdOutWr)
    win32security.RevertToSelf()

    # Wait for process to complete
    stdOutBuf = os.fdopen(msvcrt.open_osfhandle(stdOutRd, 0), "rb")
    stdErrBuf = os.fdopen(msvcrt.open_osfhandle(stdErrRd, 0), "rb")
    win32event.WaitForSingleObject(hPrc, maxWait)
    stdOut = stdOutBuf.read()
    stdErr = stdErrBuf.read()
    rc = win32process.GetExitCodeProcess(hPrc)
    return rc, str(stdOut, "utf-8"), str(stdErr, "utf-8")


if __name__ == "__main__":
    cmdLine = "C:/Windows/System32/cmd.exe"
    domainName = input("Domain: ")
    userName = input("User: ")
    password = input("Password: ")
    print(runAsDomainUser(domainName, userName, password, cmdLine, 60000))

But I have error/problem with privileges:

Traceback (most recent call last):
  File "", line 137, in <module>
    print(runAsDomainUser(domainName, userName, password, cmdLine, 60000))
  File "", line 37, in runAsDomainUser
    userGroupSid = win32security.LookupAccountName(domainName, userName)[0]
pywintypes.error: (1722, 'LookupAccountName', 'The RPC server is unavailable.')

What privileges need this process? 

How add them? 

Solution B (CreateProcessLogonW()):

from ctypes import *
from ctypes.wintypes import *
import win32ts

INVALID_HANDLE_VALUE = -1
CREATE_UNICODE_ENVIRONMENT = 0x00000400

CData = Array.__base__
LPBYTE = POINTER(BYTE)


class PROCESS_INFORMATION(Structure):
    '''http://msdn.microsoft.com/en-us/library/ms684873'''
    _fields_ = [
        ('hProcess', HANDLE),
        ('hThread', HANDLE),
        ('dwProcessId', DWORD),
        ('dwThreadId', DWORD),
    ]


LPPROCESS_INFORMATION = POINTER(PROCESS_INFORMATION)


class STARTUPINFOW(Structure):
    'http://msdn.microsoft.com/en-us/library/ms686331'
    _fields_ = [
        ('cb', DWORD),
        ('lpReserved', LPWSTR),
        ('lpDesktop', LPWSTR),
        ('lpTitle', LPWSTR),
        ('dwX', DWORD),
        ('dwY', DWORD),
        ('dwXSize', DWORD),
        ('dwYSize', DWORD),
        ('dwXCountChars', DWORD),
        ('dwYCountChars', DWORD),
        ('dwFillAttribute', DWORD),
        ('dwFlags', DWORD),
        ('wShowWindow', WORD),
        ('cbReserved2', WORD),
        ('lpReserved2', LPBYTE),
        ('hStdInput', HANDLE),
        ('hStdOutput', HANDLE),
        ('hStdError', HANDLE),
    ]


LPSTARTUPINFOW = POINTER(STARTUPINFOW)

# http://msdn.microsoft.com/en-us/library/ms682431
windll.advapi32.CreateProcessWithLogonW.restype = BOOL
windll.advapi32.CreateProcessWithLogonW.argtypes = [
    LPCWSTR,  # lpUsername
    LPCWSTR,  # lpDomain
    LPCWSTR,  # lpPassword
    DWORD,  # dwLogonFlags
    LPCWSTR,  # lpApplicationName
    LPWSTR,  # lpCommandLine (inout)
    DWORD,  # dwCreationFlags
    LPCWSTR,  # lpEnvironment  (force Unicode)
    LPCWSTR,  # lpCurrentDirectory
    LPSTARTUPINFOW,  # lpStartupInfo
    LPPROCESS_INFORMATION,  # lpProcessInfo (out)
]


def CreateProcessWithLogonW(
        lpUsername=None,
        lpDomain=None,
        lpPassword=None,
        dwLogonFlags=0,
        lpApplicationName=None,
        lpCommandLine=None,
        dwCreationFlags=0,
        lpEnvironment=None,
        lpCurrentDirectory=None,
        startupInfo=None
):
    if (lpCommandLine is not None and
            not isinstance(lpCommandLine, CData)
    ):
        lpCommandLine = create_unicode_buffer(lpCommandLine)
    dwCreationFlags |= CREATE_UNICODE_ENVIRONMENT
    if startupInfo is None:
        startupInfo = STARTUPINFOW(sizeof(STARTUPINFOW))
    processInformation = PROCESS_INFORMATION(
        INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE)
    success = windll.advapi32.CreateProcessWithLogonW(
        lpUsername, lpDomain, lpPassword, dwLogonFlags, lpApplicationName,
        lpCommandLine, dwCreationFlags, lpEnvironment, lpCurrentDirectory,
        byref(startupInfo), byref(processInformation))
    if not success:
        raise WinError()
    return processInformation


if __name__ == '__main__':
    cmdLine = "C:\\Windows\\notepad.exe"
    domainName = input("Domain: ")
    userName = input("User: ")
    password = input("Password: ")
    pi = CreateProcessWithLogonW(
        userName, domainName, password, 1, None,
        cmdLine)
    print(pi.dwProcessId)

Not so good solution, because this process start in the same session. 

I would really appreciate any help.

  

Activating Developer Mode (Error Code 0x800f0950)

$
0
0
I have done everything and followed all of the support options to activating developer mode.  I was working on it all day yesterday, and have still yet to figure it out.  I have had the error message "Developer mode is turned on.  However remote deployment and Windows Device Portal couldn't be found in Windows Update, so they're not available.  Error code 0x800f0950." ever since I started.  I figure it is something that it is something I am missing, something that is not commonly found online.  This is a new build pc.  Windows update 1909.  I also noticed, when I logged in this morning, my windows is up to date, but it has a red exclamation mark, and is not finding any new updates.
Viewing all 6180 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>