@@ -74,17 +74,17 @@ public void Add(FuncItem funcItem)
7474 RtlMoveMemory ( newPointer , _nativePointer , oldSize ) ;
7575 Marshal . FreeHGlobal ( _nativePointer ) ;
7676 }
77- IntPtr ptrPosNewItem = ( IntPtr ) ( ( int ) newPointer + oldSize ) ;
77+ IntPtr ptrPosNewItem = ( IntPtr ) ( newPointer . ToInt64 ( ) + oldSize ) ;
7878 byte [ ] aB = Encoding . Unicode . GetBytes ( funcItem . _itemName + "\0 " ) ;
7979 Marshal . Copy ( aB , 0 , ptrPosNewItem , aB . Length ) ;
80- ptrPosNewItem = ( IntPtr ) ( ( int ) ptrPosNewItem + 128 ) ;
80+ ptrPosNewItem = ( IntPtr ) ( ptrPosNewItem . ToInt64 ( ) + 128 ) ;
8181 IntPtr p = ( funcItem . _pFunc != null ) ? Marshal . GetFunctionPointerForDelegate ( funcItem . _pFunc ) : IntPtr . Zero ;
8282 Marshal . WriteIntPtr ( ptrPosNewItem , p ) ;
83- ptrPosNewItem = ( IntPtr ) ( ( int ) ptrPosNewItem + IntPtr . Size ) ;
83+ ptrPosNewItem = ( IntPtr ) ( ptrPosNewItem . ToInt64 ( ) + IntPtr . Size ) ;
8484 Marshal . WriteInt32 ( ptrPosNewItem , funcItem . _cmdID ) ;
85- ptrPosNewItem = ( IntPtr ) ( ( int ) ptrPosNewItem + 4 ) ;
85+ ptrPosNewItem = ( IntPtr ) ( ptrPosNewItem . ToInt64 ( ) + 4 ) ;
8686 Marshal . WriteInt32 ( ptrPosNewItem , Convert . ToInt32 ( funcItem . _init2Check ) ) ;
87- ptrPosNewItem = ( IntPtr ) ( ( int ) ptrPosNewItem + 4 ) ;
87+ ptrPosNewItem = ( IntPtr ) ( ptrPosNewItem . ToInt64 ( ) + 4 ) ;
8888 if ( funcItem . _pShKey . _key != 0 )
8989 {
9090 IntPtr newShortCutKey = Marshal . AllocHGlobal ( 4 ) ;
@@ -103,15 +103,15 @@ public void RefreshItems()
103103 {
104104 FuncItem updatedItem = new FuncItem ( ) ;
105105 updatedItem . _itemName = _funcItems [ i ] . _itemName ;
106- ptrPosItem = ( IntPtr ) ( ( int ) ptrPosItem + 128 ) ;
106+ ptrPosItem = ( IntPtr ) ( ptrPosItem . ToInt64 ( ) + 128 ) ;
107107 updatedItem . _pFunc = _funcItems [ i ] . _pFunc ;
108- ptrPosItem = ( IntPtr ) ( ( int ) ptrPosItem + IntPtr . Size ) ;
108+ ptrPosItem = ( IntPtr ) ( ptrPosItem . ToInt64 ( ) + IntPtr . Size ) ;
109109 updatedItem . _cmdID = Marshal . ReadInt32 ( ptrPosItem ) ;
110- ptrPosItem = ( IntPtr ) ( ( int ) ptrPosItem + 4 ) ;
110+ ptrPosItem = ( IntPtr ) ( ptrPosItem . ToInt64 ( ) + 4 ) ;
111111 updatedItem . _init2Check = _funcItems [ i ] . _init2Check ;
112- ptrPosItem = ( IntPtr ) ( ( int ) ptrPosItem + 4 ) ;
112+ ptrPosItem = ( IntPtr ) ( ptrPosItem . ToInt64 ( ) + 4 ) ;
113113 updatedItem . _pShKey = _funcItems [ i ] . _pShKey ;
114- ptrPosItem = ( IntPtr ) ( ( int ) ptrPosItem + IntPtr . Size ) ;
114+ ptrPosItem = ( IntPtr ) ( ptrPosItem . ToInt64 ( ) + IntPtr . Size ) ;
115115
116116 _funcItems [ i ] = updatedItem ;
117117 }
0 commit comments