Commit b1045496 authored by Guy Albertelli's avatar Guy Albertelli Committed by Alexandre Julliard

Don't try to set fields in nonexistant lpLineCountryList.

Supply valid tapi codes.
parent 7e105b49
......@@ -286,7 +286,15 @@ DWORD WINAPI lineGetCountry(DWORD dwCountryID, DWORD dwAPIVersion, LPLINECOUNTRY
DWORD dwAvailSize, dwOffset, i;
LPLINECOUNTRYENTRY lpLCE;
TRACE("(%08lx, %08lx, %p): stub.\n", dwCountryID, dwAPIVersion, lpLineCountryList);
if(!lpLineCountryList) {
TRACE("(%08lx, %08lx, %p): stub. Returning LINEERR_INVALPOINTER\n",
dwCountryID, dwAPIVersion, lpLineCountryList);
return LINEERR_INVALPOINTER;
}
TRACE("(%08lx, %08lx, %p(%ld)): stub.\n",
dwCountryID, dwAPIVersion, lpLineCountryList,
lpLineCountryList->dwTotalSize);
dwAvailSize = lpLineCountryList->dwTotalSize;
dwOffset = sizeof (LINECOUNTRYLIST);
......@@ -294,11 +302,9 @@ DWORD WINAPI lineGetCountry(DWORD dwCountryID, DWORD dwAPIVersion, LPLINECOUNTRY
if(dwAvailSize<dwOffset)
return LINEERR_STRUCTURETOOSMALL;
if(!lpLineCountryList)
return LINEERR_INVALPOINTER;
memset(lpLineCountryList, 0, dwAvailSize);
lpLineCountryList->dwTotalSize = dwAvailSize;
lpLineCountryList->dwUsedSize = dwOffset;
lpLineCountryList->dwNumCountries = 0;
lpLineCountryList->dwCountryListSize = 0;
......@@ -330,7 +336,7 @@ DWORD WINAPI lineGetCountry(DWORD dwCountryID, DWORD dwAPIVersion, LPLINECOUNTRY
lpLineCountryList->dwCountryListSize += len;
lpLineCountryList->dwUsedSize += sizeof (LINECOUNTRYENTRY); /* maybe wrong */
TRACE("Adding country %s at %p\n", TAPI_LCList[i].lpCountryName, lpLCE);
TRACE("Adding country %s at %p\n", TAPI_LCList[i].lpCountryName, &lpLCE[i]);
lpLCE[i].dwCountryID = TAPI_LCList[i].dwCountryID;
lpLCE[i].dwCountryCode = TAPI_LCList[i].dwCountryCode;
......
......@@ -19,15 +19,14 @@ typedef HANDLE HLINEAPP, *LPHLINEAPP;
typedef HANDLE HPHONE, *LPHPHONE;
typedef HANDLE HPHONEAPP, *LPHPHONEAPP;
/* FIXME: bogus codes !! */
#define TAPIERR_REQUESTFAILED 20
#define LINEERR_INCOMPATIBLEAPIVERSION 1
#define LINEERR_NOMEM 1
#define LINEERR_INIFILECORRUPT 1
#define LINEERR_OPERATIONFAILED 1
#define LINEERR_INVALCOUNTRYCODE 1
#define LINEERR_STRUCTURETOOSMALL 1
#define LINEERR_INVALPOINTER 1
#define TAPIERR_REQUESTFAILED -16L
#define LINEERR_INCOMPATIBLEAPIVERSION 0x8000000C
#define LINEERR_NOMEM 0x80000044
#define LINEERR_INIFILECORRUPT 0x8000000E
#define LINEERR_OPERATIONFAILED 0x80000048
#define LINEERR_INVALCOUNTRYCODE 0x80000022
#define LINEERR_STRUCTURETOOSMALL 0x8000004D
#define LINEERR_INVALPOINTER 0x80000035
typedef struct lineaddresscaps_tag {
DWORD dwTotalSize;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment