2 * ReactOS emulation layer betwin wine and windows api for directx
3 * convort string to GUID
5 * Copyright 2004 Magnus Olsen
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 * Rewrite so it use unicode instead for asc or find how windows convert it
28 #include "wine/port.h"
33 #include <sys/types.h>
34 #include <sys/fcntl.h>
42 #define NONAMELESSSTRUCT
43 #define NONAMELESSUNION
54 #include "wine/windef16.h"
55 #include "wine/winbase16.h"
56 #include "wine/debug.h"
59 #include "dxros_layer.h"
63 WINE_DEFAULT_DEBUG_CHANNEL(dsound
);
67 void dxGetGuidFromString( char *in_str
, GUID
*guid
)
72 // this string hex converter need to be rewrite or find uhow windows convort a string
77 if (in_str
[i
]>='0' && in_str
[i
]<='9')
79 c
=c
* 16 + (in_str
[i
] - 48);
81 else if (in_str
[i
]>='A' && in_str
[i
]<='F')
83 c
=c
* 16 + (in_str
[i
] - 55);
91 if (in_str
[i
]>='0' && in_str
[i
]<='9')
93 c
=c
* 16 + (in_str
[i
] - 48);
95 else if (in_str
[i
]>='A' && in_str
[i
]<='F')
97 c
=c
* 16 + (in_str
[i
] - 55);
101 guid
->Data2
= (short) c
;
106 if (in_str
[i
]>='0' && in_str
[i
]<='9') c
=c
* 16 + (in_str
[i
] - 48);
107 else if (in_str
[i
]>='A' && in_str
[i
]<='F') c
=c
* 16 + (in_str
[i
] - 55);
109 guid
->Data3
= (short) c
;
114 if (in_str
[i
]>='0' && in_str
[i
]<='9') c
=c
* 16 + (in_str
[i
] - 48);
115 else if (in_str
[i
]>='A' && in_str
[i
]<='F') c
=c
* 16 + (in_str
[i
] - 55);
117 guid
->Data4
[0] = (BYTE
) c
;
122 if (in_str
[i
]>='0' && in_str
[i
]<='9') c
=c
* 16 + (in_str
[i
] - 48);
123 else if (in_str
[i
]>='A' && in_str
[i
]<='F') c
=c
* 16 + (in_str
[i
] - 55);
125 guid
->Data4
[1] = (BYTE
) c
;
131 if (in_str
[i
]>='0' && in_str
[i
]<='9') c
=c
* 16 + (in_str
[i
] - 48);
132 else if (in_str
[i
]>='A' && in_str
[i
]<='F') c
=c
* 16 + (in_str
[i
] - 55);
134 guid
->Data4
[2] = (BYTE
) c
;
139 if (in_str
[i
]>='0' && in_str
[i
]<='9') c
=c
* 16 + (in_str
[i
] - 48);
140 else if (in_str
[i
]>='A' && in_str
[i
]<='F') c
=c
* 16 + (in_str
[i
] - 55);
142 guid
->Data4
[3] = (BYTE
) c
;
147 if (in_str
[i
]>='0' && in_str
[i
]<='9') c
=c
* 16 + (in_str
[i
] - 48);
148 else if (in_str
[i
]>='A' && in_str
[i
]<='F') c
=c
* 16 + (in_str
[i
] - 55);
150 guid
->Data4
[4] = (BYTE
) c
;
155 if (in_str
[i
]>='0' && in_str
[i
]<='9') c
=c
* 16 + (in_str
[i
] - 48);
156 else if (in_str
[i
]>='A' && in_str
[i
]<='F') c
=c
* 16 + (in_str
[i
] - 55);
158 guid
->Data4
[5] = (BYTE
) c
;
163 if (in_str
[i
]>='0' && in_str
[i
]<='9') c
=c
* 16 + (in_str
[i
] - 48);
164 else if (in_str
[i
]>='A' && in_str
[i
]<='F') c
=c
* 16 + (in_str
[i
] - 55);
166 guid
->Data4
[6] = (BYTE
) c
;
171 if (in_str
[i
]>='0' && in_str
[i
]<='9') c
=c
* 16 + (in_str
[i
] - 48);
172 else if (in_str
[i
]>='A' && in_str
[i
]<='F') c
=c
* 16 + (in_str
[i
] - 55);
174 guid
->Data4
[7] = (BYTE
) c
;