At 11:55 AM 12/5/2002 -0800, you wrote:
I am investigating the feasibility of setting a Palm's Hotsync user name for a very specific utility I'm developing. This will happen only on devices which have NOT YET been through their First Sync -- in other words, freshly hard-reset.
Thanks to everybody for the replies. I'll summarize what I've learned thus far:

There are at least two utilities out there already that do this:

1) Schizophrenic, which allows you to selectively change the Hotsync user name, HS ID, OS string, and ROM ID prior to launching any application. http://schizophrenic.sf.net

2) ChangeName, which does similarly: http://www.mulliner.org/palm/changename.php

The implication here is that the handheld does not yet have a last sync PC ID record, nor does it have a user name set into the DlkUserInfo structure, which is stored, as I understand it, in the PreferenceDB's sysResTSysPref / sysResIDDlkUserInfo resource record.

Ideally, I want a temporary utility app running on the device to assign a HS username programmatically, without relying at all upon the desktop Hotsync Mgr APIs -- say, "Joe User". It seems like doing this is simply a matter of locking down the resource record noted above and writing to it.

I played around with the sysResIDDlkUserInfo resource in the PreferenceDB, and it behaves as expected when cast to the DlkUserInfoType, as defined in "Palm OS Support\Incs\Core\System\DlServer.h". Two gotchas in manipulating this resource:

1) It won't exist immediately following a Hotsync. Calling DlkGetSyncInfo( NULL, NULL, NULL, NULL, NULL, NULL ) is a harmless way to set it up if it's missing (as in this case).

2) The DlkUserInfoType is a packed record. You can work with the elements in its 'header' field just fine, but in order to work with the username and HS log, which are the two 'packed' elements, one must unpack them. Something like:

typedef struct MyUserInfoType
{
DlkUserInfoHdrType header;
char name[maxUserNameLen]; // I used 32, 20+NULL seems to be the max possible
char HSLog[maxHSLogLen]; // I truncate at 512
} MyUserInfoType;

3) If you change the LENGTH of the user name field in the DlkUserInfoType's nameAndLog field, you have to make sure you modify header.userNameLen, as well as repositioning the HS log. This means resizing the sysResIDDlkUserInfo resource (watch out, it might switch heaps) as well.

Happy Holidays!
-Jeff Ishaq



--
For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/


Reply via email to