ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

main.c
Go to the documentation of this file.
00001 /*
00002  * Implementation of the OLEACC dll
00003  *
00004  * Copyright 2003 Mike McCormack for CodeWeavers
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
00019  */
00020 
00021 #include <stdarg.h>
00022 #include "windef.h"
00023 #include "winbase.h"
00024 #include "winuser.h"
00025 #include "ole2.h"
00026 #include "oleacc.h"
00027 
00028 #include "wine/unicode.h"
00029 #include "wine/debug.h"
00030 
00031 WINE_DEFAULT_DEBUG_CHANNEL(oleacc);
00032 
00033 static HINSTANCE oleacc_handle = 0;
00034 
00035 HRESULT WINAPI CreateStdAccessibleObject( HWND hwnd, LONG idObject,
00036                              REFIID riidInterface, void** ppvObject )
00037 {
00038     FIXME("%p %d %s %p\n", hwnd, idObject,
00039           debugstr_guid( riidInterface ), ppvObject );
00040     return E_NOTIMPL;
00041 }
00042 
00043 HRESULT WINAPI ObjectFromLresult( LRESULT result, REFIID riid, WPARAM wParam, void **ppObject )
00044 {
00045     FIXME("%ld %s %ld %p\n", result, debugstr_guid(riid), wParam, ppObject );
00046     return E_NOTIMPL;
00047 }
00048 
00049 LRESULT WINAPI LresultFromObject( REFIID riid, WPARAM wParam, LPUNKNOWN pAcc )
00050 {
00051     FIXME("%s %ld %p\n", debugstr_guid(riid), wParam, pAcc );
00052     return E_NOTIMPL;
00053 }
00054 
00055 HRESULT WINAPI AccessibleObjectFromPoint( POINT ptScreen, IAccessible** ppacc, VARIANT* pvarChild )
00056 {
00057     FIXME("{%d,%d} %p %p: stub\n", ptScreen.x, ptScreen.y, ppacc, pvarChild );
00058     return E_NOTIMPL;
00059 }
00060 
00061 HRESULT WINAPI AccessibleObjectFromWindow( HWND hwnd, DWORD dwObjectID,
00062                              REFIID riid, void** ppvObject )
00063 {
00064     FIXME("%p %d %s %p\n", hwnd, dwObjectID,
00065           debugstr_guid( riid ), ppvObject );
00066     return E_NOTIMPL;
00067 }
00068 
00069 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason,
00070                     LPVOID lpvReserved)
00071 {
00072     TRACE("%p, %d, %p\n", hinstDLL, fdwReason, lpvReserved);
00073 
00074     switch (fdwReason)
00075     {
00076         case DLL_PROCESS_ATTACH:
00077             oleacc_handle = hinstDLL;
00078             DisableThreadLibraryCalls(hinstDLL);
00079             break;
00080     }
00081     return TRUE;
00082 }
00083 
00084 HRESULT WINAPI DllRegisterServer(void)
00085 {
00086     FIXME("\n");
00087     return S_OK;
00088 }
00089 
00090 HRESULT WINAPI DllUnregisterServer(void)
00091 {
00092     FIXME("\n");
00093     return S_OK;
00094 }
00095 
00096 void WINAPI GetOleaccVersionInfo(DWORD* pVersion, DWORD* pBuild)
00097 {
00098     *pVersion = MAKELONG(2,4); /* Windows XP version of oleacc: 4.2.5406.0 */
00099     *pBuild = MAKELONG(0,5406);
00100 }
00101 
00102 UINT WINAPI GetRoleTextW(DWORD role, LPWSTR lpRole, UINT rolemax)
00103 {
00104     INT ret;
00105     WCHAR *resptr;
00106 
00107     TRACE("%u %p %u\n", role, lpRole, rolemax);
00108 
00109     /* return role text length */
00110     if(!lpRole)
00111         return LoadStringW(oleacc_handle, role, (LPWSTR)&resptr, 0);
00112 
00113     ret = LoadStringW(oleacc_handle, role, lpRole, rolemax);
00114     if(!(ret > 0)){
00115         if(rolemax > 0) lpRole[0] = '\0';
00116         return 0;
00117     }
00118 
00119     return ret;
00120 }
00121 
00122 UINT WINAPI GetRoleTextA(DWORD role, LPSTR lpRole, UINT rolemax)
00123 {
00124     UINT length;
00125     WCHAR *roletextW;
00126 
00127     TRACE("%u %p %u\n", role, lpRole, rolemax);
00128 
00129     length = GetRoleTextW(role, NULL, 0);
00130     if((length == 0) || (lpRole && !rolemax))
00131         return 0;
00132 
00133     roletextW = HeapAlloc(GetProcessHeap(), 0, (length + 1)*sizeof(WCHAR));
00134     if(!roletextW)
00135         return 0;
00136 
00137     GetRoleTextW(role, roletextW, length + 1);
00138 
00139     length = WideCharToMultiByte( CP_ACP, 0, roletextW, -1, NULL, 0, NULL, NULL );
00140 
00141     if(!lpRole){
00142         HeapFree(GetProcessHeap(), 0, roletextW);
00143         return length - 1;
00144     }
00145 
00146     WideCharToMultiByte( CP_ACP, 0, roletextW, -1, lpRole, rolemax, NULL, NULL );
00147 
00148     if(rolemax < length){
00149         lpRole[rolemax-1] = '\0';
00150         length = rolemax;
00151     }
00152 
00153     HeapFree(GetProcessHeap(), 0, roletextW);
00154 
00155     return length - 1;
00156 }

Generated on Sat May 26 2012 04:15:44 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.