1 | /* $Id: strings.cpp,v 1.4 1999-07-06 08:50:12 sandervl 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 | #define INCL_DOSFILEMGR /* File Manager values */
|
---|
13 | #define INCL_DOSERRORS /* DOS Error values */
|
---|
14 | #define INCL_DOSPROCESS /* DOS Process values */
|
---|
15 | #define INCL_DOSMISC /* DOS Miscellanous values */
|
---|
16 | #define INCL_DOSNLS
|
---|
17 | #define INCL_WIN
|
---|
18 | #include <os2.h>
|
---|
19 | #include <stdio.h>
|
---|
20 | #include <string.h>
|
---|
21 | #include <stdlib.h>
|
---|
22 | #include <iostream.h>
|
---|
23 | #include <string.h>
|
---|
24 | #include "lx.h"
|
---|
25 | #include "strings.h"
|
---|
26 | #include "misc.h"
|
---|
27 |
|
---|
28 | //******************************************************************************
|
---|
29 | //Save as RCDATA and make sure the kernel API's don't use the Open32 string
|
---|
30 | //retrieval stuff
|
---|
31 | //OS/2 strings are stored in a similar way as windows strings with the
|
---|
32 | //important difference that OS/2 strings can only be 256 bytes long
|
---|
33 | //whereas windows strings can be up to 64k bytes long
|
---|
34 | //******************************************************************************
|
---|
35 | void ShowStrings(int id, char *data, int size, int cp)
|
---|
36 | {
|
---|
37 | USHORT *len;
|
---|
38 | int i;
|
---|
39 |
|
---|
40 | cout << "String Table resource with id " << id << ", size " << size << endl;
|
---|
41 |
|
---|
42 | len = (USHORT *)data;
|
---|
43 | for(i=0;i<16;i++) {
|
---|
44 | // if(*len != 0) {//skip NULL strings
|
---|
45 | cout << "String " << (id-1)*16+i << " " << UnicodeToAscii((*len), len+1) << endl;
|
---|
46 | OS2Exe.StoreResource((id-1)*16+i, RT_RCDATA, (*len)*2 + 2, (char *)len);
|
---|
47 | // }
|
---|
48 | len += *len + 1;
|
---|
49 | }
|
---|
50 | }
|
---|
51 | //******************************************************************************
|
---|
52 | //******************************************************************************
|
---|