From: Scott B. <br...@ri...> - 2003-07-12 22:02:51
|
I'm having trouble declaring static data for my USB device. I need to enter some Unicode strings as part of a descriptor. No problem, right? typedef struct { BYTE length; BYTE type; BYTE unicode_data[]; } StringDescriptor; const StringDescriptor StringDscr1 = { STRING_DESCRIPTOR, sizeof(StringDscr1), { 'M', 0, 'y', 0, 'M', 0, 'f', 0, 'r', 0, } }; The problem is, this is what results: 0058 153 _StringDscr1: 0058 03 154 .db #0x03 0059 02 155 .db #0x02 005A 43 156 .db #0x43 005B 00 157 .db #0x00 Only the first two characters make it into the array. The rest is truncated. If I put a really large value into the array, it's zero-padded out to the declared size of the array. I can't use pointers because, of course, I don't have control over the format of the descriptor. What can I do? Am I hosed? After spending time setting up the C templates, I don't want to resort to assembly language db statements. :) - Scott |