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

Cannot exclude C1.WPF.4.dll. from dependencies and installer project.

$
0
0

We have Vb.net WPF project which is using  C1.WPF.4.dll assembly.
When we create an installer project,  C1.WPF.4.dll dependency gets added to project and installer.

1) We tried to exclude  C1.WPF.4.dll from main project. 
2) Tried to remove refrence from dependency and VDPROJ file.
3) Even if we delete the C1.WPF.4.dll from installer output project on Rebuild solution, it doesnt work.

4) Exclude doesnt work with this dll.

As shown in below image, when we rebuild project the dll appears in installer project.

how can we exclude or avoid generating C1.WPF.4.dll in installer/ setup project ?

thanks in advance


winapi - resizing a list view using mouse

$
0
0
I have a dialog box window which contains a two list view control (SysListView32). I would like to allow resizing a list view vertically by dragging a list view border. I haven't found any solution. Do you have any ideas how to implement such functionality ?

BluetoothLEDevice PairAsync intermittantly fails

$
0
0

Working on an application that connects to a bluetooth low energy device that requires an initial pairing before the device characteristics and services can be subscribed or read etc.

Sometime the pairing of the device fails, unfortunately the result from the pairing call does not give any useful information as to why the pairing fails.

Here is the code that performs the pairing process with the device.

/// <inheritdoc/> public async Task PairAsync() { await OperationExceptionHandler.ExecuteOperation(nameof(NativeBleDevice), async () => { if (!_bluetoothLeDevice.DeviceInformation.Pairing.CanPair) { throw new BleDeviceException($"[{nameof(NativeBleDevice)}] Id: {_bluetoothLeDevice.BluetoothDeviceId} CanPair: [{_bluetoothLeDevice.DeviceInformation.Pairing.CanPair}]"); } try { if (!_bluetoothLeDevice.DeviceInformation.Pairing.IsPaired) { _bluetoothLeDevice.DeviceInformation.Pairing.Custom.PairingRequested += CustomOnPairingRequested; var result = await _bluetoothLeDevice.DeviceInformation.Pairing.Custom.PairAsync( DevicePairingKinds.ConfirmOnly, DevicePairingProtectionLevel.Encryption); if (result.Status != DevicePairingResultStatus.Paired) { throw new EkoDeviceNotPairedException($"Pairing failed for Device Id: [{_bluetoothLeDevice.DeviceId}] Status: [{result.Status}] ProtectionLevelUsed: [{result.ProtectionLevelUsed}]"); } } } finally { _bluetoothLeDevice.DeviceInformation.Pairing.Custom.PairingRequested -= CustomOnPairingRequested; } }); }

        private void CustomOnPairingRequested(DeviceInformationCustomPairing sender, DevicePairingRequestedEventArgs args)
        {
            args.Accept();
        }

EkoDeviceNotPairedException: Pairing failed for Device Id: [BluetoothLE#BluetoothLE50:e0:85:82:1b:ca-88:d2:11:ba:a1:cb] Status: [Failed] ProtectionLevelUsed: [None]

The result object does not indicate the reason for the pairing failure. This intermittent failure occurs on a few particular PC's but not on all. I am looking for some advise on how to debug or triage the issue. It was only discovered out in the field.

Is there any tracing that could be enabled to help diagnose the problem?

Thanks

Feature Update availability in Windows Update Agent API

$
0
0

Greetings everyone,

do anyone know what are the rules under which are Feature Updates (Windows OS upgrades like 1803, 1809, etc.) available through Windows Update Agent API?

Here's a snippet of code I use to scan WUA API for Windows Update data:

UpdateSessionClass session = new UpdateSessionClass { UserLocale = 1033 };
IUpdateSearcher searcher = session.CreateUpdateSearcher();
searcher.Online = true;
searcher.ServiceID = "7971f918-a847-4430-9279-4a52d1efe18d";
searcher.ServerSelection = ServerSelection.ssOthers;
...
ISearchResult searchResult = searcher.Search("IsInstalled=0 or IsInstalled=1");
...

Problem is that the searchResult collection does not contain the data for Feature Update even though the Windows Update UI clearly offers the Feature Update for download and installation.

Can anyone tell what causes the differences between WUA API and WU UI? Eventually, how to make the WUA API provide me data for Feature Update(s)?

Many many thanks!
Tomas

Organization of Windows folders

$
0
0

Hello.

I'm developing software on Windows platform since 20 years.

I need some kind of documentation that explains how to use all folder that Windows offers.
Same aplies to Windows registry.

When my application needs to write files on disk wich is the best destination folder, depending on the type of file (common user, user specific, shared) and also based on the software type (Desktop app, service, console, etc.)

I well know the existance of folders like:
    "Users\<Name>", "Users\Public","AppData\Local", "AppData\Roaming", "ProgramData", etc.
but I've guest how to use these folder because I never found a documentation that explains the Microsoft Idea.

Just to better explain my self I'll write some examples:

-I still don't uderstand way AppData and ProgramData are hidden.
-Wich is the security protection design for the software, data folders.
-if my software downloads an installer, wich is the best location where to write and start it in the way i can correctly handle security, antivirus, access rights etc.

I never found an official guide line that explains wath is the Microsoft idea of "data, software and settings" organizzation.

Thanks in advance for you help.

Ricardo

code signing certificate for msi installer

$
0
0

Hi,

I want to test the waters on an excel add-in I created and I need a certificate for the msi installer so the user doesn't get the "Harmful to your PC" message.  I see that I can get a code signing cert for under $100 but I've got the following questions:

1. Do I build my msi and include a file that I purchased containing this  certificate and  also do I need to include this executable and command in the msi :  "certmgr.exe -c YourCertificate -s Root -add"

2. If I am simply emailing my msi files to users and having them install from the email, is that a different cert than a one that would come from a website

3. If I only need to build one installer and use it for a year or so is there an even cheaper option for this one time only certificate I need?

4. I am very new to all this so is there anything else I need to know about distributing msi installer

thanks any comments are appreciated.

Mike

Do I need to use "WSAStartup" for the Win32 API function "getaddrinfo"?

$
0
0

Do I need to use "WSAStartup" for the Win32 API function "getaddrinfo"?
I started the program without "WSAStartup" and the program works.

If it should, what is the relationship between "WSAStartup" and "getaddrinfo"? I don't see this relationship.


Malformed digital signature (MS13-098)

$
0
0

Hi,

I hope you can help with an error that I have come across while validating some of the binaries (both DLLs and EXEs) that msbuild generates which I sign and validate using signtool.

After signing and running the signtool validate command, which fails I noticed that the following error is displayed in the file's certificate properties. This happens both using self signed and valid certificates on the exact same binary.

The digital signature of the object is malformed. For technical detail, see security bulletin MS13-098

After some digging into the original report I haven't been able to figure out the reason for this.

This happens with some binaries built with on Windows 10 Enterprise Version10.0.16299 Build 16299, using VS 2015 Version 14.0.25431.01 Update 3, both using Windows 10 and 8.1 SDKs. Inerestingly the exact same code builds and is signed just fine with the same settings on Windows 10 PRO and Windows 7 machines.

Looking into the results of calling WinVerifyTrust on any of these binaries I see that both:

CRYPT_PROVIDER_DATA::pasSigners[0].dwError
CRYPT_PROVIDER_DATA::pasSigners[0].padwTrustStepErrors[TRUSTERROR_STEP_SIP]

are set to TRUST_E_MALFORMED_SIGNATURE.

Also, the following reserved undocumented fields are set to 1, while they are always 0 when the signature is valid:

CRYPT_PROVIDER_DATA::pPDSip.psSipSubjectInfo.dwReserved1
CRYPT_PROVIDER_DATA::pPDSip.psSipSubjectInfo.dwReserved2

Timestamps as well as the whole certificate chain seem perfectly valid as compared to other signed binaries which do not generate this error.

This is the error information I get using the Event Viewer (Applications and Services/Microsoft/Windows/CAPI2):

Log Name:      Microsoft-Windows-CAPI2/Operational
Source:        Microsoft-Windows-CAPI2
Date:          4/17/2018 1:31:28 PM
Event ID:      81
Task Category: Verify Trust
Level:         Error
Keywords:      Trust Verification
User:          <redacted>
Computer:      <redacted>
Description:
For more details for this event, please refer to the "Details" section
Event Xml:<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event"><System><Provider Name="Microsoft-Windows-CAPI2" Guid="{5bbca4a8-b209-48dc-a8c7-b23d3e5216fb}" /><EventID>81</EventID><Version>0</Version><Level>2</Level><Task>80</Task><Opcode>2</Opcode><Keywords>0x4000000000000040</Keywords><TimeCreated SystemTime="2018-04-17T01:31:28.420919700Z" /><EventRecordID>37025</EventRecordID><Correlation /><Execution ProcessID="8824" ThreadID="20592" /><Channel>Microsoft-Windows-CAPI2/Operational</Channel><Computer><redacted></Computer><Security UserID="S-1-5-21-1816455331-1047007460-3249654935-1130" /></System><UserData><WinVerifyTrust><ActionID>{189A3842-3041-11D1-85E1-00C04FC295EE}</ActionID><UIChoice value="2">WTD_UI_NONE</UIChoice><RevocationCheck value="0" /><StateAction value="1">WTD_STATEACTION_VERIFY</StateAction><Flags value="80000000" CPD_USE_NT5_CHAIN_FLAG="true" /><FileInfo filePath="<redacted>.dll" hasFileHandle="true" /><DigestInfo digestAlgorithm="SHA256" digest="2ABD0FFDB13B53F7D5DD133698D46AB52CE9327BBA3592838601C281536BD003" /><RegPolicySetting value="23C00" WTPF_OFFLINEOK_IND="true" WTPF_OFFLINEOK_COM="true" WTPF_OFFLINEOKNBU_IND="true" WTPF_OFFLINEOKNBU_COM="true" WTPF_IGNOREREVOCATIONONTS="true" /><SignatureSettingsFlags value="20000001" WSS_VERIFY_SPECIFIC="true" WSS_OUT_FILE_SUPPORTS_SEAL="true" /><SignerInfo><DigestAlgorithm oid="2.16.840.1.101.3.4.2.1" hashName="SHA256" /></SignerInfo><CertificateChain chainRef="{272F111F-9819-4DAB-BB22-14DEB44CD6F4}" /><TimestampInfo format="RFC 3161"><DigestAlgorithm oid="2.16.840.1.101.3.4.2.1" hashName="SHA256" /><SignTime>2018-04-16T23:14:31Z</SignTime></TimestampInfo><TimestampChain chainRef="{5EFEB91F-6FBD-4A0E-B4E3-65F2B92F8C5E}" /><StepError stepID="3" stepName="TRUSTERROR_STEP_SIP"><Result value="80096011">The digital signature of the object is malformed. For technical detail, see security bulletin MS13-098.</Result></StepError><StepError stepID="32" stepName="TRUSTERROR_STEP_FINAL_OBJPROV"><Result value="800B0100">No signature was present in the subject.</Result></StepError><StepError stepID="33" stepName="TRUSTERROR_STEP_FINAL_SIGPROV"><Result value="800B0100">No signature was present in the subject.</Result></StepError><EventAuxInfo ProcessName="explorer.exe" /><CorrelationAuxInfo TaskId="{DAD26E38-E52E-415C-B51B-9D94CB3F21A6}" SeqNumber="9" /><Result value="80096011">The digital signature of the object is malformed. For technical detail, see security bulletin MS13-098.</Result></WinVerifyTrust></UserData></Event>

The output of sigcheck just confirms the same error in the "Verified" field.

Thank you.

PS: I have originally posted this on the VisualStudio forums: https://developercommunity.visualstudio.com/content/problem/235599/malformed-digital-signature-ms13-098-1.html

PS2: I am posting this here as per request from this thread: https://social.technet.microsoft.com/Forums/en-US/35a30b94-757a-4d9b-8bdb-8a6df5077249/malformed-digital-signature-ms13098?forum=win10itprosecurity


doskey /listsize and doskey /reinstall not working in Windows 10, version 1903 (and earlier)

$
0
0

'doskey /listsize' has no effect.

'doskey /reinstall' kills the command-line session, instead of reloading doskey.

Either one would work to remove the history entries which contain a password, as when you log on to an application or mount an encrypted volume.  Another person could see the password by hitting 'up arrow.' My batch files do this with 'doskey /listsize=0' followed by 'doskey /listsize=49'.

Failing that, 'doskey /reinstall' should achieve a similar outcome.  

Unfortunately, neither one works.

Thanks for your attention.


How to create a project template overview page as below and how to show it when the project template loads up

$
0
0

Where to add a custom page and open it when the custom project template is loaded within the visual studio. For example below is the project home page when an MVC project template is opened in visual studio, similarly I have a requirement to open such a custom page for my project template.

I know that the below MVC project home page markup, styles, resources and manifest files are located at "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\Extensions\Microsoft\Web Tools\Project\Overview". How does the microsoft predefined templates loaded such home page? what is the starting point? Are they using any tool or library which does it?

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.

Service Control Manager claims my service "hung on starting" before telling it to start?

$
0
0

I have a windows service implemented in C# that works fine unless there's an extra-long startup.  Specifically, after we create a local account on a workgroup computer (running Windows Server 2016), configure it for automatic logon, and restart the computer.

In this scenario, the logon window lingers at the "Please wait for the ProfSvc" for several minutes.  After the box finally comes up, three services dependent on mine fail to start, even though my service eventually does.

Looking at the event viewer log, the SCM thinks my service has hung (about 3:30 after boot), but it hasn't even told it to start yet (about 8:30 after boot)! I know a service has to start in a timely fashion or call SetServiceStatus with an appropriate wait hint, but I never even get the chance.

What's going on here?


Event Viewer timeline:

0:00        Kernel-General12

The operating system started

 

3:32        Service Control Manager             7022

[My Service] hung on starting.

 

3:32        Service Control Manager             7001

The [Foo] service depends on [My Service] which failed to start because of the following error:

After starting, the service hung in a start-pending state.

 

3:32        Service Control Manager             7022

[My Service] hung on starting.

 

3:32        Service Control Manager             7001

The [Bar] service depends on [My Service] which failed to start because of the following error:

After starting, the service hung in a start-pending state.

 

3:32        Service Control Manager             7022

[My Service] hung on starting.

 

3:32        Service Control Manager             7001

The [Eeber] service depends on [My Service] which failed to start because of the following error:

After starting, the service hung in a start-pending state.

 

8:34        [My Service]      0

OnStart() called

 

11:42     [My Service]      0

Service started successfully.

 

11:42     Service Control Manager             7036

[My Service] entered the running state.


Why doesn't file explorer search remember my column settings?

$
0
0

Simple question. 

Why doesn't file explorer search remember my column settings?

It did in windows 7.

So why isn't windows 10 capable and when will it be?


PostMessage Behavior change when Windows theme is changed in Windows 7

$
0
0

We have a dialog based application with only one custom static control on it.

On right click on static control we want to display a popup menu.

So when WM_RBUTTONDOWN msg is received by custom static control class, it does PostMessage(WM_RBUTTONDOWN) to parent dialog.

Below is sample code:

void CCustomStatic::OnRButtonDown(
	UINT nFlags,
	CPoint point
)
{
	CWnd* parentwnd = GetParent();
	if (parentwnd && ::IsWindow(parentwnd->GetSafeHwnd()))
	{	
	    parentwnd->PostMessage(WM_RBUTTONDOWN);

	}
	CStatic::OnRButtonDown(nFlags, point);
}


In parent dialog, on receiving WM_RBUTTONDOWN message, it calls GetMessagePos() to get the position of right click. Below is sample code:

void MyDialog1::OnRButtonDown(UINT nFlags, CPoint point)
{
    DWORD pos = GetMessagePos();  //return 0 in Win7 Aero Theme and Win 10, 
    //Returns correct pos in Win 7 Basic theme

    CPoint pt;
    pt.x = GET_X_LPARAM(pos);
    pt.y = GET_Y_LPARAM(pos);
    ScreenToClient(&pt);
  //Do Menu processing here based on pt

    CDialog::OnRButtonDown(nFlags, point);
}


In Windows Basic theme, GetMessagePos() returns with correct position value.

However, in WIndows Aero Theme, GetMessagePos() returns position (0,0) value.

Due to this Menu is not displayed in Aero Theme of Windows, Menu is displayed in Basic Theme.

Similar issue is observed in Windows 10.

Could you please help to know the difference in behaviour of PosMessage() API between Windows Basic Theme and Aero Theme?

Thank you in advance.

Regards,

Heeba 

winapi - how to get a control RECT structure from the resource file

$
0
0

I create a dialog window with some controls based on the resource file using CreateDialog function. Then I can get a control handle this way:

HWND ctrlHwnd = GetDlgItem(dlgHwnd, IDC_LIST);

and get a control dimensions using functions like GetClientRect etc. Let's assume that using SetWindowPos I change a control dimension. Is there any way to get initial dimensions from the resource file ? I know that I can save an initial RECT data in my program memory but I wonder if there is other way ?



Which one has better performance, data types .NET or alias name data types C#?please Complete reading this post to end

$
0
0

Hi to all first of all i am sorry because my first language is not english I want understand which one has better performance C# data types or .net data types i try to understand by below code i test this code both with x86 and x64 platform.(I emphasize please Complete reading this post to end and If in doubt do not give the wrong answer and please Answer me with a document )

StopWatch SW=newStopWatch();
   SW.Start();for(Int32 i =0; i <99999; i++){for(Int32 j =0; j <999; j++){Int32 a =37;Int32 b =37;Double c =Math.Pow(a, b);String d ="abcde";String e ="abcde";String f = d + e;}

second code

Stopwatch SW =newStopwatch();
            SW.Start();for(int i =0; i <99999; i++){for(int j =0; j <999; j++){int a =37;int b =37;double c =Math.Pow(a, b);string d ="abcde";string e ="abcde";string f = d + e;}}Console.WriteLine(SW.Elapsed.TotalMilliseconds);
            SW.Stop();Console.ReadKey();

in this link Difference Between Data Type in C# and Data Type in .NET[^] "said all data types are converted into .Net Data type"What does this mean?I think if this word is true so converting C# alias data types to .net data types it takes time and i tested this by above codes but i am not sure if anyone sure(not unsure I emphasize) please answer mesomebody answer there is no deference in performance but i think this is not my answer thanks a lot

DASH+PlayReady-protected video playback issues (UWP)

$
0
0

Hi All!

We are in process of development of an application, which should be able to play videos using PlayReady DRM. As a target platform we are using Universal Windows, target version Windows 10, version 1903, (10.0; Build 18362). For playback we are usingMediaPlayerElement in combination with AdaptiveMediaSource.

As it's said here (https://docs.microsoft.com/en-us/windows/uwp/audio-video-camera/adaptive-streaming-with-playready) "HLS (Apple's HTTP Live Streaming) is not supported with PlayReady". So, I believe, DASH is our only option.

We've tried to use profile urn:mpeg:dash:profile:isoff-on-demand:2011 in mpd manifest. According to this page (https://docs.microsoft.com/en-us/windows/uwp/audio-video-camera/dash-profile-support), it should be supported from Windows 10, Version 1809. But using AdaptiveMediaSource to parse it we receive AdaptiveMediaSourceCreationStatus.ManifestParseFailure status. So we switched toprofiles="urn:mpeg:dash:profile:isoff-live:2011" with type="static". Somehow it works for video on demand case.

But then we've got  a problem with live translations. For live we used profiles="urn:mpeg:dash:profile:isoff-live:2011" with type="dynamic". It plays first several seconds and stops without loading the next fragment. Visually it looks like it's waiting next part to load, but it never happens. The same code plays HLS translation fine, but with no protection.

Could you help me to find out which DASH profiles are supported by UWP API at the moment?

And can PlayReady+DASH live translations be played on UWP using some API?


Refrence data types maximum range? Please read to the end after answer

$
0
0
Hi to all first of all i am sorry because my first language is not English.

I have some question please answer me by true false because I'm confused by other post please just answer me by correct and incorrect or short obvious answer.

With the research I did I think I understood about reference types


First :all reference types range is Unknown(Is this Correct)?

Second:one of the reference types subset is String so range it is Unknown but string Length can be including 2,147,483,647 char on 32platform(int32)and can be including 9,223,372,036,854,775,807 char on 64platform(int64)(Is this Correct)?

Third:size of String on 32platform about 2GByte for each variable(Is this Correct)?

Forth:size of String on 64platform can be greater than2GByte for each variable(Is this Correct)?

Fifth:maximum index of array can be including 2,147,483,647on 32platform(int32) and maximum size can be 2GByte for each variable(Is this Correct)?

Sixth:maximum index of array can be including 2,147,483,647 on 64platform(int64) and size can be greater than 2GByte for each variable(Is this Correct)?

Seventh:other reference types maximum range is Unknown because have not any Length like int32 for String(Is this Correct)?

I Say again please try to answer me one by one correct and incorrect or short obvious answer and try answer without link because I searched a lot

thanks all very much با تشکر فراوان(thanks in Persian)

Refrence data types maximum range in c# and .net? Please read to the end after answer

$
0
0
Hi to all first of all i am sorry because my first language is not English.
I'm making videoEducational about c# and 
I do not want I don't want to give the wrong education so isvery important that all my Contents  be exactly correct.

I have some question please answer me by true false because I'm confused by other post please just answer me by correct and incorrect or short obvious answer.

With the research I did I think I understood about reference types


First :all reference types range is Unknown(Is this Correct)?

Second:one of the reference types subset is String so range it is Unknown but string Length can be including 2,147,483,647 char on 32platform(int32)and can be including 9,223,372,036,854,775,807 char on 64platform(int64)(Is this Correct)?

Third:size of String on 32platform about 2GByte for each variable(Is this Correct)?

Forth:size of String on 64platform can be greater than2GByte for each variable(Is this Correct)?

Fifth:maximum index of array can be including 2,147,483,647on 32platform(int32) and maximum size can be 2GByte for each variable(Is this Correct)?

Sixth:maximum index of array can be including 2,147,483,647 on 64platform(int64) and size can be greater than 2GByte for each variable(Is this Correct)?

Seventh:other reference types maximum range is Unknown because have not any Length like int32 for String(Is this Correct)?

I Say again please try to answer me one by one correct and incorrect or short obvious answer and try answer without link because I searched a lot

thanks all very much با تشکر فراوان(thanks in Persian)

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.)

Viewing all 6180 articles
Browse latest View live


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