Quantcast
Channel: Visual C forum
Viewing all 15302 articles
Browse latest View live

Folder notification

$
0
0
I am aware that functions like ReadDirectoryChangesW() and FindFirstChangeNotification() etc can be used for monitoring file / sub-folder additions/deletions inside a folder. I understand that these APIs monitor the contents of the folder only not the parent folder itself. Is there any way I can monitor the deletion of a parent folder as such and not its contents?

smsdn:how to resolve spectre and meltdown variants 2 and 4 using c/c++ high level program

$
0
0

Iam looking for implementing a custom software function in c/c++ that will mitigate spectre variant 2 and 4 ,

Variant 4 is CVE-2017-5754 Rogue Data Access
Variant 2 is (CVE-2017-5715) Branch target injection

I'm not looking for OS updates or patches to resolve variant 2 and 4 

regards
sachin

LOGON32_LOGON_SERVICE for "NT SERVICE\ServiceName"

$
0
0

LOGON32_LOGON_SERVICE can be used to create logon for built-in service accounts Network Service, Local Service, SYSTEM:

LogOnUser("SYSTEM", "NT AUTHORITY", nullptr, LOGON32_LOGON_SERVICE, LOGON32_PROVIDER_WINNT50, &token);

Is it possible to create a logon for "NT SERVICE\ServiceName"? When I try this

LogOnUser("SomeService", "NT SERVICE", nullptr, LOGON32_LOGON_SERVICE, LOGON32_PROVIDER_WINNT50, &token);

I get "The user name or password is incorrect".

Adding combo boxes to a list view. Pure Win32 working example

SHGetKnownFolderPath usage fails in "NT Service\MyService" account

$
0
0

I have a service running in "NTService\MyService" account. I am able to cocreate a COM outofproc server running in the same account. In this COM server Ineed to make a call : ::SHGetKnownFolderPath(FOLDERID_RoamingAppData, KF_FLAG_CREATE, v, &pszPath); using a NULL token is not working so I have tried to get the token fromLogonUser call as :

::LogonUser(L"MyService", L"NT Service", NULL, LOGON32_LOGON_SERVICE, LOGON32_PROVIDER_DEFAULT, &hToken);

But this fails as 

Error 1326 = "The user name or password is incorrect."

Any ideas?

Visual Studio 2010 redistributable superseded by VS 2014 redistributable?

$
0
0

An application I installed requires VS2010 redistributable.  I have downloaded this but cannot install it, the installer gives an error message to the effect that "a more recent version" is on my computer: "A newer version of Microsoft Visual C++ 2010 Redistributable has been detected on the machine.  Please resolve."  But what is installed is actually VS2014, according to the registry: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\X64, Installed REG_DWORD =0x00000001.

  Is there a way to install VS2010 redistributable in this case?  Or will the VS2014 Runtimes do the job that my software package needs?


gas turbine data storage

Triggering automatically downloading a Microsoft Trusted Root Certificate from Windows Update using C++ ?

$
0
0

I have a windows application that talks to a server over HTTPS, but the root certificate is not in the Windows Certificates on a brand new installation of Windows.  If a user has a brand new machine, and somehow manages to get my app installed without opening a web page,  the app will fail to connect.

However,  if they go to our website,  Chrome, or Edge, or whichever browser, automatically downloads and installs the Trusted Root certificate from the Microsoft Trusted Root certificates list.   I know i can fetch the list of trusted certificates using `certutil -generateSSTFromWU roots.sst`  but that a) doesn't actually install the certs,  and b) would require my program running another app.  

Is there a way that I can trigger the same behaviour as chrome or edge from C++?  possibly giving the call the domain I want to look up, and it downloads the root authority ?  ( just in case i switch who is signing the certificate down the road I don't want to have to re-compile the app ? )   If that's not possible,  maybe I can specify the root cert to download from the trusted certificate list ? 

My certificate is signed by Go Daddy Secure Certificate Authority - G2,  which is signed by Go Daddy Root Certificate Authority - G2   for one product,  for another product it's signed by Amazon, which is signed by Starfield. 

http://woshub.com/updating-trusted-root-certificates-in-windows-10/

https://bitsofwater.com/2017/06/27/the-microsoft-root-certificate-program/

https://news.ycombinator.com/item?id=10139967

using CertOpenStore to get the "Microsoft Code Verification Root" certificate from kernel32.dll ?

$
0
0

Hi there,

This is a complex problem so I might not be going about it the right way.   If you have a better solution, let me know.

The problem:

We are using curl to talk to our server over https.  We have a wildcard certificate issued by Go Daddy.  We are populating curl's CURLOPT_SSL_CTX_DATA with the root certs from Windows Certificate Manager.   ( opened with 

HCERTSTORE hSystemStore = CertOpenStore(
CERT_STORE_PROV_SYSTEM_A,
X509_ASN_ENCODING,
NULL,
CERT_SYSTEM_STORE_CURRENT_USER | CERT_STORE_READONLY_FLAG,
"Root");

)

  On a brand new windows 10 machine, the Go Daddy Root cert is not in the Windows Certificate Manager.  Clients who run our program without having gone to a Go Daddy signed website get a certificate error. 

What I've done to try to solve it:

on my server, I've included the whole certificate chain for Go Daddy from https://certs.godaddy.com/repository  I've gotten the Microsoft to GoDaddy Cross Certificate, and the "GoDaddy Certificate Bundles - G2 With Cross to G1, includes Root".  The problem is that the root cert "Go Daddy Class 2 Certification Authority" is Cross Signed by the "Microsoft Code Verification Root" certificate and THAT cert isn't in the Windows Certificate Manager either. see here:  http://knowledgeobelisk.blogspot.ca/2014/05/so-for-those-of-you-who-are-attempting.html

It looks like I might be able to somehow load that cert from kernel32.dll   and I'm wondering how to do it.  Or I'm wondering if I'm even approaching this the right way. 

Observations:

I've noticed that as soon as you open the edge browser, and go to basically almost any website that the Go Daddy Cert ends up in your cert store, but somehow some of our customers don't do that ( They're from other countries. )

What I'm not doing:

  I don't want to include a copy of the cert in my executable, because then if it's revoked  or expires I need to release a new executable. 



Appcore.cpp 196 assertion in Dialog when moving from VC++ 6.0 to VS2017

$
0
0

Debug Assertion Failed!

Program: C:\WINDOWS\SYSTEM32\mfc140d.dll

File:

d:\agent\_work3\s\src\vctools\vc7libs\ship\atlmfc\src\mfc\appcore.cpp

Line: 196

For information on how your program can cause an assertion failure, see the Visual C++ documentation on asserts.

(Press Retry to debug the application)  

I have an app developed in VC++ 6.0 , Windows XP x32 and I want to migrate to VS 2017, Windows 10 x64

I tried registering TBarCode6.ocx using  TBarCode6.exe and regsvr32 - registration successful, but program crashes same way.

'Ares2017.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\mfc140d.dll'
'Ares2017.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\combase.dll'
'Ares2017.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\msvcp60.dll'
Debug Assertion Failed!

Program: C:\WINDOWS\SYSTEM32\mfc140d.dll
File: d:\agent\_work\3\s\src\vctools\vc7libs\ship\atlmfc\src\mfc\appcore.cpp
Line: 196

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.

(Press Retry to debug the application)
'Ares2017.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\WinTypes.dll'
'Ares2017.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\WinTypes.dll'

Can Remote Desktop Gateway (RDG) Pluggable Authentication and Authorization (PAA) be used with Windows 2016 Server?

Weird math problem with VS2015

$
0
0

Hello , So i will just get to it .

I was trying to do this 

DWORD Value1 =7cb1d74f ;

Value1 = Value1  *-1 ;

the answer should be 834e28b0 , But in debugger its showing result as 834e28b1 .

Is there something im not getting ?  

I tried using singed int , no change .

Need to format BlueRay disc in UDF2.5 format

$
0
0

Hi,

We need to format BlueRay disc to UDF2.5 format.

Is It possible using IMapi? any reference material is highly appreciable.

Get File information very fastly..

$
0
0

Hi

I have many files in a directory over a 5TB HDD. Say it is 10 million...

I need to get the file information as fast as possible. It takes around many minutes to find the required files by searching the file modification date using conventional win32 APIs.

Any good idea to fetch it is highly appreciable.

Enum to String without need assigning one by one

$
0
0

Hi guys

I have a long list of enum, which may keeps on expanding from time to time.

So, how to print out the enum stringification? Without assigning one by one. It's a few hundreds list of enum. :(

enum

{ // very long list, which may expand

STEP1,

STEP2,

DO_THIS,

DO_THAT,

DO_THAT_AND_THIS,

WAIT_YOU,

MAX_STEP,

};

printout("Last Step=%d",enumStep);


ImmGetConversionList always return 0 on win10 + vs2017

$
0
0

I have a program build with vs2003 for winXP, then I want to upgrade it to vs2017 and run on win10
when I debug result value on ImmGetConversionList, it always return 0

hIMC = ImmGetContext(m_hWnd);

hKL = GetKeyboardLayout(0);

sprintf(szKanji,"%s", kanji);

dwSize = ImmGetConversionList(hKL, hIMC, szKanji, NULL, 0, GCL_REVERSECONVERSION);

so, function ImmGetConversionList still work on win10 or vs2017, or I wrong somewhere @@


Error occur when delete allocated memory

$
0
0

I made a function which change characters in the specific position.

However, an error occur when delete allocated memory.

Can anybody fix this?

#include "stdafx.h"
#include <algorithm>
#include <iostream>
#include <string>
using namespace std;

void ChangeCharInString(char* orgstring, int startposition, int endposition);

int main(int argc, char* argv[])
{
	string s = "4263471904271655";
	char* c_str = (char *)s.c_str();

	ChangeCharInString(c_str, 12, 15);
	cout << s << endl;
	return 0;
}

void ChangeCharInString(char* orgstring, int startposition, int endposition)
{
	int slen = strlen(orgstring);
	char* old_str = NULL;
	
	old_str = new char[slen];

	memset(old_str, 0x00, slen);
	strcpy(old_str, orgstring);
	try
	{
		for(int i = startposition; i <= endposition; i++)
		{
			*(old_str + i) = 0x58;//'X'
		}
	}
	catch(...)
	{

	}
	strcpy(orgstring, old_str);
	delete [] old_str; // <=== Error occur!
}

live stream

$
0
0

https://live2watchvs.com/cricketworldcup2019/
https://live2watchvs.com/afghanistanvsindia/
https://live2watchvs.com/newzealandvswestindies/
https://live2watchvs.com/germanyvsnigeria/
https://live2watchvs.com/nigeriavsgermany/

live stream

$
0
0
https://live2watchvs.com/cricketworldcup2019/
https://live2watchvs.com/afghanistanvsindia/
https://live2watchvs.com/newzealandvswestindies/
https://live2watchvs.com/germanyvsnigeria/
https://live2watchvs.com/nigeriavsgermany/
https://live2watchvs.com/norwayvsaustralia/

Triggering automatically downloading a Microsoft Trusted Root Certificate from Windows Update using C++ ?

$
0
0

I have a windows application that talks to a server over HTTPS, but the root certificate is not in the Windows Certificates on a brand new installation of Windows.  If a user has a brand new machine, and somehow manages to get my app installed without opening a web page,  the app will fail to connect.

However,  if they go to our website,  Chrome, or Edge, or whichever browser, automatically downloads and installs the Trusted Root certificate from the Microsoft Trusted Root certificates list.   I know i can fetch the list of trusted certificates using `certutil -generateSSTFromWU roots.sst`  but that a) doesn't actually install the certs,  and b) would require my program running another app.  

Is there a way that I can trigger the same behaviour as chrome or edge from C++?  possibly giving the call the domain I want to look up, and it downloads the root authority ?  ( just in case i switch who is signing the certificate down the road I don't want to have to re-compile the app ? )   If that's not possible,  maybe I can specify the root cert to download from the trusted certificate list ? 

My certificate is signed by Go Daddy Secure Certificate Authority - G2,  which is signed by Go Daddy Root Certificate Authority - G2   for one product,  for another product it's signed by Amazon, which is signed by Starfield. 

http://woshub.com/updating-trusted-root-certificates-in-windows-10/

https://bitsofwater.com/2017/06/27/the-microsoft-root-certificate-program/

https://news.ycombinator.com/item?id=10139967

using CertOpenStore to get the "Microsoft Code Verification Root" certificate from kernel32.dll ?

$
0
0

Hi there,

This is a complex problem so I might not be going about it the right way.   If you have a better solution, let me know.

The problem:

We are using curl to talk to our server over https.  We have a wildcard certificate issued by Go Daddy.  We are populating curl's CURLOPT_SSL_CTX_DATA with the root certs from Windows Certificate Manager.   ( opened with 

HCERTSTORE hSystemStore = CertOpenStore(
CERT_STORE_PROV_SYSTEM_A,
X509_ASN_ENCODING,
NULL,
CERT_SYSTEM_STORE_CURRENT_USER | CERT_STORE_READONLY_FLAG,
"Root");

)

  On a brand new windows 10 machine, the Go Daddy Root cert is not in the Windows Certificate Manager.  Clients who run our program without having gone to a Go Daddy signed website get a certificate error. 

What I've done to try to solve it:

on my server, I've included the whole certificate chain for Go Daddy from https://certs.godaddy.com/repository  I've gotten the Microsoft to GoDaddy Cross Certificate, and the "GoDaddy Certificate Bundles - G2 With Cross to G1, includes Root".  The problem is that the root cert "Go Daddy Class 2 Certification Authority" is Cross Signed by the "Microsoft Code Verification Root" certificate and THAT cert isn't in the Windows Certificate Manager either. see here:  http://knowledgeobelisk.blogspot.ca/2014/05/so-for-those-of-you-who-are-attempting.html

It looks like I might be able to somehow load that cert from kernel32.dll   and I'm wondering how to do it.  Or I'm wondering if I'm even approaching this the right way. 

Observations:

I've noticed that as soon as you open the edge browser, and go to basically almost any website that the Go Daddy Cert ends up in your cert store, but somehow some of our customers don't do that ( They're from other countries. )

What I'm not doing:

  I don't want to include a copy of the cert in my executable, because then if it's revoked  or expires I need to release a new executable. 


Viewing all 15302 articles
Browse latest View live


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