| 1 | /* $Id: shlwapi.cpp,v 1.4 2000-01-31 22:50:51 phaller Exp $ */
|
|---|
| 2 |
|
|---|
| 3 | /*
|
|---|
| 4 | * Win32 URL-handling APIs for OS/2
|
|---|
| 5 | *
|
|---|
| 6 | * Copyright 1999 Patrick Haller <phaller@gmx.net>
|
|---|
| 7 | *
|
|---|
| 8 | * Project Odin Software License can be found in LICENSE.TXT
|
|---|
| 9 | *
|
|---|
| 10 | * Copyright 1996,1998 Marcus Meissner
|
|---|
| 11 | * Copyright 1996 Jukka Iivonen
|
|---|
| 12 | * Copyright 1997 Uwe Bonnes
|
|---|
| 13 | * Copyright 1999 Jens Wiessner
|
|---|
| 14 | */
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 | #include <odin.h>
|
|---|
| 18 | #include <odinwrap.h>
|
|---|
| 19 | #include <os2sel.h>
|
|---|
| 20 |
|
|---|
| 21 | #include <string.h>
|
|---|
| 22 | #include <ctype.h>
|
|---|
| 23 | #include <wctype.h>
|
|---|
| 24 | #define HAVE_WCTYPE_H
|
|---|
| 25 | #include <odin.h>
|
|---|
| 26 |
|
|---|
| 27 | #define ICOM_CINTERFACE 1
|
|---|
| 28 | #define CINTERFACE 1
|
|---|
| 29 |
|
|---|
| 30 | #include "debugtools.h"
|
|---|
| 31 | #include "winnls.h"
|
|---|
| 32 | #include "winversion.h"
|
|---|
| 33 | #include "winreg.h"
|
|---|
| 34 | #include "crtdll.h"
|
|---|
| 35 |
|
|---|
| 36 | #include <heapstring.h>
|
|---|
| 37 | #include <misc.h>
|
|---|
| 38 | #include <win\shell.h>
|
|---|
| 39 | #include <win\winerror.h>
|
|---|
| 40 |
|
|---|
| 41 | ODINDEBUGCHANNEL(SHLWAPI)
|
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 | /*
|
|---|
| 46 | shlwapi functions that have found their way in because most of
|
|---|
| 47 | shlwapi is unimplemented and doesn't have a home.
|
|---|
| 48 |
|
|---|
| 49 | FIXME: move to a more appropriate file( when one exists )
|
|---|
| 50 | */
|
|---|
| 51 |
|
|---|
| 52 | /* SHGetValue: Gets a value from the registry */
|
|---|
| 53 |
|
|---|
| 54 | ODINFUNCTION6(DWORD,SHGetValueA,HKEY, hkey,
|
|---|
| 55 | LPCSTR, pSubKey,
|
|---|
| 56 | LPCSTR, pValue,
|
|---|
| 57 | LPDWORD, pwType,
|
|---|
| 58 | LPVOID, pvData,
|
|---|
| 59 | LPDWORD, pbData)
|
|---|
| 60 | {
|
|---|
| 61 | dprintf(("(%p),stub!\n", pSubKey));
|
|---|
| 62 |
|
|---|
| 63 | return ERROR_SUCCESS; /* return success */
|
|---|
| 64 | }
|
|---|
| 65 |
|
|---|
| 66 | ODINFUNCTION6(DWORD,SHGetValueW,HKEY, hkey,
|
|---|
| 67 | LPCWSTR, pSubKey,
|
|---|
| 68 | LPCWSTR, pValue,
|
|---|
| 69 | LPDWORD, pwType,
|
|---|
| 70 | LPVOID, pvData,
|
|---|
| 71 | LPDWORD, pbData)
|
|---|
| 72 | {
|
|---|
| 73 | dprintf(("(%p),stub!\n", pSubKey));
|
|---|
| 74 |
|
|---|
| 75 | return ERROR_SUCCESS; /* return success */
|
|---|
| 76 | }
|
|---|
| 77 |
|
|---|
| 78 | /* gets a user-specific registry value. */
|
|---|
| 79 |
|
|---|
| 80 | ODINFUNCTION8(LONG,SHRegGetUSValueA,LPCSTR, pSubKey,
|
|---|
| 81 | LPCSTR, pValue,
|
|---|
| 82 | LPDWORD, pwType,
|
|---|
| 83 | LPVOID, pvData,
|
|---|
| 84 | LPDWORD, pbData,
|
|---|
| 85 | BOOL, fIgnoreHKCU,
|
|---|
| 86 | LPVOID, pDefaultData,
|
|---|
| 87 | DWORD, wDefaultDataSize)
|
|---|
| 88 | {
|
|---|
| 89 | FIXME("(%p),stub!\n", pSubKey);
|
|---|
| 90 |
|
|---|
| 91 | return ERROR_SUCCESS; /* return success */
|
|---|
| 92 | }
|
|---|
| 93 |
|
|---|
| 94 | ODINFUNCTION8(LONG,SHRegGetUSValueW,LPCWSTR, pSubKey,
|
|---|
| 95 | LPCWSTR, pValue,
|
|---|
| 96 | LPDWORD, pwType,
|
|---|
| 97 | LPVOID, pvData,
|
|---|
| 98 | LPDWORD, pbData,
|
|---|
| 99 | BOOL, flagIgnoreHKCU,
|
|---|
| 100 | LPVOID, pDefaultData,
|
|---|
| 101 | DWORD, wDefaultDataSize)
|
|---|
| 102 | {
|
|---|
| 103 | dprintf(("(%p),stub!\n", pSubKey));
|
|---|
| 104 |
|
|---|
| 105 | return ERROR_SUCCESS; /* return success */
|
|---|
| 106 | }
|
|---|
| 107 |
|
|---|
| 108 |
|
|---|
| 109 | /*****************************************************************************
|
|---|
| 110 | * Name : DWORD SHRegGetBoolUSValueA
|
|---|
| 111 | * Purpose : unknown
|
|---|
| 112 | * Parameters: unknown
|
|---|
| 113 | * Variables :
|
|---|
| 114 | * Result : unknown
|
|---|
| 115 | * Remark : SHLWAPI.SHRegGetBoolUSValueA
|
|---|
| 116 | * Status : UNTESTED
|
|---|
| 117 | *
|
|---|
| 118 | * Author : Patrick Haller [Wed, 1999/12/29 23:02]
|
|---|
| 119 | *****************************************************************************/
|
|---|
| 120 |
|
|---|
| 121 | ODINFUNCTION5(LONG, SHRegGetBoolUSValueA,
|
|---|
| 122 | LPCSTR, pSubKey,
|
|---|
| 123 | DWORD, arg2,
|
|---|
| 124 | DWORD, arg3,
|
|---|
| 125 | DWORD, arg4,
|
|---|
| 126 | DWORD, arg5)
|
|---|
| 127 | {
|
|---|
| 128 | char szBuffer[264];
|
|---|
| 129 | int iLength;
|
|---|
| 130 |
|
|---|
| 131 | dprintf(("(%p),stub!\n", pSubKey));
|
|---|
| 132 |
|
|---|
| 133 | return ERROR_SUCCESS; /* return success */
|
|---|
| 134 | }
|
|---|
| 135 |
|
|---|
| 136 |
|
|---|
| 137 | /*****************************************************************************
|
|---|
| 138 | * Name : DWORD SHRegGetBoolUSValueW
|
|---|
| 139 | * Purpose : unknown
|
|---|
| 140 | * Parameters: unknown
|
|---|
| 141 | * Variables :
|
|---|
| 142 | * Result : unknown
|
|---|
| 143 | * Remark : SHLWAPI.SHRegGetBoolUSValueW
|
|---|
| 144 | * Status : UNTESTED
|
|---|
| 145 | *
|
|---|
| 146 | * Author : Patrick Haller [Wed, 1999/12/29 23:02]
|
|---|
| 147 | *****************************************************************************/
|
|---|
| 148 |
|
|---|
| 149 | ODINFUNCTION5(LONG, SHRegGetBoolUSValueW,
|
|---|
| 150 | LPCWSTR, pSubKey,
|
|---|
| 151 | DWORD, arg2,
|
|---|
| 152 | DWORD, arg3,
|
|---|
| 153 | DWORD, arg4,
|
|---|
| 154 | DWORD, arg5)
|
|---|
| 155 | {
|
|---|
| 156 | char szBuffer[264];
|
|---|
| 157 | int iLength;
|
|---|
| 158 |
|
|---|
| 159 | dprintf(("(%p),stub!\n", pSubKey));
|
|---|
| 160 |
|
|---|
| 161 | return ERROR_SUCCESS; /* return success */
|
|---|
| 162 | }
|
|---|
| 163 |
|
|---|
| 164 |
|
|---|
| 165 | /*****************************************************************************
|
|---|
| 166 | * Name : LPSTR PathSkipRootA
|
|---|
| 167 | * Purpose : Parses a path, ignoring the drive letter or UNC server/share path parts.
|
|---|
| 168 | * Parameters: LPCSTR pszPath
|
|---|
| 169 | * Variables :
|
|---|
| 170 | * Result : unknown
|
|---|
| 171 | * Remark : SHLWAPI.PathSkipRootA
|
|---|
| 172 | * Status : UNTESTED
|
|---|
| 173 | *
|
|---|
| 174 | * Author : Patrick Haller [Mon, 2000/01/31 23:02]
|
|---|
| 175 | *****************************************************************************/
|
|---|
| 176 |
|
|---|
| 177 | ODINFUNCTION1(LPSTR, PathSkipRootA, LPCSTR, pszPath)
|
|---|
| 178 | {
|
|---|
| 179 | // check if "driveletter:\"
|
|---|
| 180 | if (pszPath[1] == ':')
|
|---|
| 181 | return (LPSTR)(pszPath + 2);
|
|---|
| 182 |
|
|---|
| 183 | // check if UNC-style path
|
|---|
| 184 | if ( (pszPath[0] == '\\') &&
|
|---|
| 185 | (pszPath[1] == '\\') )
|
|---|
| 186 | {
|
|---|
| 187 | LPSTR pszTemp = strchr(pszPath + 2, '\\');
|
|---|
| 188 | if (NULL != pszTemp)
|
|---|
| 189 | // return root part, skip server/share
|
|---|
| 190 | return (LPSTR)pszTemp++;
|
|---|
| 191 | else
|
|---|
| 192 | // UNC syntax validation, return pszPath
|
|---|
| 193 | return (LPSTR)pszTemp;
|
|---|
| 194 | }
|
|---|
| 195 |
|
|---|
| 196 | // else ...
|
|---|
| 197 | return (LPSTR)pszPath;
|
|---|
| 198 | }
|
|---|
| 199 |
|
|---|
| 200 |
|
|---|
| 201 | /*****************************************************************************
|
|---|
| 202 | * Name : LPWSTR PathSkipRootW
|
|---|
| 203 | * Purpose : Parses a path, ignoring the drive letter or UNC server/share path parts.
|
|---|
| 204 | * Parameters: LPCWSTR pszPath
|
|---|
| 205 | * Variables :
|
|---|
| 206 | * Result : unknown
|
|---|
| 207 | * Remark : SHLWAPI.PathSkipRootW
|
|---|
| 208 | * Status : UNTESTED
|
|---|
| 209 | *
|
|---|
| 210 | * Author : Patrick Haller [Mon, 2000/01/31 23:02]
|
|---|
| 211 | *****************************************************************************/
|
|---|
| 212 |
|
|---|
| 213 | ODINFUNCTION1(LPWSTR, PathSkipRootW, LPCWSTR, pszPath)
|
|---|
| 214 | {
|
|---|
| 215 | dprintf(("not implemented"));
|
|---|
| 216 |
|
|---|
| 217 | return (LPWSTR)pszPath;
|
|---|
| 218 | }
|
|---|