自定义驱动程序访问--- UnauthorizedAccessException [英] Custom Driver Access---UnauthorizedAccessException

查看:99
本文介绍了自定义驱动程序访问--- UnauthorizedAccessException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 盖伊,

我只是遇到一个非常奇怪的问题,希望你们能给我一些建议。

i just come across a very strange problem, hope you guys can give me some advise.

我按照Coustom Driver Access示例编写我自己的驱动程序访问应用程序,实际上,我可以访问驱动程序并将IO控制代码发送给驱动程序。

i juest follow the Coustom Driver Access sample to write my own driver access app, actually, i can access the driver and send IO control code to the driver.

但是有一个问题模糊很多次。

But there are a problem fuzzy me a lot of times.

1. 间歇性返回访问被拒绝 

1. intermittent return Access denied 

a。)相同的应用程序,相同的元数据,相同设备,相同的操作系统,所有的功能可以在早上顺利处理,但访问被拒绝在下午返回。所以奇怪!清除本地元存储文件夹中的所有元数据(c:\ProgramData \ Microsoft &\\Windows \DeviceMetaStore)
并将devie元数据重新复制到此文件夹并重新启动系统,全部转为正常...发生在我的生活中,就像过山车一样。

a.)The same app,the same metadata, the same device ,the same OS, all the function can handled smoothly in the morning, but Access denied returned in afternoon.So strange!!! clear all the metadata in the local meta store folder(c:\ProgramData\Microsoft\Windows\DeviceMetaStore) and recopy the devie metadata to this folder and reboot the system,all turn to normal....What happed to my life,Just like a roller coaster.

b。)大多数时候从 

b.)most of times the access denied error returned from 

CreateDeviceAccessInstance (InstancePath->数据(),

             &NBSP ;     GENERIC_READ,// | GENERIC_WRITE,

                   &安培;访问);

CreateDeviceAccessInstance(InstancePath->Data(),
                                    GENERIC_READ ,//| GENERIC_WRITE,
                                    &access);

更奇怪的是一些倍我可以成功地调用&的 CreateDeviceAccessInstance,
但是错误信号---- UnauthorizedAccessException,从I / O代码属性返回。

more strange thing is some times i can successfully invoke CreateDeviceAccessInstance, but the errorr---- UnauthorizedAccessException ,returned from the I/O code property.

它看起来更像是跟随g方案:

it's more look like the following scenario:

在Custom Driver Access示例中,我可以成功调用 Fx2Device.FromId(id);但是当我获得&strong; SevenSegmentDisplay
属性时,它会返回UnauthorizedAccessException。谁能告诉我原因?

in the Custom Driver Access sample, i can successfully invoke Fx2Device.FromId(id); but when i get the SevenSegmentDisplay property, it's return UnauthorizedAccessException. Who can tell me why?

c。)我在主板上有两个板载设备,一个是看门狗,一个是I2C温度传感器,所以我有两个驱动器驱动这个两个设备,我也有两个Windows stroe APP来处理这两个设备。

c.) i have two onboard devices on the main board,one is a watchdog and one is a I2C temprature sensor, so i have two drivers to drive this two device, also i have two Windows stroe APP to handle those two devices.

首先,我将温度元数据复制到目标设备的DeviceMetaStore,并使用VS远程工具来部署温度应用程序从开发机器到目标机器。它的工作非常好。

first, i copy the temprature metadata to the target device's DeviceMetaStore,and use the VS remote tool to deploy the temprature app from develop machine to the target machine. it's worked very good.

然后,我将看门狗元数据复制到目标设备的DeviceMetaStore,同时使用VS远程工具将应用程序部署到目标机器。

then, i copy the watchdog metadata to the target device's DeviceMetaStore,also use the VS remote tool to deploy the app to the target machine.

它工作得非常好。

然后,我将温度应用程序重新部署到目标设备,它返回Access拒绝....谁可以帮助我...?

then, i redeploy the temprature app to the target device, it's return Access denied ....Who can help me...?

2。如果我想发布我的看门狗和温度传感器应用程序,我该怎么办?

2. if i want publish my watchdog and temprature sensor app,how can i do?

   现在,虽然我有时可以访问驱动程序,但我必须设置testigning。当我没有设置testigning时,总是返回Access denied。我想知道是否有一种方法可以直接访问驱动程序,我不需要设置testigning

    now,  although i can access the driver sometimes,i must set the testsigning on.when i do not set testsigning on, always return Access denied. i want to know if there is a way i can direct access the driver and i needn't set the testsigning on.

谢谢你们。

推荐答案

Wuxianghou,

Wuxianghou,

在开发阶段需要进行测试签名。

Test signing is required during the development stages.

祝福 - Eric

Best Wishes - Eric


这篇关于自定义驱动程序访问--- UnauthorizedAccessException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆