Back to index

lightning-sunbird  0.9+nobinonly
win32.cpp
Go to the documentation of this file.
00001 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
00002  *
00003  * ***** BEGIN LICENSE BLOCK *****
00004  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00005  *
00006  * The contents of this file are subject to the Mozilla Public License Version
00007  * 1.1 (the "License"); you may not use this file except in compliance with
00008  * the License. You may obtain a copy of the License at
00009  * http://www.mozilla.org/MPL/
00010  *
00011  * Software distributed under the License is distributed on an "AS IS" basis,
00012  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00013  * for the specific language governing rights and limitations under the
00014  * License.
00015  *
00016  * The Original Code is mozilla.org code, released
00017  * Jan 28, 20.
00018  *
00019  * The Initial Developer of the Original Code is
00020  * Netscape Communications Corporation.
00021  * Portions created by the Initial Developer are Copyright (C) 2003
00022  * the Initial Developer. All Rights Reserved.
00023  *
00024  * Contributor(s):
00025  *   Garrett Arch Blythe, 28-January-2003
00026  *
00027  * Alternatively, the contents of this file may be used under the terms of
00028  * either the GNU General Public License Version 2 or later (the "GPL"), or
00029  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00030  * in which case the provisions of the GPL or the LGPL are applicable instead
00031  * of those above. If you wish to allow use of your version of this file only
00032  * under the terms of either the GPL or the LGPL, and not to allow others to
00033  * use your version of this file under the terms of the MPL, indicate your
00034  * decision by deleting the provisions above and replace them with the notice
00035  * and other provisions required by the GPL or the LGPL. If you do not delete
00036  * the provisions above, a recipient may use your version of this file under
00037  * the terms of any one of the MPL, the GPL or the LGPL.
00038  *
00039  * ***** END LICENSE BLOCK ***** */
00040 
00041 #include "mozce_internal.h"
00042 
00043 extern "C" {
00044 #if 0
00045 }
00046 #endif
00047 
00048 #include "kfuncs.h"
00049 #include "wingdi.h"
00050 #include "Windows.h"
00051 #include "locale.h"
00052 
00053 #define wcharcount(array) (sizeof(array) / sizeof(TCHAR))
00054 
00055 
00056 MOZCE_SHUNT_API DWORD mozce_CommDlgExtendedError()
00057 {
00058     MOZCE_PRECHECK
00059 
00060 #ifdef DEBUG
00061     mozce_printf("mozce_CommDlgExtendedError called\n");
00062 #endif
00063 
00064     return -1 /*CDERR_DIALOGFAILURE*/;
00065 }
00066 
00067 
00068 MOZCE_SHUNT_API int mozce_MulDiv(int inNumber, int inNumerator, int inDenominator)
00069 {
00070     MOZCE_PRECHECK
00071 
00072 #ifdef DEBUG
00073     mozce_printf("mozce_MulDiv called\n");
00074 #endif
00075     
00076     if (inDenominator == 0)
00077         return 0;
00078 
00079     return (int)(((INT64)inNumber * (INT64)inNumerator) / (INT64)inDenominator);
00080 }
00081 
00082 
00083 MOZCE_SHUNT_API int mozce_GetDIBits(HDC inDC, HBITMAP inBMP, UINT inStartScan, UINT inScanLines, LPVOID inBits, LPBITMAPINFO inInfo, UINT inUsage)
00084 {
00085     MOZCE_PRECHECK
00086 
00087 #ifdef DEBUG
00088     mozce_printf("-- mozce_GetDIBits called\n");
00089 #endif
00090 
00091     int retval = 0;
00092 
00093     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
00094 
00095     return retval;
00096 }
00097 
00098 
00099 MOZCE_SHUNT_API int mozce_SetDIBits(HDC inDC, HBITMAP inBMP, UINT inStartScan, UINT inScanLines, CONST LPVOID inBits, CONST LPBITMAPINFO inInfo, UINT inUsage)
00100 {
00101     MOZCE_PRECHECK
00102 
00103 #ifdef DEBUG
00104     mozce_printf("-- mozce_SetDIBits called\n");
00105 #endif
00106 
00107     int retval = 0;
00108 
00109     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
00110 
00111     return retval;
00112 }
00113 
00114 
00115 MOZCE_SHUNT_API HBITMAP mozce_CreateDIBitmap(HDC inDC, CONST BITMAPINFOHEADER *inBMIH, DWORD inInit, CONST VOID *inBInit, CONST BITMAPINFO *inBMI, UINT inUsage)
00116 {
00117     MOZCE_PRECHECK
00118 
00119 #ifdef DEBUG
00120     mozce_printf("-- mozce_CreateDIBitmap called\n");
00121 #endif
00122 
00123     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
00124 
00125     return NULL;
00126 }
00127 
00128 
00129 MOZCE_SHUNT_API int mozce_SetPolyFillMode(HDC inDC, int inPolyFillMode)
00130 {
00131     MOZCE_PRECHECK
00132 
00133 #ifdef DEBUG
00134     mozce_printf("-- mozce_SetPolyFillMode called\n");
00135 #endif
00136 
00137     int retval = 0;
00138 
00139     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
00140 
00141     return retval;
00142 }
00143 
00144 
00145 MOZCE_SHUNT_API int mozce_SetStretchBltMode(HDC inDC, int inStretchMode)
00146 {
00147     MOZCE_PRECHECK
00148 
00149 #ifdef DEBUG
00150     mozce_printf("-- mozce_SetStretchBltMode called\n");
00151 #endif
00152 
00153     int retval = 0;
00154 
00155     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
00156 
00157     return retval;
00158 }
00159 
00160 
00161 MOZCE_SHUNT_API int mozce_ExtSelectClipRgn(HDC inDC, HRGN inRGN, int inMode)
00162 {
00163     MOZCE_PRECHECK
00164 
00165 #ifdef DEBUG
00166     mozce_printf("mozce_ExtSelectClipRgn called\n");
00167 #endif
00168     
00169     // inModes are defined as:
00170     // RGN_AND = 1
00171     // RGN_OR = 2
00172     // RGN_XOR = 3
00173     // RGN_DIFF = 4
00174     // RGN_COPY = 5
00175     
00176 
00177     if (inMode == RGN_COPY)
00178     {
00179         return SelectClipRgn(inDC, inRGN);
00180     }
00181 
00182     HRGN cRGN = NULL;
00183     int result = GetClipRgn(inDC, cRGN);
00184     
00185     // if there is no current clipping region, set it to the
00186     // tightest bounding rectangle that can be drawn around
00187     // the current visible area on the device
00188 
00189     if (result != 1)
00190     {
00191         RECT cRect;
00192         GetClipBox(inDC,&cRect);
00193         cRGN = CreateRectRgn(cRect.left,cRect.top,cRect.right,cRect.bottom);
00194     }
00195 
00196     // now select the proper region as the current clipping region
00197     result = SelectClipRgn(inDC,cRGN);           
00198     
00199     if (result == NULLREGION) 
00200     {
00201         if (inMode == RGN_DIFF || inMode == RGN_AND)
00202             result = SelectClipRgn(inDC,NULL);
00203         else
00204             result = SelectClipRgn(inDC,inRGN);
00205         
00206         DeleteObject(cRGN);
00207         return result;
00208     } 
00209     
00210     if (result == SIMPLEREGION || result == COMPLEXREGION)
00211     {
00212         if (inMode == RGN_DIFF)
00213             CombineRgn(cRGN, cRGN, inRGN, inMode);
00214         else
00215             CombineRgn(cRGN, inRGN, cRGN, inMode);
00216         result = SelectClipRgn(inDC,cRGN);
00217         DeleteObject(cRGN);
00218         return result;
00219     }
00220     
00221     HRGN rgn = CreateRectRgn(0, 0, 32000, 32000);
00222     result = SelectClipRgn(inDC, rgn);
00223     DeleteObject(rgn);
00224 
00225     return result;
00226 }
00227 
00228 typedef VOID CALLBACK LINEDDAPROC(
00229   int X,          // x-coordinate of point
00230   int Y,          // y-coordinate of point
00231   LPARAM lpData   // application-defined data
00232 );
00233 
00234 MOZCE_SHUNT_API BOOL mozce_LineDDA(int inXStart, int inYStart, int inXEnd, int inYEnd, LINEDDAPROC inLineFunc, LPARAM inData)
00235 {
00236     MOZCE_PRECHECK
00237 
00238 #ifdef DEBUG
00239     mozce_printf("-- mozce_LineDDA called\n");
00240 #endif
00241 
00242     BOOL retval = FALSE;
00243 
00244     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
00245 
00246     return retval;
00247 }
00248 
00249 
00250 MOZCE_SHUNT_API int mozce_FrameRect(HDC inDC, CONST RECT *inRect, HBRUSH inBrush)
00251 {
00252     MOZCE_PRECHECK
00253 
00254 #ifdef DEBUG
00255     mozce_printf("mozce_FrameRect called\n");
00256 #endif
00257 
00258     HBRUSH oldBrush = (HBRUSH)SelectObject(inDC, inBrush);
00259     RECT myRect = *inRect;
00260     InflateRect(&myRect, 1, 1); // The width and height of
00261                                 // the border are always one
00262                                 // logical unit.
00263     
00264     // 1  ---->   2
00265     //            
00266     //            |
00267     //            v
00268     //
00269     // 4  ---->   3 
00270 
00271     MoveToEx(inDC, myRect.left, myRect.top, (LPPOINT) NULL); 
00272 
00273     // 1 -> 2
00274     LineTo(inDC, myRect.right, myRect.top); 
00275     
00276     // 2 -> 3
00277     LineTo(inDC, myRect.right, myRect.bottom); 
00278 
00279     // 3 -> 4
00280     LineTo(inDC, myRect.left, myRect.bottom); 
00281 
00282     SelectObject(inDC, oldBrush);
00283 
00284     return 1;
00285 }
00286 
00287 
00288 MOZCE_SHUNT_API int mozce_SetArcDirection(HDC inDC, int inArcDirection)
00289 {
00290     MOZCE_PRECHECK
00291 
00292 #ifdef DEBUG
00293     mozce_printf("-- mozce_SetArcDirection called\n");
00294 #endif
00295 
00296     int retval = 0;
00297 
00298     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
00299 
00300     return retval;
00301 }
00302 
00303 
00304 MOZCE_SHUNT_API BOOL mozce_Arc(HDC inDC, int inLeftRect, int inTopRect, int inRightRect, int inBottomRect, int inXStartArc, int inYStartArc, int inXEndArc, int inYEndArc)
00305 {
00306     MOZCE_PRECHECK
00307 
00308 #ifdef DEBUG
00309     mozce_printf("-- mozce_Arc called\n");
00310 #endif
00311 
00312     BOOL retval = FALSE;
00313 
00314     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
00315 
00316     return retval;
00317 }
00318 
00319 
00320 MOZCE_SHUNT_API BOOL mozce_Pie(HDC inDC, int inLeftRect, int inTopRect, int inRightRect, int inBottomRect, int inXRadial1, int inYRadial1, int inXRadial2, int inYRadial2)
00321 {
00322     MOZCE_PRECHECK
00323 
00324 #ifdef DEBUG
00325     mozce_printf("-- mozce_Pie called\n");
00326 #endif
00327 
00328     BOOL retval = FALSE;
00329 
00330     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
00331 
00332     return retval;
00333 }
00334 
00335 
00336 MOZCE_SHUNT_API DWORD mozce_GetFontData(HDC inDC, DWORD inTable, DWORD inOffset, LPVOID outBuffer, DWORD inData)
00337 {
00338     MOZCE_PRECHECK
00339 
00340 #ifdef DEBUG
00341     mozce_printf("-- mozce_GetFontData called\n");
00342 #endif
00343 
00344     DWORD retval = GDI_ERROR;
00345     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
00346 
00347     return retval;
00348 }
00349 
00350 
00351 MOZCE_SHUNT_API UINT mozce_GetTextCharset(HDC inDC)
00352 {
00353     MOZCE_PRECHECK
00354 
00355 #ifdef DEBUG
00356     mozce_printf("mozce_GetTextCharset called\n");
00357 #endif
00358 
00359     UINT retval = DEFAULT_CHARSET;
00360 
00361     TEXTMETRIC tm;
00362     if(GetTextMetrics(inDC, &tm))
00363     {
00364         retval = tm.tmCharSet;
00365     }
00366 
00367     return retval;
00368 }
00369 
00370 
00371 MOZCE_SHUNT_API UINT mozce_GetTextCharsetInfo(HDC inDC, LPFONTSIGNATURE outSig, DWORD inFlags)
00372 {
00373     MOZCE_PRECHECK
00374 
00375 #ifdef DEBUG
00376     mozce_printf("mozce_GetTextCharsetInfo called\n");
00377 #endif
00378 
00379     // Zero out the FONTSIGNATURE as we do not know how to fill it out properly.
00380     if(NULL != outSig)
00381     {
00382         memset(outSig, 0, sizeof(FONTSIGNATURE));
00383     }
00384 
00385     return mozce_GetTextCharset(inDC);
00386 }
00387 
00388 
00389 MOZCE_SHUNT_API UINT mozce_GetOutlineTextMetrics(HDC inDC, UINT inData, void* outOTM)
00390 {
00391     MOZCE_PRECHECK
00392 
00393 #ifdef DEBUG
00394     mozce_printf("-- mozce_GetOutlineTextMetrics called.\n");
00395 #endif
00396 
00397     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
00398     return 0;
00399 }
00400 
00401 
00402 #define FACENAME_MAX 128
00403 typedef struct __struct_CollectFaces
00404 {
00405     UINT    mCount;
00406     LPTSTR  mNames[FACENAME_MAX];
00407 }
00408 CollectFaces;
00409 
00410 static int CALLBACK collectProc(CONST LOGFONT* inLF, CONST TEXTMETRIC* inTM, DWORD inFontType, LPARAM inParam)
00411 {
00412     int retval = 0;
00413     CollectFaces* collection = (CollectFaces*)inParam;
00414 
00415     if(FACENAME_MAX > collection->mCount)
00416     {
00417         retval = 1;
00418 
00419         collection->mNames[collection->mCount] = _tcsdup(inLF->lfFaceName);
00420         if(NULL != collection->mNames[collection->mCount])
00421         {
00422             collection->mCount++;
00423         }
00424     }
00425 
00426     return retval;
00427 }
00428 
00429 MOZCE_SHUNT_API int mozce_EnumFontFamiliesEx(HDC inDC, const LOGFONTA* inLogfont, FONTENUMPROC inFunc, LPARAM inParam, DWORD inFlags)
00430 {
00431     MOZCE_PRECHECK
00432 
00433 #ifdef DEBUG
00434     mozce_printf("mozce_EnumFontFamiliesEx called\n");
00435 #endif
00436 
00437     int retval = 0;
00438 
00439     //  We support only one case.
00440     //  Callback should be oldstyle EnumFonts.
00441     if(DEFAULT_CHARSET != inLogfont->lfCharSet)
00442     {
00443 #ifdef DEBUG
00444         mozce_printf("mozce_EnumFontFamiliesEx failed\n");
00445 #endif
00446         SetLastError(ERROR_NOT_SUPPORTED);
00447         return retval;
00448     }
00449      
00450     CollectFaces collection;
00451     collection.mCount = 0;
00452     
00453     EnumFonts(inDC, NULL, collectProc, (LPARAM)&collection);
00454     
00455     UINT loop;
00456     for(loop = 0; loop < collection.mCount; loop++)
00457     {
00458         retval = EnumFonts(inDC, collection.mNames[loop], inFunc, inParam);
00459     }
00460     
00461     for(loop = 0; loop < collection.mCount; loop++)
00462     {
00463         free(collection.mNames[loop]);
00464     }
00465 
00466     return retval;
00467 }
00468 
00469 MOZCE_SHUNT_API int mozce_GetMapMode(HDC inDC)
00470 {
00471     MOZCE_PRECHECK
00472 
00473 #ifdef DEBUG
00474     mozce_printf("mozce_GetMapMode called\n");
00475 #endif
00476 
00477     int retval = MM_TEXT;
00478     return retval;
00479 }
00480 
00481 
00482 MOZCE_SHUNT_API BOOL mozce_GetIconInfo(HICON inIcon, PICONINFO outIconinfo)
00483 {
00484     MOZCE_PRECHECK
00485 
00486 #ifdef DEBUG
00487     mozce_printf("-- mozce_GetIconInfo called\n");
00488 #endif
00489 
00490     BOOL retval = FALSE;
00491 
00492     if(NULL != outIconinfo)
00493     {
00494         memset(outIconinfo, 0, sizeof(ICONINFO));
00495     }
00496 
00497     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
00498 
00499     return retval;
00500 }
00501 
00502 
00503 MOZCE_SHUNT_API BOOL mozce_LPtoDP(HDC inDC, LPPOINT inoutPoints, int inCount)
00504 {
00505     MOZCE_PRECHECK
00506 
00507 #ifdef DEBUG
00508     mozce_printf("-- mozce_LPtoDP called\n");
00509 #endif
00510 
00511     BOOL retval = TRUE;
00512 
00513     return retval;
00514 }
00515 
00516 
00517 MOZCE_SHUNT_API LONG mozce_RegCreateKey(HKEY inKey, LPCTSTR inSubKey, PHKEY outResult)
00518 {
00519     MOZCE_PRECHECK
00520 
00521 #ifdef DEBUG
00522     mozce_printf("mozce_RegCreateKey called\n");
00523 #endif
00524 
00525     LONG retval = ERROR_SUCCESS;
00526     DWORD disp = 0;
00527 
00528     retval = RegCreateKeyEx(inKey, inSubKey, 0, NULL, 0, 0, NULL, outResult, &disp);
00529 
00530     return retval;
00531 }
00532 
00533 
00534 MOZCE_SHUNT_API BOOL mozce_WaitMessage(VOID)
00535 {
00536     MOZCE_PRECHECK
00537 
00538 #ifdef DEBUG
00539     mozce_printf("mozce_WaitMessage called\n");
00540 #endif
00541 
00542     BOOL retval = TRUE;
00543 
00544     HANDLE hThread = GetCurrentThread();
00545     DWORD waitRes = MsgWaitForMultipleObjectsEx(1, &hThread, INFINITE, QS_ALLEVENTS, 0);
00546     if((DWORD)-1 == waitRes)
00547     {
00548         retval = FALSE;
00549     }
00550 
00551     return retval;
00552 }
00553 
00554 
00555 MOZCE_SHUNT_API BOOL mozce_FlashWindow(HWND inWnd, BOOL inInvert)
00556 {
00557     MOZCE_PRECHECK
00558 
00559 #ifdef DEBUG
00560     mozce_printf("-- mozce_FlashWindow called\n");
00561 #endif
00562 
00563     BOOL retval = FALSE;
00564 
00565     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
00566 
00567     return retval;
00568 }
00569 
00570 
00571 typedef struct ECWWindows
00572 {
00573     LPARAM      params;
00574     WNDENUMPROC func;
00575     HWND        parent;
00576 } ECWWindows;
00577 
00578 static BOOL CALLBACK MyEnumWindowsProc(HWND hwnd, LPARAM lParam)
00579 {
00580     ECWWindows *myParams = (ECWWindows*) lParam;
00581 
00582     if (IsChild(myParams->parent, hwnd))
00583     {
00584         return myParams->func(hwnd, myParams->params);
00585     }
00586 
00587     return TRUE;
00588 }
00589 
00590 MOZCE_SHUNT_API BOOL mozce_EnumChildWindows(HWND inParent, WNDENUMPROC inFunc, LPARAM inParam)
00591 {
00592     MOZCE_PRECHECK
00593 
00594 #ifdef DEBUG
00595     mozce_printf("mozce_EnumChildWindows called\n");
00596 #endif
00597 
00598     ECWWindows myParams;
00599     myParams.params = inParam;
00600     myParams.func   = inFunc;
00601     myParams.parent = inParent;
00602 
00603     return EnumWindows(MyEnumWindowsProc, (LPARAM) &myParams);
00604 }
00605 
00606 
00607 MOZCE_SHUNT_API BOOL mozce_EnumThreadWindows(DWORD inThreadID, WNDENUMPROC inFunc, LPARAM inParam)
00608 {
00609     MOZCE_PRECHECK
00610 
00611 #ifdef DEBUG
00612     mozce_printf("-- mozce_EnumThreadWindows called\n");
00613 #endif
00614     return FALSE; // Stop Enumerating
00615 }
00616 
00617 
00618 MOZCE_SHUNT_API BOOL mozce_IsIconic(HWND inWnd)
00619 {
00620     MOZCE_PRECHECK
00621 
00622 #ifdef DEBUG
00623     mozce_printf("mozce_IsIconic called\n");
00624 #endif
00625 
00626     BOOL retval = FALSE;
00627     return retval;
00628 }
00629 
00630 
00631 MOZCE_SHUNT_API BOOL mozce_OpenIcon(HWND inWnd)
00632 {
00633     MOZCE_PRECHECK
00634 
00635 #ifdef DEBUG
00636     mozce_printf("mozce_OpenIcon called\n");
00637 #endif
00638     return SetActiveWindow(inWnd) ? 1:0;
00639 }
00640 
00641 
00642 MOZCE_SHUNT_API HHOOK mozce_SetWindowsHookEx(int inType, void* inFunc, HINSTANCE inMod, DWORD inThreadId)
00643 {
00644     MOZCE_PRECHECK
00645 
00646 #ifdef DEBUG
00647     mozce_printf("-- mozce_SetWindowsHookEx called\n");
00648 #endif
00649 
00650     HHOOK retval = NULL;
00651 
00652     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
00653 
00654     return retval;
00655 }
00656 
00657 
00658 MOZCE_SHUNT_API BOOL mozce_UnhookWindowsHookEx(HHOOK inHook)
00659 {
00660     MOZCE_PRECHECK
00661 
00662 #ifdef DEBUG
00663     mozce_printf("-- mozce_UnhookWindowsHookEx called\n");
00664 #endif
00665 
00666     BOOL retval = FALSE;
00667 
00668     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
00669 
00670     return retval;
00671 }
00672 
00673 
00674 MOZCE_SHUNT_API LRESULT mozce_CallNextHookEx(HHOOK inHook, int inCode, WPARAM wParam, LPARAM lParam)
00675 {
00676     MOZCE_PRECHECK
00677 
00678 #ifdef DEBUG
00679     mozce_printf("-- mozce_CallNextHookEx called\n");
00680 #endif
00681 
00682     LRESULT retval = NULL;
00683 
00684     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
00685 
00686     return retval;
00687 }
00688 
00689 
00690 MOZCE_SHUNT_API BOOL mozce_InvertRgn(HDC inDC, HRGN inRGN)
00691 {
00692     MOZCE_PRECHECK
00693 
00694 #ifdef DEBUG
00695     mozce_printf("-- mozce_InvertRgn called\n");
00696 #endif
00697 
00698     BOOL retval = FALSE;
00699 
00700     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
00701 
00702     return retval;
00703 }
00704 
00705 
00706 MOZCE_SHUNT_API int mozce_GetScrollPos(HWND inWnd, int inBar)
00707 {
00708     MOZCE_PRECHECK
00709 
00710 #ifdef DEBUG
00711     mozce_printf("mozce_GetScrollPos called\n");
00712 #endif
00713 
00714     int retval = 0;
00715     SCROLLINFO info;
00716 
00717     if(GetScrollInfo(inWnd, inBar, &info))
00718     {
00719         return info.nPos;
00720     }
00721 
00722     return retval;
00723 }
00724 
00725 
00726 MOZCE_SHUNT_API BOOL mozce_GetScrollRange(HWND inWnd, int inBar, LPINT outMinPos, LPINT outMaxPos)
00727 {
00728     MOZCE_PRECHECK
00729 
00730 #ifdef DEBUG
00731     mozce_printf("mozce_GetScrollRange called\n");
00732 #endif
00733 
00734     BOOL retval = FALSE;
00735     SCROLLINFO info;
00736 
00737     if((retval = GetScrollInfo(inWnd, inBar, &info)))
00738     {
00739         if(NULL != outMinPos)
00740         {
00741             *outMinPos = info.nMin;
00742         }
00743         if(NULL != outMaxPos)
00744         {
00745             *outMaxPos = info.nMax;
00746         }
00747     }
00748 
00749     return retval;
00750 }
00751 
00752 
00753 MOZCE_SHUNT_API HRESULT mozce_CoLockObjectExternal(IUnknown* inUnk, BOOL inLock, BOOL inLastUnlockReleases)
00754 {
00755     MOZCE_PRECHECK
00756 
00757 #ifdef DEBUG
00758     mozce_printf("mozce_CoLockObjectExternal called\n");
00759 #endif
00760 
00761     HRESULT retval = S_OK;
00762 
00763     if(NULL != inUnk)
00764     {
00765         if(FALSE == inLock)
00766         {
00767             inUnk->Release();
00768         }
00769         else
00770         {
00771             inUnk->AddRef();
00772         }
00773     }
00774     else
00775     {
00776         retval = E_INVALIDARG;
00777     }
00778 
00779     return retval;
00780 }
00781 
00782 MOZCE_SHUNT_API HRESULT mozce_CoInitialize(LPVOID pvReserved)
00783 {
00784     MOZCE_PRECHECK
00785 
00786 #ifdef DEBUG
00787     mozce_printf("-- mozce_Conitialize called\n");
00788 #endif
00789 
00790     CoInitializeEx(NULL, COINIT_MULTITHREADED);
00791     return S_OK;
00792 
00793 }
00794 
00795 MOZCE_SHUNT_API LRESULT mozce_OleInitialize(LPVOID pvReserved)
00796 {
00797     MOZCE_PRECHECK
00798 
00799 #ifdef DEBUG
00800     mozce_printf("-- mozce_OleInitialize called\n");
00801 #endif
00802 
00803     return S_OK;
00804 }
00805 
00806 MOZCE_SHUNT_API void mozce_OleUninitialize()
00807 {
00808     MOZCE_PRECHECK
00809 
00810 #ifdef DEBUG
00811     mozce_printf("-- mozce_OleUninitialize called\n");
00812 #endif
00813 }
00814 
00815 MOZCE_SHUNT_API HRESULT mozce_OleQueryLinkFromData(IDataObject* inSrcDataObject)
00816 {
00817     MOZCE_PRECHECK
00818 
00819 #ifdef DEBUG
00820     mozce_printf("-- mozce_OleQueryLinkFromData called\n");
00821 #endif
00822 
00823     HRESULT retval = E_NOTIMPL;
00824 
00825     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
00826 
00827     return retval;
00828 }
00829 
00830 //LPITEMIDLIST
00831 MOZCE_SHUNT_API void* mozce_SHBrowseForFolder(void* /*LPBROWSEINFOS*/ inBI)
00832 {
00833     MOZCE_PRECHECK
00834 
00835 #ifdef DEBUG
00836     mozce_printf("-- mozce_SHBrowseForFolder called\n");
00837 #endif
00838 
00839     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
00840     return NULL;
00841 }
00842 
00843 
00844 MOZCE_SHUNT_API BOOL mozce_SetMenu(HWND inWnd, HMENU inMenu)
00845 {
00846     MOZCE_PRECHECK
00847 
00848 #ifdef DEBUG
00849     mozce_printf("-- mozce_SetMenu called\n");
00850 #endif
00851     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
00852     return FALSE;
00853 }
00854 
00855 
00856 MOZCE_SHUNT_API BOOL mozce_GetUserName(LPTSTR inBuffer, LPDWORD inoutSize)
00857 {
00858     MOZCE_PRECHECK
00859 
00860 #ifdef DEBUG
00861     mozce_printf("-- mozce_GetUserName called\n");
00862 #endif
00863 
00864     BOOL retval = FALSE;
00865 
00866     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
00867     *inoutSize = 0;
00868 
00869     return retval;
00870 }
00871 
00872 
00873 MOZCE_SHUNT_API DWORD mozce_GetShortPathName(LPCSTR inLongPath, LPSTR outShortPath, DWORD inBufferSize)
00874 {
00875     MOZCE_PRECHECK
00876         
00877 #ifdef DEBUG
00878    mozce_printf("mozce_GetShortPathName called\n");
00879 #endif
00880     
00881     DWORD retval = strlen(inLongPath);
00882     strncpy(outShortPath, inLongPath, inBufferSize);
00883     return ((retval > inBufferSize) ? inBufferSize : retval);
00884 }
00885 
00886 MOZCE_SHUNT_API DWORD mozce_GetShortPathNameW(LPCWSTR inLongPath, LPWSTR outShortPath, DWORD inBufferSize)
00887 {
00888     MOZCE_PRECHECK
00889         
00890 #ifdef DEBUG
00891    mozce_printf("mozce_GetShortPathNameW called\n");
00892 #endif
00893     
00894     DWORD retval = wcslen(inLongPath);
00895     wcsncpy(outShortPath, inLongPath, inBufferSize);
00896     return ((retval > inBufferSize) ? inBufferSize : retval);
00897 }
00898 
00899 MOZCE_SHUNT_API DWORD mozce_GetEnvironmentVariable(LPCSTR lpName, LPCSTR lpBuffer, DWORD nSize)
00900 {
00901     MOZCE_PRECHECK
00902 
00903 #ifdef DEBUG
00904     mozce_printf("-- mozce_GetEnvironmentVariable called\n");
00905 #endif
00906 
00907     DWORD retval = 0;
00908 
00909     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
00910 
00911     return retval;
00912 }
00913 
00914 MOZCE_SHUNT_API DWORD mozce_GetEnvironmentVariableW(LPCWSTR lpName, LPWSTR lpBuffer, DWORD nSize)
00915 {
00916     MOZCE_PRECHECK
00917 
00918 #ifdef DEBUG
00919     mozce_printf("-- mozce_GetEnvironmentVariableW called\n");
00920 #endif
00921 
00922     DWORD retval = 0;
00923 
00924     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
00925 
00926     return retval;
00927 }
00928 
00929 MOZCE_SHUNT_API void mozce_GetSystemTimeAsFileTime(LPFILETIME lpSystemTimeAsFileTime)
00930 {
00931     MOZCE_PRECHECK
00932 
00933 #ifdef DEBUG
00934     mozce_printf("mozce_GetSystemTimeAsFileTime called\n");
00935 #endif
00936 
00937     SYSTEMTIME st;
00938     GetSystemTime(&st);
00939     SystemTimeToFileTime(&st,lpSystemTimeAsFileTime);
00940 }
00941 
00942 #ifndef MIN
00943 #define MIN(a,b) (((a)<(b)) ? (a) : (b))
00944 #endif
00945 
00946 
00947 #ifndef MAX
00948 #define MAX(a,b) (((a)>(b)) ? (a) : (b))
00949 #endif
00950 
00951 MOZCE_SHUNT_API DWORD mozce_GetFullPathName(const char* lpFileName, 
00952                                             DWORD nBufferLength, 
00953                                             const char* lpBuffer, 
00954                                             const char** lpFilePart)
00955 {
00956 #ifdef DEBUG
00957     mozce_printf("mozce_GetFullPathName called\n");
00958 #endif
00959 
00960     DWORD len = strlen(lpFileName);
00961     if (len > nBufferLength)
00962         return len;
00963     
00964     strncpy((char*)lpBuffer, lpFileName, len);
00965     ((char*)lpBuffer)[len] = '\0';
00966     
00967     if(lpFilePart)
00968     {
00969         char* sep = strrchr(lpBuffer, '\\');
00970         if (sep) {
00971             sep++; // pass the seperator
00972             *lpFilePart = sep;
00973         }
00974         else
00975             *lpFilePart = lpBuffer;
00976     }
00977     
00978 #ifdef DEBUG
00979     mozce_printf("mozce_GetFullPathName called %s (%s)\n", lpBuffer, *lpFilePart);
00980 #endif
00981     return len;      
00982 }
00983 
00984 static LONG gGetMessageTime = 0;
00985 
00986 MOZCE_SHUNT_API BOOL mozce_GetMessage(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax )
00987 {
00988     MOZCE_PRECHECK
00989 
00990 #ifdef DEBUG
00991     mozce_printf("mozce_GetMessage called\n");
00992 #endif
00993 
00994     BOOL b = GetMessage(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMin);
00995 
00996     if (b)
00997         gGetMessageTime = lpMsg->time;
00998 
00999     return b;
01000 }
01001 
01002 
01003 MOZCE_SHUNT_API BOOL mozce_PeekMessage(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg)
01004 {
01005     MOZCE_PRECHECK
01006 
01007 #ifdef LOUD_PEEKMESSAGE
01008 #ifdef DEBUG
01009     mozce_printf("mozce_PeekMessageA called\n");
01010 #endif
01011 #endif
01012 
01013     BOOL b = PeekMessageW(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg);
01014     
01015     if (b && wRemoveMsg == PM_REMOVE)
01016         gGetMessageTime = lpMsg->time; 
01017     
01018     return b;
01019 }
01020 
01021 
01022 MOZCE_SHUNT_API LONG mozce_GetMessageTime(void)
01023 {
01024     MOZCE_PRECHECK
01025 
01026 #ifdef DEBUG
01027     mozce_printf("mozce_GetMessageTime called\n");
01028 #endif
01029 
01030   return gGetMessageTime;
01031 }
01032 
01033 MOZCE_SHUNT_API UINT mozce_GetACP(void)
01034 {
01035     MOZCE_PRECHECK
01036 
01037 #ifdef DEBUG
01038     mozce_printf("mozce_GetACP called\n");
01039 #endif
01040 
01041     return GetACP();
01042 }
01043 
01044 
01045 
01046 MOZCE_SHUNT_API DWORD mozce_ExpandEnvironmentStrings(LPCTSTR lpSrc, LPTSTR lpDst, DWORD nSize)
01047 {
01048     MOZCE_PRECHECK
01049 
01050 #ifdef DEBUG
01051     mozce_printf("mozce_ExpandEnvironmentStrings called\n");
01052 #endif
01053 
01054     return 0;
01055 }
01056 
01057 MOZCE_SHUNT_API DWORD mozce_ExpandEnvironmentStringsW(const unsigned short* lpSrc, const unsigned short* lpDst, DWORD nSize)
01058 {
01059     MOZCE_PRECHECK
01060 
01061 #ifdef DEBUG
01062     mozce_printf("mozce_ExpandEnvironmentStrings called\n");
01063 #endif
01064 
01065     return 0;
01066 }
01067 
01068 MOZCE_SHUNT_API BOOL mozce_GdiFlush(void)
01069 {
01070     MOZCE_PRECHECK
01071 
01072     return TRUE;
01073 }
01074 
01075 MOZCE_SHUNT_API BOOL mozce_GetWindowPlacement(HWND hWnd, WINDOWPLACEMENT *lpwndpl)
01076 {
01077    MOZCE_PRECHECK
01078 
01079 #ifdef DEBUG
01080     mozce_printf("mozce_GetWindowPlacement called\n");
01081 #endif
01082 
01083    memset(lpwndpl, 0, sizeof(WINDOWPLACEMENT));
01084    
01085    // This is wrong when the window is minimized.
01086    lpwndpl->showCmd = SW_SHOWNORMAL;
01087    GetWindowRect(hWnd, &lpwndpl->rcNormalPosition);
01088    
01089    return TRUE;
01090 }
01091 
01092 MOZCE_SHUNT_API HINSTANCE mozce_ShellExecute(HWND hwnd, 
01093                                              LPCSTR lpOperation, 
01094                                              LPCSTR lpFile, 
01095                                              LPCSTR lpParameters, 
01096                                              LPCSTR lpDirectory, 
01097                                              INT nShowCmd)
01098 {
01099     
01100     LPTSTR op   = a2w_malloc(lpOperation, -1, NULL);
01101     LPTSTR file = a2w_malloc(lpFile, -1, NULL);
01102     LPTSTR parm = a2w_malloc(lpParameters, -1, NULL);
01103     LPTSTR dir  = a2w_malloc(lpDirectory, -1, NULL);
01104     
01105     SHELLEXECUTEINFO info;
01106     info.cbSize = sizeof(SHELLEXECUTEINFO);
01107     info.fMask  = SEE_MASK_NOCLOSEPROCESS;
01108     info.hwnd   = hwnd;
01109     info.lpVerb = op;
01110     info.lpFile = file;
01111     info.lpParameters = parm;
01112     info.lpDirectory  = dir;
01113     info.nShow  = nShowCmd;
01114     
01115     BOOL b = ShellExecuteEx(&info);
01116     
01117     if (op)
01118         free(op);
01119     if (file)
01120         free(file);
01121     if (parm)
01122         free(parm);
01123     if (dir)
01124         free(dir);
01125     
01126     return (HINSTANCE) info.hProcess;
01127 }
01128 
01129 MOZCE_SHUNT_API HINSTANCE mozce_ShellExecuteW(HWND hwnd, LPCWSTR lpOperation, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
01130 {
01131    MOZCE_PRECHECK
01132 
01133 #ifdef DEBUG
01134     mozce_printf("mozce_ShellExecuteW called\n");
01135 #endif
01136 
01137     SHELLEXECUTEINFO info;
01138     info.cbSize = sizeof(SHELLEXECUTEINFO);
01139     info.fMask  = SEE_MASK_NOCLOSEPROCESS;
01140     info.hwnd   = hwnd;
01141     info.lpVerb = lpOperation;
01142     info.lpFile = lpFile;
01143     info.lpParameters = lpParameters;
01144     info.lpDirectory  = lpDirectory;
01145     info.nShow  = nShowCmd;
01146     
01147     BOOL b = ShellExecuteEx(&info);
01148 
01149     return (HINSTANCE) info.hProcess;
01150 }
01151 
01152 struct lconv s_locale_conv =
01153 {
01154     ".",   /* decimal_point */
01155     ",",   /* thousands_sep */
01156     "333", /* grouping */
01157     "$",   /* int_curr_symbol */
01158     "$",   /* currency_symbol */
01159     "",    /* mon_decimal_point */
01160     "",    /* mon_thousands_sep */
01161     "",    /* mon_grouping */
01162     "+",   /* positive_sign */
01163     "-",   /* negative_sign */
01164     '2',   /* int_frac_digits */
01165     '2',   /* frac_digits */
01166     1,     /* p_cs_precedes */
01167     1,     /* p_sep_by_space */
01168     1,     /* n_cs_precedes */
01169     1,     /* n_sep_by_space */
01170     1,     /* p_sign_posn */
01171     1,     /* n_sign_posn */
01172 };
01173 
01174 
01175 
01176 MOZCE_SHUNT_API struct lconv * mozce_localeconv(void)
01177 {
01178     MOZCE_PRECHECK
01179 
01180 #ifdef DEBUG
01181     mozce_printf("mozce_localeconv called\n");
01182 #endif
01183     return &s_locale_conv;
01184 }
01185 
01186 MOZCE_SHUNT_API BOOL mozce_CreatePipe(PHANDLE hReadPipe, PHANDLE hWritePipe, LPSECURITY_ATTRIBUTES lpPipeAttributes, DWORD nSize)
01187 {
01188     MOZCE_PRECHECK
01189 
01190 #ifdef DEBUG
01191     mozce_printf("-- mozce_CreatePipe called\n");
01192 #endif
01193     return FALSE;
01194 }
01195 
01196 MOZCE_SHUNT_API DWORD_PTR mozce_SetThreadAffinityMask(HANDLE hThread, DWORD_PTR dwThreadAffinityMask)
01197 {
01198     MOZCE_PRECHECK
01199 
01200 #ifdef DEBUG
01201     mozce_printf("-- mozce_SetThreadAffinityMask called\n");
01202 #endif
01203     return 0;
01204 }
01205 
01206 MOZCE_SHUNT_API BOOL mozce_GetProcessAffinityMask(HANDLE hProcess, PDWORD_PTR lpProcessAffinityMask, PDWORD_PTR lpSystemAffinityMask)
01207 {
01208     MOZCE_PRECHECK
01209 
01210 #ifdef DEBUG
01211     mozce_printf("-- mozce_GetProcessAffinityMask called\n");
01212 #endif
01213     return FALSE;
01214 }
01215 
01216 
01217 MOZCE_SHUNT_API HANDLE mozce_OpenFileMapping(DWORD dwDesiredAccess, BOOL bInheritHandle, LPCTSTR lpName)
01218 {
01219     MOZCE_PRECHECK
01220 
01221 #ifdef DEBUG
01222     mozce_printf("-- mozce_OpenFileMapping called\n");
01223 #endif
01224     return 0;
01225 }
01226 
01227 MOZCE_SHUNT_API UINT mozce_GetDriveType(const char* lpRootPathName)
01228 {
01229     MOZCE_PRECHECK
01230 
01231 #ifdef DEBUG
01232     mozce_printf("-- mozce_GetDriveType called\n");
01233 #endif
01234 
01235     return 0;
01236 }
01237 
01238 
01239 
01240 MOZCE_SHUNT_API BOOL mozce_AlphaBlend(
01241                                       HDC hdcDest,                 // handle to destination DC
01242                                       int nXOriginDest,            // x-coord of upper-left corner
01243                                       int nYOriginDest,            // y-coord of upper-left corner
01244                                       int nWidthDest,              // destination width
01245                                       int nHeightDest,             // destination height
01246                                       HDC hdcSrc,                  // handle to source DC
01247                                       int nXOriginSrc,             // x-coord of upper-left corner
01248                                       int nYOriginSrc,             // y-coord of upper-left corner
01249                                       int nWidthSrc,               // source width
01250                                       int nHeightSrc,              // source height
01251                                       BLENDFUNCTION blendFunction  // alpha-blending function
01252                                       ){
01253     DWORD SCA = blendFunction.SourceConstantAlpha;
01254     int w = MIN(nWidthSrc,nWidthDest);
01255     int h = MIN(nHeightSrc, nHeightDest);
01256     for ( int x = 0; x<= w; x++){
01257         for( int y = 0; y<=h; y++){
01258             COLORREF dc = GetPixel(hdcDest, nXOriginDest+x, nYOriginDest+y);
01259             COLORREF sc = GetPixel(hdcSrc,  nXOriginSrc+x,  nYOriginSrc+y);
01260             color Src,Dst;
01261             Src.Red = GetRValue(sc);
01262             Dst.Red = GetRValue(dc);
01263             Src.Green = GetGValue(sc);
01264             Dst.Green = GetGValue(dc);
01265             Src.Blue = GetBValue(sc);
01266             Dst.Blue = GetBValue(dc);
01267             
01268             Src.Alpha = 1.0 - (double)((sc >> 24)/255.0);
01269             Dst.Alpha = 1.0 - (double)((dc >> 24)/255.0);
01270             
01271             //Src.Alpha = 1.0;//(double)((sc >> 24)/255.0);
01272             //Dst.Alpha = 1.0;//(double)((dc >> 24)/255.0);
01273             
01274             
01275             if(blendFunction.AlphaFormat & AC_SRC_ALPHA){
01276                 Dst.Red     = (unsigned char)(Src.Red * (SCA/255.0)   + Dst.Red * (1.0 - (SCA/255.0)));
01277                 Dst.Green   = (unsigned char)(Src.Green * (SCA/255.0)        + Dst.Green * (1.0 - (SCA/255.0)));
01278                 Dst.Blue    = (unsigned char)(Src.Blue * (SCA/255.0)  + Dst.Blue * (1.0 - (SCA/255.0)));
01279                 Dst.Alpha   = MAX(0,MIN(1,Src.Alpha * (SCA/255.0)     + Dst.Alpha * (1.0 - (SCA/255.0))));
01280             }else if(SCA == 0xff){
01281                 Dst.Red     = (unsigned char)(Src.Alpha*Src.Red       + (1 - Src.Alpha) * Dst.Red);
01282                 Dst.Green   = (unsigned char)(Src.Alpha*Src.Green     + (1 - Src.Alpha) * Dst.Green);
01283                 Dst.Blue    = (unsigned char)(Src.Alpha*Src.Blue      + (1 - Src.Alpha) * Dst.Blue);
01284                 Dst.Alpha   = MAX(0,MIN(1,Src.Alpha     + (1 - Src.Alpha) * Dst.Alpha));
01285             }else{
01286                 Src.Red     = (unsigned char)(Src.Red   * SCA / 255.0);
01287                 Src.Green   = (unsigned char)(Src.Green        * SCA / 255.0);
01288                 Src.Blue    = (unsigned char)(Src.Blue  * SCA / 255.0);
01289                 Src.Alpha   = MAX(0,MIN(1,Src.Alpha     * SCA / 255.0));
01290                 double t = (Src.Red       + (1 - Src.Alpha) * Dst.Red);
01291                 Dst.Red     = (unsigned char)(t>255?255:t);
01292                 t = (Src.Green     + (1 - Src.Alpha) * Dst.Green);
01293                 Dst.Green   = (unsigned char)(t>255?255:t);
01294                 t = (Src.Blue      + (1 - Src.Alpha) * Dst.Blue);
01295                 Dst.Blue    = (unsigned char)(t>255?255:t);
01296                 Dst.Alpha   = MAX(0,MIN(1,Src.Alpha     + (1 - Src.Alpha) * Dst.Alpha));
01297             }
01298             SetPixel(hdcDest,nXOriginDest+x, nYOriginDest+y, RGB(Dst.Red,Dst.Green,Dst.Blue));
01299             
01300             //(((unsigned char)(Dst.Alpha*255) & 0xff) << 24)|
01301         }
01302     }
01303     
01304     
01305     return true;
01306     
01307 }
01308 
01309 
01310 MOZCE_SHUNT_API BOOL mozce_SetHandleInformation(HANDLE hObject, DWORD dwMask, DWORD dwFlags)
01311 {
01312     MOZCE_PRECHECK
01313 
01314 #ifdef DEBUG
01315     mozce_printf("-- mozce_SetHandleInformation called\n");
01316 #endif
01317 
01318     int retval = 0;
01319 
01320     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
01321 
01322     return retval;
01323 }
01324 
01325 MOZCE_SHUNT_API BOOL mozce_GetHandleInformation(HANDLE hObject, LPDWORD lpdwFlags)
01326 {
01327     MOZCE_PRECHECK
01328 
01329 #ifdef DEBUG
01330     mozce_printf("-- mozce_GetHandleInformation called\n");
01331 #endif
01332 
01333     int retval = 0;
01334 
01335     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
01336 
01337     return retval;
01338 }
01339 
01340 
01341 MOZCE_SHUNT_API BOOL mozce_LockFile(HANDLE hFile, DWORD dwFileOffsetLow, DWORD dwFileOffsetHigh,
01342                                     DWORD nNumberOfBytesToLockLow, DWORD nNumberOfBytesToLockHigh)
01343 {
01344     MOZCE_PRECHECK
01345 
01346 #ifdef DEBUG
01347     mozce_printf("-- mozce_LockFile called\n");
01348 #endif
01349 
01350     int retval = 0;
01351 
01352     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
01353 
01354     return retval;
01355 }
01356 
01357 MOZCE_SHUNT_API BOOL mozce_UnlockFile(HANDLE hFile, DWORD dwFileOffsetLow, DWORD dwFileOffsetHigh,
01358                                     DWORD nNumberOfBytesToLockLow, DWORD nNumberOfBytesToLockHigh)
01359 {
01360     MOZCE_PRECHECK
01361 
01362 #ifdef DEBUG
01363     mozce_printf("-- mozce_UnlockFile called\n");
01364 #endif
01365 
01366     int retval = 0;
01367 
01368     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
01369 
01370     return retval;
01371 }
01372 
01373 MOZCE_SHUNT_API BOOL mozce_GetDiskFreeSpaceA(LPCTSTR lpRootPathName, LPDWORD lpSectorsPerCluster, 
01374                                             LPDWORD lpBytesPerSector, LPDWORD lpNumberOfFreeClusters, LPDWORD lpTotalNumberOfClusters)
01375 {
01376     MOZCE_PRECHECK
01377 
01378 #ifdef DEBUG
01379     mozce_printf("-- mozce_GetDiskFreeSpace called\n");
01380 #endif
01381 
01382     int retval = 0;
01383 
01384     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
01385 
01386     return retval;
01387 }
01388 
01389 #if 0
01390 {
01391 #endif
01392 } /* extern "C" */
01393 
01394 void dumpMemoryInfo()
01395 {
01396     MEMORYSTATUS ms;
01397     ms.dwLength = sizeof(MEMORYSTATUS);
01398     
01399     
01400     GlobalMemoryStatus(&ms);
01401     
01402     wprintf(L"-> %d %d %d %d %d %d %d\n", 
01403             ms.dwMemoryLoad, 
01404             ms.dwTotalPhys, 
01405             ms.dwAvailPhys, 
01406             ms.dwTotalPageFile, 
01407             ms.dwAvailPageFile, 
01408             ms.dwTotalVirtual, 
01409             ms.dwAvailVirtual);
01410 }