S
Satej PrabhuPatkar
Guest
Hi,
While working on one of our application on Windows 10, I found that the call to INetCfgLock::AcquireWriteLock is not working on Windows 10 but it works perfectly fine on Windows 7. The application is written in C# and the sample code looks like below:
object objINetCfg = null;
int nRet = Ole32Methods.CoCreateInstance(ref INetCfg_Guid.CLSID_CNetCfg, null, Ole32Methods.CLSCTX_INPROC_SERVER, ref INetCfg_Guid.IID_INetCfg, out objINetCfg);
INetCfg netCfg = objINetCfg as INetCfg;
INetCfgLock netCfgLock = netCfg as INetCfgLock;
string me = "MyApp";
string lockedby = "";
ulong timeout = 15000;
int lockRes = netCfgLock.AcquireWriteLock(timeout, me, lockedby);
The code throws an exception, after reaching code netCfgLock.AcquireWriteLock(timeout, me, lockedby). Any idea if this API or the interface is not supported on Windows 10 environment? If supported then, what changes we might need to do?
Regards,
Satej
Continue reading...
While working on one of our application on Windows 10, I found that the call to INetCfgLock::AcquireWriteLock is not working on Windows 10 but it works perfectly fine on Windows 7. The application is written in C# and the sample code looks like below:
object objINetCfg = null;
int nRet = Ole32Methods.CoCreateInstance(ref INetCfg_Guid.CLSID_CNetCfg, null, Ole32Methods.CLSCTX_INPROC_SERVER, ref INetCfg_Guid.IID_INetCfg, out objINetCfg);
INetCfg netCfg = objINetCfg as INetCfg;
INetCfgLock netCfgLock = netCfg as INetCfgLock;
string me = "MyApp";
string lockedby = "";
ulong timeout = 15000;
int lockRes = netCfgLock.AcquireWriteLock(timeout, me, lockedby);
The code throws an exception, after reaching code netCfgLock.AcquireWriteLock(timeout, me, lockedby). Any idea if this API or the interface is not supported on Windows 10 environment? If supported then, what changes we might need to do?
Regards,
Satej
Continue reading...