The DeviceInfoData package


From SynCE-Wiki

The DeviceInfoData package is sent by the device to the host during the initial handshake.

Package definition

Layout
Name Size Type Comments
DeviceGUID 16 GUID
OsVersionMajor 4 DWORD
OsVersionMinor 4 DWORD
DeviceNameLength 4 DWORD
DeviceName 0-62 (0-31 characters) WCHAR, zero-terminated
DeviceVersion 4 DWORD
DeviceProcessorType 4 DWORD
Unknown1 4 DWORD Counter or a flag? ANDed with 0xFFFFFFFE in the code (should take a closer look at this)
CurrentPartnerId 4 DWORD
DeviceId 4 DWORD HKCU\Software\Microsoft\Windows CE Services\Partners\DeviceIdentifier
PlatformNameLength 4 DWORD
PlatformName 0-256 CHAR
ModelNameLength 4 DWORD
ModelName 0-256 CHAR
NumStringOffsetPairs 4 DWORD The number of DWORD-pairs following (a value between 0 and 6). Each pair is 8 bytes and is basically the end and start index of the string fields, from last towards first (This isn't completely REd yet so this might not be accurate).
StringOffsetPair_0..6 8 DWORD, DWORD Two DWORDs specifying end and start index (most likely).
NumStringOffsetPairs 4 DWORD Again, this repeats 0..n depending on whether this value is > 0.
PasswordKey 4 DWORD A key if a password is set, in which case authentication must be done before any RAPI calls can be made.

Example

0x00000000  0x6f 0x00 0x00 0x00                      o...       // Total package length
                                0x1c 0x56 0xc7 0x7e      .V.~   // DeviceGUID
0x00000008  0x3a 0x9e 0xa8 0x1a 0x79 0xe8 0x38 0x00  :...y.8.   // as shown in the registry
0x00000010  0xbc 0x3f 0x3d 0x88                      .?=.       // of the device
                                0x05 0x00 0x00 0x00      ....   // OsVersionMajor (DWORD)
0x00000018  0x01 0x00 0x00 0x00                      ....       // OsVersionMinor (DWORD)
                                0x04 0x00 0x00 0x00      ....   // Length of the device name
0x00000020  0x76 0x00 0x6d 0x00 0x64 0x00 0x61 0x00  v.m.d.a.   // Device name in unicode
0x00000028  0x00 0x00                                ..
                      0x05 0x01 0x46 0x00              ..F.     // DeviceVersion 5.1.70.0
		                          0x11 0x0a        ..   // DeviceProcessorType
0x00000030  0x00 0x00                                ..
                      0x05 0x00 0x00 0x00              ....     // Unknown1
                                          0x4a 0x4b        JK   // SomeOtherIdentifier
0x00000038  0xa5 0x0f                                ..
                      0x00 0x00 0x00 0x00              ....     // DeviceIdentifier
                                          0x0f 0x00        ..   // PlatformNameLength 
0x00000040  0x00 0x00                                ..         
                      0x50 0x6f 0x63 0x6b 0x65 0x74    Pocket   // PlatformName
0x00000048  0x50 0x43 0x00 0x53 0x53 0x44 0x4b 0x00  PC.SSDK.   
0x00000050  0x00                                     .
                 0x05 0x00 0x00 0x00                  ....      // VendorNameLength
                                     0x50 0x4d 0x32       PM2   // VendorName
0x00000058  0x30 0x30 0x00                           00.
                           0x02 0x00 0x00 0x00          ....    // NumStringOffsetPairs1
                                               0x04         .	// 1st StringOffsetPair
0x00000060  0x00 0x00 0x00 0x00 0x00 0x00 0x00       .......
                                               0x05         .   // 2nd StringOffsetPair
0x00000068  0x00 0x00 0x00 0x00 0x00 0x00 0x00       .......
                                               0x00         .   // This has something todo
0x00000070  0x00 0x00 0x00                           ...        // with a needed password

                                               0x7e         ~   // This is what it looks like
0x00000070  0xd1 0x0c 0x00                           ...        // when a password is needed