1 | /* $Id: strings.cpp,v 1.1 1999-09-06 02:20:08 bird Exp $ */
|
---|
2 |
|
---|
3 | /*
|
---|
4 | * PE2LX String conversion
|
---|
5 | *
|
---|
6 | * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)
|
---|
7 | *
|
---|
8 | *
|
---|
9 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
10 | *
|
---|
11 | */
|
---|
12 |
|
---|
13 | /*******************************************************************************
|
---|
14 | * Header Files *
|
---|
15 | *******************************************************************************/
|
---|
16 | #include "pe2lx.h"
|
---|
17 | #include "strings.h"
|
---|
18 |
|
---|
19 |
|
---|
20 | //******************************************************************************
|
---|
21 | //Save as RCDATA and make sure the kernel API's don't use the Open32 string
|
---|
22 | //retrieval stuff
|
---|
23 | //OS/2 strings are stored in a similar way as windows strings with the
|
---|
24 | //important difference that OS/2 strings can only be 256 bytes long
|
---|
25 | //whereas windows strings can be up to 64k bytes long
|
---|
26 | //******************************************************************************
|
---|
27 | BOOL ShowStrings(LXHeaderSuper &OS2Exe, int id, char *data, int size, int cp)
|
---|
28 | {
|
---|
29 | USHORT *len;
|
---|
30 | int i;
|
---|
31 | BOOL rc = TRUE;
|
---|
32 | ltassert((ULONG)data > MINPTR && (ULONG)data+size < MAXPTR)
|
---|
33 |
|
---|
34 | cout << "String Table resource with id " << id << ", size " << size << endl;
|
---|
35 |
|
---|
36 | len = (USHORT *)data;
|
---|
37 | for (i=0;i<16 && rc;i++)
|
---|
38 | {
|
---|
39 | cout << "String " << (id-1)*16+i << " "<< *len << " " << UnicodeToAscii(*len, len+1, cp);
|
---|
40 | rc = OS2Exe.StoreResource((id-1)*16+i, RT_RCDATA, (*len)*2 + 2, (char *)len);
|
---|
41 | len += *len + 1;
|
---|
42 | }
|
---|
43 | return rc;
|
---|
44 | }
|
---|
45 | //******************************************************************************
|
---|
46 | //******************************************************************************
|
---|