简体   繁体   English

BW VB6和C#CryptAcquireContext的行为差异说明请求

[英]behaviour difference explainaion request of bw VB6 and C# CryptAcquireContext

I am at odds with the behavior of following code, mostly because I am not well versed with VB6. 我与以下代码的行为不符,主要是因为我不太熟悉VB6。 My VB declarations 我的VB声明

MS_DEF_PROV_A ="Microsoft Base Cryptographic Provider v1.0"
PROV_RSA_FULL=1
CRYPT_VERIFYCONTEXT== &HF0000000

C# Declarations C#声明

const string MS_DEF_PROV = "Microsoft Base Cryptographic Provider v1.0";
uint PROV_RSA_FULL = 1;
public const uint CRYPT_VERIFYCONTEXT = 0xF0000000;

now when I run the following code 现在,当我运行以下代码

CryptAcquireContext(out hProv, null, MS_DEF_PROV, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT);

And set a break point here, I see that variable in C# 并在此处设置一个断点,我在C#中看到该变量

CRYPT_VERIFYCONTEXT = 4026531840

While on the VB side it has value of 在VB方面,它的价值为

CRYPT_VERIFYCONTEXT = -268435456

I just wonder why is this discrepancy, shouldn't it be the same value..both values are on the same computer, just different IDEs..It might not be anything, but since I don't know much so want to understand the difference in behavior.. 我只是想知道为什么会出现这种差异,难道它不应该是相同的值吗。两个值都在同一台计算机上,只是在不同的IDE上。可能不算什么,但是由于我了解不多,所以想了解行为差异

Thanks 谢谢

VB6 only supports signed 32 bit numbers. VB6仅支持带符号的32位数字。 To the function recieving the number the bits are the same. 对于接收数字的功能,位是相同的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM