I am a beginner in WDF ,I send the vendor request use UsbBuildVendorRequest and
CallUSBD,but in WDF ,what function I can use,thank you.
who can give me a example to send the vendor request to device ,and thank you .
I am a beginner in WDF ,I send the vendor request use UsbBuildVendorRequest and
CallUSBD,but in WDF ,what function I can use,thank you.
who can give me a example to send the vendor request to device ,and thank you .
There are some macros defined to define USB Request, and for vendor request you can use DF_USB_CONTROL_SETUP_PACKET_INIT_VENDOR. Or even you can manually set it.
At last, you send the request use WdfRequestSend.
>I am a beginner in WDF ,I send the vendor request use UsbBuildVendorRequest and
CallUSBD,but in WDF ,what function I can use,thank you.
who can give me a example to send the vendor request to device ,and thank you .
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
Look at the example OSR FX2 driver in the WDK. It sends several of vendor requests.
Peter
OSR
This will help you. I think you are Chinese, so I give you a chinese web page.
http://bbs.driverdevelop.com/read.php?fid=22&tid=119314&toread=1
Good Luck!
Look at the example OSR FX2 driver in the WDK. It sends several of vendor requests.
Peter
OSR
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
Mr. Change Pei: Not THAT helpful, I think… and very close to a commercial post (which wouldn’t be allowed by this group).
Now, if you actually gave the guy a link to a web page with some tutorial information in his native language, THAT would be helpful.
Peter
OSR
to chang pei ,not that helpful,
thank for all foreign friends,and you are passionate and helpful
thank you very much indeed.
I look at the wdk osr fx2, find WDF_USB_CONTROL_SETUP_PACKET_INIT_VENDOR and WdfUsbTargetDeviceSendControlTransferSynchronously ,is it equal to UsbBuildVendorRequest and
CallUSBD,who can tell me ? thank you .
Yes, they are the same.
d
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of zhonghong200@163.com
Sent: Wednesday, August 18, 2010 10:28 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] KMDF how to send vendor request to device
I look at the wdk osr fx2, find WDF_USB_CONTROL_SETUP_PACKET_INIT_VENDOR and WdfUsbTargetDeviceSendControlTransferSynchronously ,is it equal to UsbBuildVendorRequest and
CallUSBD,who can tell me ? thank you .
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
thank you my friends
OK. The second floor of that has a link to download USB developing documents. This is another link of that document without commericial issue:
http://wenku.baidu.com/view/da42994769eae009581bec4a.html
Good luck.
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
To unsubscribe, visit the List Server section of OSR Online at ListServer/Forum
thank you
Now THAT’s a darn helpful URL… I wish my Chinese was better than it currently is (and I had an account that would allow me to download the document).
Peter
OSR
HeHe ![]()
If you are interested, it’s funny to study Chinese. Every student in China has a hard and long period in school to study English(more than 10 yeare for most students, and English is always one of the most important lesson in school). Someone said that English is easier than Chinese language, I don’t agree! If you are Chinese student, you won’t say that~
Now THAT’s a darn helpful URL… I wish my Chinese was better than it currently is (and I had an account that would allow me to download the document).
Peter
OSR
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
thank you all my friend,now,I have a question.
I am beginner in wdf,and can not send vendor request. I send vendor request through UsbBuildVendorRequest function. and the prototype is
void UsbBuildVendorRequest(
[in] PURB Urb,
[in] USHORT Function,
[in] USHORT Length,
[in] ULONG TransferFlags,
[in] UCHAR ReservedBits,
[in] UCHAR Request,
[in] USHORT Value,
[in] USHORT Index,
[in, optional] PVOID TransferBuffer,
[in, optional] PMDL TransferBufferMDL,
[in] ULONG TransferBufferLength,
[in] PURB Link
);
but i use wdf’s function WDF_USB_CONTROL_SETUP_PACKET_INIT_VENDOR and WdfUsbTargetDeviceSendControlTransferSynchronously to send the vendor request ,but how to fill the controlSetupPacket,such as transfer length .my code is:
case IOCTL_USBSAMP_CUSTOM_COMMAND:
status=WdfRequestRetrieveInputBuffer(Request,10,&ioBuffer,&bufLength);
cmd=((UCHAR*)ioBuffer)[1];
WDF_REQUEST_SEND_OPTIONS_INIT(
&sendOptions,
WDF_REQUEST_SEND_OPTION_TIMEOUT
);
WDF_REQUEST_SEND_OPTIONS_SET_TIMEOUT(
&sendOptions,
DEFAULT_CONTROL_TRANSFER_TIMEOUT
);
WDF_USB_CONTROL_SETUP_PACKET_INIT_VENDOR(&controlSetupPacket,
BmRequestHostToDevice,
BmRequestToDevice,
cmd, // Request
0, // Value
0); // Index
status = WdfUsbTargetDeviceSendControlTransferSynchronously(
pDevContext->WdfUsbTargetDevice,
WDF_NO_HANDLE, // Optional WDFREQUEST
&sendOptions,
&controlSetupPacket,
NULL, // MemoryDescriptor
NULL); // BytesTransferred
if(!NT_SUCCESS(status)) {
UsbSamp_DbgPrint(1, (“UsbBuildVendorRequest Failed\n”));
}
status= STATUS_SUCCESS;
break;
in my appliction i use deviceiocontrol send control command ,and i use bushound to see the packet that send to driver,but I find the SetupPacket’s length=0. how to fill the length,such as wdm usbbuildvendorrequest function 's TransferBufferLength.
> If you are interested, it’s funny to study Chinese. Every student in China has a hard and long period in
school to study English(more than 10 yeare for most students, and English is always one of the most
important lesson in school). Someone said that English is easier than Chinese language, I don’t
agree! If you are Chinese student, you won’t say that~
Here in Russia, English is usually considered to be easier (as foreign language) then Russian (hard language for foreigners) or Hebrew, but more complex then Spanish (possibly easiest for foreigners).
As about Chinese - here in Russia people consider it as the hardest, due to hieroglyphical script.
–
Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com
I think they’re equally difficult, actually.
Native English speakers have BIG trouble consistently using the tones correctly (we tend to lapse back into our English language practice of using tone to “add value” to the sentence structure, such as to make a statement a question). OTOH, Chinese grammar and sentence structure is a real pleasure to learn and use (I think it makes particularly good sense to programmers!). And, of course, reading and especially writing Chinese characters is quite a challenge. Chinese language programs in the States are split over whether to have students learn characters immediately, or to have them start by learning a romanization (such as Pinyin). They each have their own advantages (using Pinyin helps reinforce those pesky tones… learning characters from the start gives you a better “flavor” for the language).
OTOH, I know that native Chinese speaks find English grammar and sentence structure to be needlessly complex and difficult to learn.
Peter
OSR
I agree with you Peter. In fact, charachters have its own virtue to prove that it is easy to study. When you have learned about 600-1000 characters, to most people it is almost all. 95% sentences/words in everyday life are organized by them.
Such as: TV in Chinese, is orgnized with Electr + Watch; Computer is orgnize with Electr + Header; Telephone is orgnized with Electr + Talk...
We don't create new charachters. Same charachters have be used thounds years. May be we create new words, but they are all orgnized with the charachters. And you can easily get its meaning such as computer\tv\telephone. Besides noun, verb and adjuective words are also can be understand just by word self. Such as worry, in Chinese it is orgnized by Up(v) + Heart(n), very meaningful.
For a beginner you should first learn the charachters, it's hard. But when you have past the phase, everything will be easy.
English or Russia or others not that. New words are created very quickly, and you can't so easily understand them only from word itself. So you should keep studying. Chinese student to pass GRE, they should remember more than 10,000 words.
In the other hand, Chinese don't have complex grammer(even don't have tense, you can add 'ed'/'ing' to a verb, but can't add it to a character). Chinese use a very simple grammer format. And, we can easily use noun as a verb or adjective--don't need change, everyone can understander. Such as: 'I'm very China!' it meas: I'm a classical Chinese man.
Another thing about character writing. Good handwriting is top art in China(more than 4000 years with record in history). In old days we use brush pen, characters under brush pen will be turned so beautiful like pictures. Letters can't get that effect. But now, everyone use computer everyday everywhere. We use PinYin to type input charachters. So when we occasionally want to write something to a paper with pen, forget how to write. Sad! But no one can be so easily forget 26 letters(a-z). So we begin to call people insist on make some writing with pen everyday.
Said that Chinese is the only live hieroglyphical script in the world. So, when everyone is studying English(or French\Russian and so on). Begin to study this hieroglyphical script will make you larruping(looks different).
Hope I have explain something clear. You don't need to bear the bad English.
RE:[ntdev] KMDF how to send vendor request to device
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
To unsubscribe, visit the List Server section of OSR Online at ListServer/Forum
zhonghong200@163.com wrote:
thank you all my friend,now,I have a question.
I am beginner in wdf,and can not send vendor request. I send vendor request through UsbBuildVendorRequest function. and the prototype is …
but i use wdf’s function WDF_USB_CONTROL_SETUP_PACKET_INIT_VENDOR and WdfUsbTargetDeviceSendControlTransferSynchronously to send the vendor request ,but how to fill the controlSetupPacket,such as transfer length .my code is:case IOCTL_USBSAMP_CUSTOM_COMMAND:
status=WdfRequestRetrieveInputBuffer(Request,10,&ioBuffer,&bufLength);
cmd=((UCHAR*)ioBuffer)[1];
WDF_REQUEST_SEND_OPTIONS_INIT(
&sendOptions,
WDF_REQUEST_SEND_OPTION_TIMEOUT
);WDF_REQUEST_SEND_OPTIONS_SET_TIMEOUT(
&sendOptions,
DEFAULT_CONTROL_TRANSFER_TIMEOUT
);WDF_USB_CONTROL_SETUP_PACKET_INIT_VENDOR(&controlSetupPacket,
BmRequestHostToDevice,
BmRequestToDevice,
cmd, // Request
0, // Value
0); // Indexstatus = WdfUsbTargetDeviceSendControlTransferSynchronously(
pDevContext->WdfUsbTargetDevice,
WDF_NO_HANDLE, // Optional WDFREQUEST
&sendOptions,
&controlSetupPacket,
NULL, // MemoryDescriptor
NULL); // BytesTransferredif(!NT_SUCCESS(status)) {
UsbSamp_DbgPrint(1, (“UsbBuildVendorRequest Failed\n”));}
status= STATUS_SUCCESS;
break;in my appliction i use deviceiocontrol send control command ,and i use bushound to see the packet that send to driver,but I find the SetupPacket’s length=0. how to fill the length,such as wdm usbbuildvendorrequest function 's TransferBufferLength.
Did you read the documentation for
WdfUsbTargetDeviceSendControlTransferSynchronously? What would you
guess the MemoryDescriptor parameter is for?
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
> OTOH, I know that native Chinese speaks find English grammar and sentence structure to be
needlessly complex and difficult to learn.
Then what is the most complex language for foreigners? Hebrew?
–
Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com
I would say Japanese…